From ebc1b531ff5bd7de08cd6df35d2a48d439142509 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 23 Dec 2025 23:29:35 +0100 Subject: [PATCH] fix: Pattern children not getting sorted properly --- lib/external/pattern_language | 2 +- plugins/ui/source/ui/pattern_drawer.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/external/pattern_language b/lib/external/pattern_language index a555801cf..b59daf1e8 160000 --- a/lib/external/pattern_language +++ b/lib/external/pattern_language @@ -1 +1 @@ -Subproject commit a555801cfa2313909b4b530cbe631310003115f6 +Subproject commit b59daf1e8ae64a6297abf571cd345cce706122df diff --git a/plugins/ui/source/ui/pattern_drawer.cpp b/plugins/ui/source/ui/pattern_drawer.cpp index ef1b6d094..1ec2a0ef1 100644 --- a/plugins/ui/source/ui/pattern_drawer.cpp +++ b/plugins/ui/source/ui/pattern_drawer.cpp @@ -699,7 +699,7 @@ namespace hex::ui { } int id = 1; - pattern.forEachEntry(0, pattern.getEntryCount(), [&] (u64, const auto &field) { + pattern.forEachEntrySorted(0, pattern.getEntryCount(), [&] (u64, const auto &field) { ImGui::PushID(id); this->draw(*field); ImGui::PopID(); @@ -895,7 +895,7 @@ namespace hex::ui { } int id = 1; - pattern.forEachEntry(0, pattern.getEntryCount(), [&](u64, const auto &member){ + pattern.forEachEntrySorted(0, pattern.getEntryCount(), [&](u64, const auto &member){ ImGui::PushID(id); this->draw(*member); ImGui::PopID(); @@ -940,7 +940,7 @@ namespace hex::ui { } int id = 1; - pattern.forEachEntry(0, pattern.getEntryCount(), [&](u64, const auto &member) { + pattern.forEachEntrySorted(0, pattern.getEntryCount(), [&](u64, const auto &member) { ImGui::PushID(id); this->draw(*member); ImGui::PopID(); @@ -1142,7 +1142,7 @@ namespace hex::ui { } int id = 1; - iterable.forEachEntry(i, endIndex, [&](u64, const auto &entry){ + iterable.forEachEntrySorted(i, endIndex, [&](u64, const auto &entry){ ImGui::PushID(id); this->draw(*entry); ImGui::PopID(); @@ -1201,7 +1201,7 @@ namespace hex::ui { ImGui::TableSetupColumn("hex.ui.pattern_drawer.var_name"_lang, ImGuiTableColumnFlags_PreferSortAscending | ImGuiTableColumnFlags_NoHide | ImGuiTableColumnFlags_IndentEnable, 0, ImGui::GetID("name")); ImGui::TableSetupColumn("hex.ui.pattern_drawer.color"_lang, ImGuiTableColumnFlags_PreferSortAscending, 0, ImGui::GetID("color")); ImGui::TableSetupColumn("hex.ui.pattern_drawer.start"_lang, ImGuiTableColumnFlags_PreferSortAscending | ImGuiTableColumnFlags_DefaultSort, 0, ImGui::GetID("start")); - ImGui::TableSetupColumn("hex.ui.pattern_drawer.end"_lang, ImGuiTableColumnFlags_PreferSortAscending | ImGuiTableColumnFlags_DefaultSort, 0, ImGui::GetID("end")); + ImGui::TableSetupColumn("hex.ui.pattern_drawer.end"_lang, ImGuiTableColumnFlags_PreferSortAscending, 0, ImGui::GetID("end")); ImGui::TableSetupColumn("hex.ui.pattern_drawer.size"_lang, ImGuiTableColumnFlags_PreferSortAscending, 0, ImGui::GetID("size")); ImGui::TableSetupColumn("hex.ui.pattern_drawer.type"_lang, ImGuiTableColumnFlags_PreferSortAscending, 0, ImGui::GetID("type")); ImGui::TableSetupColumn("hex.ui.pattern_drawer.value"_lang, ImGuiTableColumnFlags_PreferSortAscending, 0, ImGui::GetID("value")); @@ -1247,7 +1247,7 @@ namespace hex::ui { if (dynamic_cast(pattern.get()) || dynamic_cast(pattern.get())) return; - iterable->forEachEntry(0, iterable->getEntryCount(), [&](u64, const auto &entry) { + iterable->forEachEntrySorted(0, iterable->getEntryCount(), [&](u64, const auto &entry) { traversePatternTree(entry, patternPath, callback); }); }