From cba93e87ebcbe5067608ff32f74241a6b6d4582d Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 30 Nov 2025 14:07:57 +0100 Subject: [PATCH] fix: Issues with drawing interactive tutorial --- lib/libimhex/source/api/tutorial_manager.cpp | 1 + lib/third_party/imgui/cimgui/include/cimgui.h | 3 ++- lib/third_party/imgui/cimgui/source/cimgui.cpp | 8 ++++++-- main/gui/source/window/window.cpp | 4 ++-- plugins/builtin/source/content/tutorials/introduction.cpp | 4 ++-- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/libimhex/source/api/tutorial_manager.cpp b/lib/libimhex/source/api/tutorial_manager.cpp index f664dcb83..a2244ae26 100644 --- a/lib/libimhex/source/api/tutorial_manager.cpp +++ b/lib/libimhex/source/api/tutorial_manager.cpp @@ -251,6 +251,7 @@ namespace hex { { auto highlightColor = ImGuiExt::GetCustomColorVec4(ImGuiCustomCol_Highlight); highlightColor.w *= ImSin(ImGui::GetTime() * 6.0F) / 4.0F + 0.75F; + ImHexApi::System::unlockFrameRate(); drawList->AddRect(rect.Min - ImVec2(5, 5), rect.Max + ImVec2(5, 5), ImColor(highlightColor), 5.0F, ImDrawFlags_None, 2.0F); } diff --git a/lib/third_party/imgui/cimgui/include/cimgui.h b/lib/third_party/imgui/cimgui/include/cimgui.h index 08fb85866..675e7a136 100644 --- a/lib/third_party/imgui/cimgui/include/cimgui.h +++ b/lib/third_party/imgui/cimgui/include/cimgui.h @@ -5147,7 +5147,8 @@ CIMGUI_API bool igIsDragDropActive(void); CIMGUI_API bool igBeginDragDropTargetCustom(const ImRect bb,ImGuiID id); CIMGUI_API void igClearDragDrop(void); CIMGUI_API bool igIsDragDropPayloadBeingAccepted(void); -CIMGUI_API void igRenderDragDropTargetRect(const ImRect bb,const ImRect item_clip_rect); +CIMGUI_API void igRenderDragDropTargetRectEx(ImDrawList *draw_list, const ImRect bb); +CIMGUI_API void igRenderDragDropTargetRectForItem(const ImRect bb); CIMGUI_API ImGuiTypingSelectRequest* igGetTypingSelectRequest(ImGuiTypingSelectFlags flags); CIMGUI_API int igTypingSelectFindMatch(ImGuiTypingSelectRequest* req,int items_count,const char*(*get_item_name_func)(void*,int),void* user_data,int nav_item_idx); CIMGUI_API int igTypingSelectFindNextSingleCharMatch(ImGuiTypingSelectRequest* req,int items_count,const char*(*get_item_name_func)(void*,int),void* user_data,int nav_item_idx); diff --git a/lib/third_party/imgui/cimgui/source/cimgui.cpp b/lib/third_party/imgui/cimgui/source/cimgui.cpp index 0c294ece6..da9338dfc 100644 --- a/lib/third_party/imgui/cimgui/source/cimgui.cpp +++ b/lib/third_party/imgui/cimgui/source/cimgui.cpp @@ -5141,9 +5141,13 @@ CIMGUI_API bool igIsDragDropPayloadBeingAccepted() { return ImGui::IsDragDropPayloadBeingAccepted(); } -CIMGUI_API void igRenderDragDropTargetRect(const ImRect bb,const ImRect item_clip_rect) +CIMGUI_API void igRenderDragDropTargetRectEx(ImDrawList *draw_list, const ImRect bb) { - return ImGui::RenderDragDropTargetRect(bb,item_clip_rect); + return ImGui::RenderDragDropTargetRectEx(draw_list, bb); +} +CIMGUI_API void igRenderDragDropTargetRectForItem(const ImRect bb) +{ + return ImGui::RenderDragDropTargetRectForItem(bb); } CIMGUI_API ImGuiTypingSelectRequest* igGetTypingSelectRequest(ImGuiTypingSelectFlags flags) { diff --git a/main/gui/source/window/window.cpp b/main/gui/source/window/window.cpp index 4fbfeeffc..ae647f6ff 100644 --- a/main/gui/source/window/window.cpp +++ b/main/gui/source/window/window.cpp @@ -416,8 +416,6 @@ namespace hex { // Run all deferred calls TaskManager::runDeferredCalls(); - TutorialManager::drawTutorial(); - EventFrameBegin::post(); // Handle all undocked floating windows @@ -621,6 +619,8 @@ namespace hex { } } + TutorialManager::drawTutorial(); + // Draw Toasts { u32 index = 0; diff --git a/plugins/builtin/source/content/tutorials/introduction.cpp b/plugins/builtin/source/content/tutorials/introduction.cpp index b89d15bfe..5f1039fe0 100644 --- a/plugins/builtin/source/content/tutorials/introduction.cpp +++ b/plugins/builtin/source/content/tutorials/introduction.cpp @@ -32,7 +32,7 @@ namespace hex::plugin::builtin { ) .addHighlight("hex.builtin.tutorial.introduction.step2.highlight", { - "Welcome Screen/Start##SubWindow_69AA6996", + "Welcome Screen/Start_087A287D", Lang("hex.builtin.welcome.start.create_file") }) .onAppear([&step] { @@ -85,7 +85,7 @@ namespace hex::plugin::builtin { step.addHighlight("hex.builtin.tutorial.introduction.step6.highlight", { "##MainMenuBar", - "##menubar", + "##MenuBar", Lang("hex.builtin.menu.help") }) .addHighlight({