From 6da4eee3063ac4c04ec014161f28acc2d063919a Mon Sep 17 00:00:00 2001 From: Archez Date: Tue, 30 Apr 2024 18:33:06 -0400 Subject: [PATCH] Add temple clears to save editor (#275) * Add temple clears to save editor * for each --- mm/2s2h/DeveloperTools/SaveEditor.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/mm/2s2h/DeveloperTools/SaveEditor.cpp b/mm/2s2h/DeveloperTools/SaveEditor.cpp index b3f9ffda8..d1fd5f614 100644 --- a/mm/2s2h/DeveloperTools/SaveEditor.cpp +++ b/mm/2s2h/DeveloperTools/SaveEditor.cpp @@ -314,7 +314,26 @@ void DrawGeneralTab() { ); ImGui::Text("Banked Rupees: %d", HS_GET_BANK_RUPEES()); - UIWidgets::Checkbox("Snowhead Cleared", (bool*)&gSaveContext.save.snowheadCleared, { .color = UIWidgets::Colors::Gray }); + + // Temple clears + static const std::array, 4> templeClears = { { + { WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE, "Woodfall Cleared" }, + { WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE, "Snowhead Cleared" }, + { WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE, "Great Bay Cleared" }, + { WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE, "Stone Tower Cleared" }, + } }; + + for (const auto& temple : templeClears) { + bool cleared = CHECK_WEEKEVENTREG(temple.first); + if (UIWidgets::Checkbox(temple.second, &cleared, { .color = UIWidgets::Colors::Gray })) { + if (cleared) { + SET_WEEKEVENTREG(temple.first); + } else { + CLEAR_WEEKEVENTREG(temple.first); + } + } + } + UIWidgets::Checkbox("Has Tatl", (bool*)&gSaveContext.save.hasTatl, { .color = UIWidgets::Colors::Gray }); ImGui::EndGroup();