mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-19 21:03:42 -07:00
Cleanup cvars that are set on boot (#2863)
This commit is contained in:
parent
a72997f12b
commit
2ea72f835a
18 changed files with 194 additions and 102 deletions
|
@ -110,7 +110,10 @@ std::vector<uint32_t> buttons = { BTN_A, BTN_B, BTN_CUP, BTN_CDOWN, BTN_CLEFT,
|
|||
|
||||
void DrawCheckTracker(bool& open) {
|
||||
if (!open) {
|
||||
CVarSetInteger("gCheckTrackerEnabled", 0);
|
||||
if (CVarGetInteger("gCheckTrackerEnabled", 0)) {
|
||||
CVarClear("gCheckTrackerEnabled");
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -962,7 +965,10 @@ static const char* buttonStrings[] = { "A Button", "B Button", "C-Up", "C-Down"
|
|||
"Z Button", "R Button", "Start", "D-Up", "D-Down", "D-Left", "D-Right" };
|
||||
void DrawCheckTrackerOptions(bool& open) {
|
||||
if (!open) {
|
||||
CVarSetInteger("gCheckTrackerSettingsEnabled", 0);
|
||||
if (CVarGetInteger("gCheckTrackerSettingsEnabled", 0)) {
|
||||
CVarClear("gCheckTrackerSettingsEnabled");
|
||||
LUS::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1023,8 +1029,8 @@ void DrawCheckTrackerOptions(bool& open) {
|
|||
}
|
||||
|
||||
void InitCheckTracker() {
|
||||
LUS::AddWindow("Randomizer", "Check Tracker", DrawCheckTracker, CVarGetInteger("gCheckTrackerEnabled", 0) == 1);
|
||||
LUS::AddWindow("Randomizer", "Check Tracker Settings", DrawCheckTrackerOptions);
|
||||
LUS::AddWindow("Randomizer", "Check Tracker", DrawCheckTracker, CVarGetInteger("gCheckTrackerEnabled", 0));
|
||||
LUS::AddWindow("Randomizer", "Check Tracker Settings", DrawCheckTrackerOptions, CVarGetInteger("gCheckTrackerSettingsEnabled", 0));
|
||||
Color_Background = CVarGetColor("gCheckTrackerBgColor", Color_Bg_Default);
|
||||
Color_Area_Incomplete_Main = CVarGetColor("gCheckTrackerAreaMainIncompleteColor", Color_Main_Default);
|
||||
Color_Area_Incomplete_Extra = CVarGetColor("gCheckTrackerAreaExtraIncompleteColor", Color_Area_Incomplete_Extra_Default);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue