From cdf99f70ef7d4e4c4a366191000db6c68f2343d7 Mon Sep 17 00:00:00 2001 From: praydog Date: Sat, 12 Oct 2024 10:41:04 -0700 Subject: [PATCH] UObjectHook: Split ArrayProprety elements of StructProperty --- src/mods/UObjectHook.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mods/UObjectHook.cpp b/src/mods/UObjectHook.cpp index 206d9e4a..fd5396cc 100644 --- a/src/mods/UObjectHook.cpp +++ b/src/mods/UObjectHook.cpp @@ -3531,7 +3531,15 @@ void UObjectHook::ui_handle_array_property(void* addr, sdk::FArrayProperty* prop for (size_t i = 0; i < array_obj.count; ++i) try { auto element = (void*)((uintptr_t)array_obj.data + (i * element_size)); - ui_handle_struct(element, strukt); + + if (element != nullptr) { + if (ImGui::TreeNode((void*)element, "Element %d", i)) { + // TODO: Figure out if this can be used with persistent states? + //auto scope = m_path.enter("Element " + std::to_string(i)); + ui_handle_struct(element, strukt); + ImGui::TreePop(); + } + } } catch(...) { ImGui::Text("Failed to display element %d", i); }