mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-04-28 13:17:58 +03:00
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
This commit is contained in:
parent
c7ff6e4700
commit
084627b8af
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue