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:
committed by
GitHub
parent
6a31700820
commit
21a270c0b3
@@ -117,7 +117,9 @@ void RandomizerCheckObjects::UpdateImGuiVisibility() {
|
|||||||
RO_MQ_DUNGEONS_SET_NUMBER &&
|
RO_MQ_DUNGEONS_SET_NUMBER &&
|
||||||
(CVarGetInteger(CVAR_RANDOMIZER_SETTING("MQDungeonCount"), 12) > 0) || // at least one MQ dungeon
|
(CVarGetInteger(CVAR_RANDOMIZER_SETTING("MQDungeonCount"), 12) > 0) || // at least one MQ dungeon
|
||||||
CVarGetInteger(CVAR_RANDOMIZER_SETTING("MQDungeons"), RO_MQ_DUNGEONS_NONE) ==
|
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 &&
|
location.GetQuest() == RCQUEST_VANILLA &&
|
||||||
(CVarGetInteger(CVAR_RANDOMIZER_SETTING("MQDungeons"), RO_MQ_DUNGEONS_NONE) !=
|
(CVarGetInteger(CVAR_RANDOMIZER_SETTING("MQDungeons"), RO_MQ_DUNGEONS_NONE) !=
|
||||||
RO_MQ_DUNGEONS_SET_NUMBER ||
|
RO_MQ_DUNGEONS_SET_NUMBER ||
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ static const std::map<int32_t, const char*> skipGetItemAnimationOptions = {
|
|||||||
|
|
||||||
static bool locationsDirty = true;
|
static bool locationsDirty = true;
|
||||||
static bool tricksDirty = true;
|
static bool tricksDirty = true;
|
||||||
|
static int32_t prevMQDungeonSetting;
|
||||||
static char seedString[MAX_SEED_STRING_SIZE];
|
static char seedString[MAX_SEED_STRING_SIZE];
|
||||||
static std::set<RandomizerCheck> excludedLocations;
|
static std::set<RandomizerCheck> excludedLocations;
|
||||||
static std::set<RandomizerTrick> enabledTricks;
|
static std::set<RandomizerTrick> enabledTricks;
|
||||||
@@ -29,12 +30,14 @@ static std::set<RandomizerTrick> enabledGlitches;
|
|||||||
|
|
||||||
void DrawLocationsMenu(WidgetInfo& info) {
|
void DrawLocationsMenu(WidgetInfo& info) {
|
||||||
auto ctx = OTRGlobals::Instance->gRandoContext;
|
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);
|
static ImVec2 cellPadding(8.0f, 8.0f);
|
||||||
bool generating = CVarGetInteger(CVAR_GENERAL("RandoGenerating"), 0);
|
bool generating = CVarGetInteger(CVAR_GENERAL("RandoGenerating"), 0);
|
||||||
bool disableEditingRandoSettings = generating || CVarGetInteger(CVAR_GENERAL("OnFileSelectNameEntry"), 0);
|
bool disableEditingRandoSettings = generating || CVarGetInteger(CVAR_GENERAL("OnFileSelectNameEntry"), 0);
|
||||||
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0) || disableEditingRandoSettings);
|
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0) || disableEditingRandoSettings);
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, cellPadding);
|
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, cellPadding);
|
||||||
if (locationsDirty) {
|
if (locationsDirty || currMQDungeonSetting != prevMQDungeonSetting) {
|
||||||
RandomizerCheckObjects::UpdateImGuiVisibility();
|
RandomizerCheckObjects::UpdateImGuiVisibility();
|
||||||
// todo: this efficently when we build out cvar array support
|
// todo: this efficently when we build out cvar array support
|
||||||
std::stringstream excludedLocationStringStream(CVarGetString(CVAR_RANDOMIZER_SETTING("ExcludedLocations"), ""));
|
std::stringstream excludedLocationStringStream(CVarGetString(CVAR_RANDOMIZER_SETTING("ExcludedLocations"), ""));
|
||||||
@@ -45,6 +48,7 @@ void DrawLocationsMenu(WidgetInfo& info) {
|
|||||||
}
|
}
|
||||||
locationsDirty = false;
|
locationsDirty = false;
|
||||||
}
|
}
|
||||||
|
prevMQDungeonSetting = currMQDungeonSetting;
|
||||||
|
|
||||||
if (ImGui::BeginTable("tableRandoLocations", 2, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) {
|
if (ImGui::BeginTable("tableRandoLocations", 2, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) {
|
||||||
ImGui::TableSetupColumn("Included", ImGuiTableColumnFlags_WidthStretch, 200.0f);
|
ImGui::TableSetupColumn("Included", ImGuiTableColumnFlags_WidthStretch, 200.0f);
|
||||||
|
|||||||
Reference in New Issue
Block a user