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"
This commit is contained in:
anthony-barricelli 2026-02-09 19:09:52 -05:00 committed by GitHub
parent 6a31700820
commit 21a270c0b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View file

@ -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 ||

View file

@ -22,6 +22,7 @@ static const std::map<int32_t, const char*> skipGetItemAnimationOptions = {
static bool locationsDirty = true;
static bool tricksDirty = true;
static int32_t prevMQDungeonSetting;
static char seedString[MAX_SEED_STRING_SIZE];
static std::set<RandomizerCheck> excludedLocations;
static std::set<RandomizerTrick> enabledTricks;
@ -29,12 +30,14 @@ static std::set<RandomizerTrick> 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);