From 084627b8af862404b8df4288efab44301b2f466b Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Mon, 24 Mar 2025 17:58:56 -0400 Subject: [PATCH] Force excluded locations update when preset is applied. (#5205) * Force excluded locations update when preset is applied. * Apply same fix for tricks tab * Address review comment --- soh/soh/Enhancements/randomizer/randomizer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 081df968c..8809d8691 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -1937,6 +1937,8 @@ void RandomizerSettingsWindow::DrawElement() { generated = 0; randoThread.join(); } + static bool locationsTabOpen = false; + static bool tricksTabOpen = false; bool disableEditingRandoSettings = CVarGetInteger(CVAR_GENERAL("RandoGenerating"), 0) || CVarGetInteger(CVAR_GENERAL("OnFileSelectNameEntry"), 0); ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0) || disableEditingRandoSettings); const PresetTypeDefinition presetTypeDef = presetTypes.at(PRESET_TYPE_RANDOMIZER); @@ -1971,6 +1973,9 @@ void RandomizerSettingsWindow::DrawElement() { CVarSetInteger(presetTypeCvar.c_str(), randomizerPresetSelected); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); mSettings->UpdateOptionProperties(); + // force excluded location list and trick list update if tab is open. + locationsTabOpen = false; + tricksTabOpen = false; } UIWidgets::Spacer(0); @@ -2060,7 +2065,6 @@ void RandomizerSettingsWindow::DrawElement() { ImGui::EndDisabled(); ImGui::BeginDisabled(CVarGetInteger(CVAR_RANDOMIZER_SETTING("LogicRules"), RO_LOGIC_GLITCHLESS) == RO_LOGIC_VANILLA); - static bool locationsTabOpen = false; if (ImGui::BeginTabItem("Locations")) { ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, cellPadding); if (!locationsTabOpen) { @@ -2189,7 +2193,6 @@ void RandomizerSettingsWindow::DrawElement() { } ImGui::EndDisabled(); - static bool tricksTabOpen = false; if (ImGui::BeginTabItem("Tricks/Glitches")) { if (!tricksTabOpen) { tricksTabOpen = true;