diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp index d0cad2544..c32603b20 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp @@ -245,7 +245,8 @@ Color_RGBA8 Color_Saved_Extra = { 0, 185, 0, 255 }; // Green std::vector buttons = { BTN_A, BTN_B, BTN_CUP, BTN_CDOWN, BTN_CLEFT, BTN_CRIGHT, BTN_L, BTN_Z, BTN_R, BTN_START, BTN_DUP, BTN_DDOWN, BTN_DLEFT, BTN_DRIGHT }; static ImGuiTextFilter checkSearch; -static bool recalculateAvailable = false; +static bool gameSavedRecalculateAvailable = false; +static bool gameLoadedRecalculateAvailable = false; std::array filterAreasHidden = { 0 }; std::array filterChecksHidden = { 0 }; @@ -587,7 +588,7 @@ void CheckTrackerLoadGame(int32_t fileNum) { Rando::Context::GetInstance()->GetEntranceShuffler()->ApplyEntranceOverrides(); } - RecalculateAvailableChecks(); + gameLoadedRecalculateAvailable = true; } void CheckTrackerShopSlotChange(uint8_t cursorSlot, int16_t basePrice) { @@ -885,7 +886,7 @@ void SaveTrackerData(SaveContext* saveContext, int sectionID, bool fullSave) { void SaveFile(SaveContext* saveContext, int sectionID, bool fullSave) { SaveTrackerData(saveContext, sectionID, fullSave); if (fullSave) { - recalculateAvailable = true; + gameSavedRecalculateAvailable = true; } } @@ -994,6 +995,11 @@ void CheckTrackerWindow::DrawElement() { return; } + if (gameLoadedRecalculateAvailable) { + gameLoadedRecalculateAvailable = false; + RecalculateAvailableChecks(); + } + SceneID sceneId = SCENE_ID_MAX; if (gPlayState != nullptr) { sceneId = (SceneID)gPlayState->sceneNum; @@ -1986,7 +1992,7 @@ void ImGuiDrawTwoColorPickerSection(const char* text, const char* cvarMainName, } void RecalculateAvailableChecks(RandomizerRegion startingRegion /* = RR_ROOT */) { - if (!enableAvailableChecks || !GameInteractor::IsSaveLoaded(true)) { + if (!enableAvailableChecks || !GameInteractor::IsSaveLoaded()) { return; } @@ -2052,8 +2058,8 @@ static std::unordered_map buttonStrings = { }; void CheckTrackerSettingsWindow::DrawElement() { - if (recalculateAvailable) { - recalculateAvailable = false; + if (gameSavedRecalculateAvailable) { + gameSavedRecalculateAvailable = false; RecalculateAvailableChecks(); } ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, { 8.0f, 8.0f });