diff --git a/UE4SS/src/GUI/LiveView.cpp b/UE4SS/src/GUI/LiveView.cpp index f36680833..bb1403a72 100644 --- a/UE4SS/src/GUI/LiveView.cpp +++ b/UE4SS/src/GUI/LiveView.cpp @@ -1644,7 +1644,6 @@ namespace RC::GUI } if (auto struct_property = CastField(property); struct_property && struct_property->GetStruct()->GetFirstProperty()) { - is_watchable = false; ImGui::SameLine(); auto tree_node_id = std::format("{}{}", static_cast(container_ptr), property_name); if (ImGui_TreeNodeEx(std::format("{}", to_string(property_text.GetCharArray())).c_str(), tree_node_id.c_str(), ImGuiTreeNodeFlags_NoAutoOpenOnLog)) @@ -1679,7 +1678,6 @@ namespace RC::GUI } else if (auto array_property = CastField(property); array_property) { - is_watchable = false; ImGui::SameLine(); auto tree_node_id = std::format("{}{}", static_cast(container_ptr), property_name); if (ImGui_TreeNodeEx(std::format("{}", to_string(property_text.GetCharArray())).c_str(), tree_node_id.c_str(), ImGuiTreeNodeFlags_NoAutoOpenOnLog)) @@ -2695,6 +2693,11 @@ namespace RC::GUI auto LiveView::process_function_post_watch(Unreal::UnrealScriptFunctionCallableContext& context, void*) -> void { + if (!UnrealInitializer::StaticStorage::bIsInitialized) + { + return; + } + auto function = context.TheStack.Node(); std::lock_guard lock{LiveView::Watch::s_watch_lock}; auto it = s_watch_containers.find(function); @@ -2773,10 +2776,20 @@ namespace RC::GUI buffer.append(STR("\n\n")); watch.history.append(to_string(buffer)); + + if (watch.write_to_file) + { + watch.output.send(STR("{}"), buffer); + } } auto LiveView::process_watches() -> void { + if (!UnrealInitializer::StaticStorage::bIsInitialized) + { + return; + } + std::lock_guard lock{Watch::s_watch_lock}; for (auto& watch : s_watches) { diff --git a/assets/Changelog.md b/assets/Changelog.md index f6a8f025e..094069b43 100644 --- a/assets/Changelog.md +++ b/assets/Changelog.md @@ -22,6 +22,7 @@ TBD ### General ### Live View +Added support for watching ArrayProperty and StructProperty. ### UHT Dumper @@ -41,6 +42,8 @@ Fixed BPModLoaderMod giving "bad conversion" errors. Fixed some debug GUI layout alignments, especially with different GUI font scaling settings. ### Live View +Fixed the "Write to file" checkbox not working for functions in the `Watches` tab. +Reduced the likelihood of a crash happening on shutdown when at least one watch is enabled. ### UHT Dumper