From 21a270c0b3f68f9036fa1a007b2fbe8f1a8c4ae2 Mon Sep 17 00:00:00 2001 From: anthony-barricelli <104381450+anthony-barricelli@users.noreply.github.com> Date: Mon, 9 Feb 2026 19:09:52 -0500 Subject: [PATCH] Bug Fix: MQ Dungeon setting not updating locations in Locations tab (#6228) refresh locations if MQ dungeon setting changes + show MQ locations for "Selection Only" --- .../Enhancements/randomizer/randomizer_check_objects.cpp | 4 +++- soh/soh/SohGui/SohMenuRandomizer.cpp | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_objects.cpp b/soh/soh/Enhancements/randomizer/randomizer_check_objects.cpp index 573a86090..5b42be95e 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_check_objects.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_check_objects.cpp @@ -117,7 +117,9 @@ void RandomizerCheckObjects::UpdateImGuiVisibility() { RO_MQ_DUNGEONS_SET_NUMBER && (CVarGetInteger(CVAR_RANDOMIZER_SETTING("MQDungeonCount"), 12) > 0) || // at least one MQ dungeon CVarGetInteger(CVAR_RANDOMIZER_SETTING("MQDungeons"), RO_MQ_DUNGEONS_NONE) == - RO_MQ_DUNGEONS_RANDOM_NUMBER)) || + RO_MQ_DUNGEONS_RANDOM_NUMBER || + CVarGetInteger(CVAR_RANDOMIZER_SETTING("MQDungeons"), RO_MQ_DUNGEONS_NONE) == + RO_MQ_DUNGEONS_SELECTION)) || location.GetQuest() == RCQUEST_VANILLA && (CVarGetInteger(CVAR_RANDOMIZER_SETTING("MQDungeons"), RO_MQ_DUNGEONS_NONE) != RO_MQ_DUNGEONS_SET_NUMBER || diff --git a/soh/soh/SohGui/SohMenuRandomizer.cpp b/soh/soh/SohGui/SohMenuRandomizer.cpp index 347e56b58..0c11dffc8 100644 --- a/soh/soh/SohGui/SohMenuRandomizer.cpp +++ b/soh/soh/SohGui/SohMenuRandomizer.cpp @@ -22,6 +22,7 @@ static const std::map skipGetItemAnimationOptions = { static bool locationsDirty = true; static bool tricksDirty = true; +static int32_t prevMQDungeonSetting; static char seedString[MAX_SEED_STRING_SIZE]; static std::set excludedLocations; static std::set enabledTricks; @@ -29,12 +30,14 @@ static std::set enabledGlitches; void DrawLocationsMenu(WidgetInfo& info) { auto ctx = OTRGlobals::Instance->gRandoContext; + int32_t currMQDungeonSetting = CVarGetInteger(CVAR_RANDOMIZER_SETTING("MQDungeons"), 0) | + CVarGetInteger(CVAR_RANDOMIZER_SETTING("MQDungeonCount"), 0) << 8; static ImVec2 cellPadding(8.0f, 8.0f); bool generating = CVarGetInteger(CVAR_GENERAL("RandoGenerating"), 0); bool disableEditingRandoSettings = generating || CVarGetInteger(CVAR_GENERAL("OnFileSelectNameEntry"), 0); ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0) || disableEditingRandoSettings); ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, cellPadding); - if (locationsDirty) { + if (locationsDirty || currMQDungeonSetting != prevMQDungeonSetting) { RandomizerCheckObjects::UpdateImGuiVisibility(); // todo: this efficently when we build out cvar array support std::stringstream excludedLocationStringStream(CVarGetString(CVAR_RANDOMIZER_SETTING("ExcludedLocations"), "")); @@ -45,6 +48,7 @@ void DrawLocationsMenu(WidgetInfo& info) { } locationsDirty = false; } + prevMQDungeonSetting = currMQDungeonSetting; if (ImGui::BeginTable("tableRandoLocations", 2, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { ImGui::TableSetupColumn("Included", ImGuiTableColumnFlags_WidthStretch, 200.0f);