mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-28 12:22:20 -05:00
Add CVarClear
to appropriate sections of randomizer Locations and Tricks tabs to get around issue with saving blank CVar strings. (#3916)
This commit is contained in:
parent
107a365b71
commit
11a0a00633
@ -4689,7 +4689,11 @@ void RandomizerSettingsWindow::DrawElement() {
|
|||||||
excludedLocationString += std::to_string(excludedLocationIt);
|
excludedLocationString += std::to_string(excludedLocationIt);
|
||||||
excludedLocationString += ",";
|
excludedLocationString += ",";
|
||||||
}
|
}
|
||||||
CVarSetString("gRandomizeExcludedLocations", excludedLocationString.c_str());
|
if (excludedLocationString == "") {
|
||||||
|
CVarClear("gRandomizeExcludedLocations");
|
||||||
|
} else {
|
||||||
|
CVarSetString("gRandomizeExcludedLocations", excludedLocationString.c_str());
|
||||||
|
}
|
||||||
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
|
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
@ -4866,7 +4870,7 @@ void RandomizerSettingsWindow::DrawElement() {
|
|||||||
enabledTrickString += std::to_string(enabledTrickIt);
|
enabledTrickString += std::to_string(enabledTrickIt);
|
||||||
enabledTrickString += ",";
|
enabledTrickString += ",";
|
||||||
}
|
}
|
||||||
CVarSetString("gRandomizeEnabledTricks", enabledTrickString.c_str());
|
CVarClear("gRandomizeEnabledTricks");
|
||||||
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
|
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
@ -5070,7 +5074,7 @@ void RandomizerSettingsWindow::DrawElement() {
|
|||||||
enabledTrickString += std::to_string(enabledTrickIt);
|
enabledTrickString += std::to_string(enabledTrickIt);
|
||||||
enabledTrickString += ",";
|
enabledTrickString += ",";
|
||||||
}
|
}
|
||||||
CVarSetString("gRandomizeEnabledTricks", enabledTrickString.c_str());
|
CVarClear("gRandomizeEnabledTricks");
|
||||||
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
|
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5108,7 +5112,11 @@ void RandomizerSettingsWindow::DrawElement() {
|
|||||||
enabledTrickString += std::to_string(enabledTrickIt);
|
enabledTrickString += std::to_string(enabledTrickIt);
|
||||||
enabledTrickString += ",";
|
enabledTrickString += ",";
|
||||||
}
|
}
|
||||||
CVarSetString("gRandomizeEnabledTricks", enabledTrickString.c_str());
|
if (enabledTrickString == "") {
|
||||||
|
CVarClear("gRandomizeEnabledTricks");
|
||||||
|
} else {
|
||||||
|
CVarSetString("gRandomizeEnabledTricks", enabledTrickString.c_str());
|
||||||
|
}
|
||||||
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
|
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
|
||||||
}
|
}
|
||||||
DrawTagChips(*rtObject.rtTags);
|
DrawTagChips(*rtObject.rtTags);
|
||||||
|
Loading…
Reference in New Issue
Block a user