Cleanup cvars that are set on boot (#2863)

This commit is contained in:
Garrett Cox
2023-05-10 13:08:35 +00:00
committed by GitHub
parent a72997f12b
commit 2ea72f835a
18 changed files with 194 additions and 102 deletions

View File

@@ -1733,7 +1733,10 @@ void DrawPlayerTab() {
void DrawSaveEditor(bool& open) {
if (!open) {
CVarSetInteger("gSaveEditorEnabled", 0);
if (CVarGetInteger("gSaveEditorEnabled", 0)) {
CVarClear("gSaveEditorEnabled");
LUS::RequestCvarSaveOnNextTick();
}
return;
}
@@ -1781,7 +1784,7 @@ void DrawSaveEditor(bool& open) {
}
void InitSaveEditor() {
LUS::AddWindow("Developer Tools", "Save Editor", DrawSaveEditor);
LUS::AddWindow("Developer Tools", "Save Editor", DrawSaveEditor, CVarGetInteger("gSaveEditorEnabled", 0));
// Load item icons into ImGui
for (const auto& entry : itemMapping) {