From cf3a8fbc4e559b473595163fe2c4aaaf9001e920 Mon Sep 17 00:00:00 2001 From: praydog Date: Sat, 28 Oct 2023 15:47:58 -0700 Subject: [PATCH] UObjectHook: Display objects in subwindow for easier navigation --- src/mods/UObjectHook.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mods/UObjectHook.cpp b/src/mods/UObjectHook.cpp index d4f73309..646cd7a0 100644 --- a/src/mods/UObjectHook.cpp +++ b/src/mods/UObjectHook.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -806,6 +807,14 @@ void UObjectHook::on_draw_ui() { const auto wide_filter = utility::widen(filter); + bool made_child = ImGui::BeginChild("Objects by class entries", ImVec2(0, 0), true, ImGuiWindowFlags_::ImGuiWindowFlags_HorizontalScrollbar); + + utility::ScopeGuard sg{[made_child]() { + if (made_child) { + ImGui::EndChild(); + } + }}; + for (auto uclass : m_sorted_classes) { const auto& objects_ref = m_objects_by_class[uclass];