Always call RandomizerCheckObjects::UpdateImGuiVisibility for locations view (#6352)
This commit is contained in:
@@ -3463,7 +3463,7 @@ void GenerateRandomizerImgui(std::string seed = "") {
|
|||||||
// RANDOTODO proper UI for selecting if a spoiler loaded should be used for settings
|
// RANDOTODO proper UI for selecting if a spoiler loaded should be used for settings
|
||||||
Rando::Settings::GetInstance()->SetAllToContext();
|
Rando::Settings::GetInstance()->SetAllToContext();
|
||||||
|
|
||||||
// todo: this efficently when we build out cvar array support
|
// todo: this efficiently when we build out cvar array support
|
||||||
std::set<RandomizerCheck> excludedLocations;
|
std::set<RandomizerCheck> excludedLocations;
|
||||||
std::stringstream excludedLocationStringStream(CVarGetString(CVAR_RANDOMIZER_SETTING("ExcludedLocations"), ""));
|
std::stringstream excludedLocationStringStream(CVarGetString(CVAR_RANDOMIZER_SETTING("ExcludedLocations"), ""));
|
||||||
std::string excludedLocationString;
|
std::string excludedLocationString;
|
||||||
|
|||||||
@@ -53,11 +53,13 @@ void DrawLocationsMenu(WidgetInfo& info) {
|
|||||||
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 || currMQDungeonSetting != prevMQDungeonSetting) {
|
if (locationsDirty || currMQDungeonSetting != prevMQDungeonSetting || GameInteractor::IsSaveLoaded()) {
|
||||||
locationsDirty = false;
|
locationsDirty = false;
|
||||||
|
prevMQDungeonSetting = currMQDungeonSetting;
|
||||||
UpdateMenuLocations();
|
UpdateMenuLocations();
|
||||||
|
} else {
|
||||||
|
RandomizerCheckObjects::UpdateImGuiVisibility();
|
||||||
}
|
}
|
||||||
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);
|
||||||
@@ -97,11 +99,13 @@ void DrawLocationsMenu(WidgetInfo& info) {
|
|||||||
UIWidgets::PushStyleButton(THEME_COLOR, ImVec2(7.f, 5.f));
|
UIWidgets::PushStyleButton(THEME_COLOR, ImVec2(7.f, 5.f));
|
||||||
if (ImGui::ArrowButton(std::to_string(location).c_str(), ImGuiDir_Right)) {
|
if (ImGui::ArrowButton(std::to_string(location).c_str(), ImGuiDir_Right)) {
|
||||||
excludedLocations.insert(location);
|
excludedLocations.insert(location);
|
||||||
// todo: this efficently when we build out cvar array support
|
// todo: this efficiently when we build out cvar array support
|
||||||
std::string excludedLocationString = "";
|
std::string excludedLocationString = "";
|
||||||
for (auto excludedLocationIt : excludedLocations) {
|
for (auto excludedLocationIt : excludedLocations) {
|
||||||
excludedLocationString += std::to_string(excludedLocationIt);
|
if (!excludedLocationString.empty()) {
|
||||||
excludedLocationString += ",";
|
excludedLocationString += ",";
|
||||||
|
}
|
||||||
|
excludedLocationString += excludedLocationIt;
|
||||||
}
|
}
|
||||||
CVarSetString(CVAR_RANDOMIZER_SETTING("ExcludedLocations"),
|
CVarSetString(CVAR_RANDOMIZER_SETTING("ExcludedLocations"),
|
||||||
excludedLocationString.c_str());
|
excludedLocationString.c_str());
|
||||||
@@ -142,11 +146,13 @@ void DrawLocationsMenu(WidgetInfo& info) {
|
|||||||
UIWidgets::PushStyleButton(THEME_COLOR, ImVec2(7.f, 5.f));
|
UIWidgets::PushStyleButton(THEME_COLOR, ImVec2(7.f, 5.f));
|
||||||
if (ImGui::ArrowButton(std::to_string(location).c_str(), ImGuiDir_Left)) {
|
if (ImGui::ArrowButton(std::to_string(location).c_str(), ImGuiDir_Left)) {
|
||||||
excludedLocations.erase(elfound);
|
excludedLocations.erase(elfound);
|
||||||
// todo: this efficently when we build out cvar array support
|
// todo: this efficiently when we build out cvar array support
|
||||||
std::string excludedLocationString = "";
|
std::string excludedLocationString = "";
|
||||||
for (auto excludedLocationIt : excludedLocations) {
|
for (auto excludedLocationIt : excludedLocations) {
|
||||||
excludedLocationString += std::to_string(excludedLocationIt);
|
if (!excludedLocationString.empty()) {
|
||||||
excludedLocationString += ",";
|
excludedLocationString += ",";
|
||||||
|
}
|
||||||
|
excludedLocationString += excludedLocationIt;
|
||||||
}
|
}
|
||||||
if (excludedLocationString == "") {
|
if (excludedLocationString == "") {
|
||||||
CVarClear(CVAR_RANDOMIZER_SETTING("ExcludedLocations"));
|
CVarClear(CVAR_RANDOMIZER_SETTING("ExcludedLocations"));
|
||||||
@@ -177,7 +183,7 @@ void DrawLocationsMenu(WidgetInfo& info) {
|
|||||||
|
|
||||||
void UpdateMenuLocations() {
|
void UpdateMenuLocations() {
|
||||||
RandomizerCheckObjects::UpdateImGuiVisibility();
|
RandomizerCheckObjects::UpdateImGuiVisibility();
|
||||||
// todo: this efficently when we build out cvar array support
|
// todo: this efficiently when we build out cvar array support
|
||||||
std::stringstream excludedLocationStringStream(CVarGetString(CVAR_RANDOMIZER_SETTING("ExcludedLocations"), ""));
|
std::stringstream excludedLocationStringStream(CVarGetString(CVAR_RANDOMIZER_SETTING("ExcludedLocations"), ""));
|
||||||
std::string excludedLocationString;
|
std::string excludedLocationString;
|
||||||
excludedLocations.clear();
|
excludedLocations.clear();
|
||||||
@@ -188,7 +194,7 @@ void UpdateMenuLocations() {
|
|||||||
|
|
||||||
void UpdateMenuTricks() {
|
void UpdateMenuTricks() {
|
||||||
// RandomizerTricks::UpdateImGuiVisibility();
|
// RandomizerTricks::UpdateImGuiVisibility();
|
||||||
// todo: this efficently when we build out cvar array support
|
// todo: this efficiently when we build out cvar array support
|
||||||
std::stringstream enabledTrickStringStream(CVarGetString(CVAR_RANDOMIZER_SETTING("EnabledTricks"), ""));
|
std::stringstream enabledTrickStringStream(CVarGetString(CVAR_RANDOMIZER_SETTING("EnabledTricks"), ""));
|
||||||
std::string enabledTrickString;
|
std::string enabledTrickString;
|
||||||
enabledTricks.clear();
|
enabledTricks.clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user