From 0d54cb15dff21c763d73171451871ae1e2d34d3c Mon Sep 17 00:00:00 2001 From: Josh Bodner <30329717+jbodner09@users.noreply.github.com> Date: Thu, 2 Mar 2023 13:57:55 -0800 Subject: [PATCH] Spot fix so autosave dropdown will save immediately (#2568) --- soh/soh/GameMenuBar.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/soh/soh/GameMenuBar.cpp b/soh/soh/GameMenuBar.cpp index a385d486d..8bf132a7a 100644 --- a/soh/soh/GameMenuBar.cpp +++ b/soh/soh/GameMenuBar.cpp @@ -834,18 +834,9 @@ namespace GameMenuBar { UIWidgets::PaddedSeparator(false, true); // Autosave enum value of 1 is the default in presets and the old checkbox "on" state for backwards compatibility - const uint16_t selectedAutosaveId = CVarGetInteger("gAutosave", 0); - std::string autosaveLabels[] = { "Off", "New Location + Major Item", "New Location + Any Item", "New Location", "Major Item", "Any Item" }; UIWidgets::PaddedText("Autosave", false, true); - if (ImGui::BeginCombo("##AutosaveComboBox", autosaveLabels[selectedAutosaveId].c_str())) { - for (int index = 0; index < sizeof(autosaveLabels) / sizeof(autosaveLabels[0]); index++) { - if (ImGui::Selectable(autosaveLabels[index].c_str(), index == selectedAutosaveId)) { - CVarSetInteger("gAutosave", index); - } - } - - ImGui::EndCombo(); - } + const char* autosaveLabels[] = { "Off", "New Location + Major Item", "New Location + Any Item", "New Location", "Major Item", "Any Item" }; + UIWidgets::EnhancementCombobox("gAutosave", autosaveLabels, (sizeof(autosaveLabels) / sizeof(autosaveLabels[0])), CVarGetInteger("gAutosave", 0)); UIWidgets::Tooltip("Automatically save the game every time a new area is entered and/or item is obtained\n" "Major items exclude rupees and health/magic/ammo refills (but include bombchus unless bombchu drops are enabled)");