diff options
| author | Malkierian <malkierian@gmail.com> | 2025-06-19 13:26:43 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-19 13:26:43 -0700 |
| commit | a9a49ccbe6f963ffc84c59715e30107f08c868a2 (patch) | |
| tree | 928cda7ea362eb7ad1447b0246642ef6443db7d9 | |
| parent | 2daf343755be6968b2b259e3f2b42f50f343ce28 (diff) | |
Adds saving and loading for location exclusion, and hooks the check tracker up to return false from IsVisibleInCheckTracker if a location was excluded. (#5594)
| -rw-r--r-- | soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp | 9 | ||||
| -rw-r--r-- | soh/soh/SaveManager.cpp | 6 |
2 files changed, 11 insertions, 4 deletions
diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp index 887bc3731..d0cad2544 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp @@ -1588,10 +1588,11 @@ bool IsCheckShuffled(RandomizerCheck rc) { bool IsVisibleInCheckTracker(RandomizerCheck rc) { auto loc = Rando::StaticData::GetLocation(rc); if (IS_RANDO) { - return IsCheckShuffled(rc) || - (alwaysShowGS && loc->GetRCType() == RCTYPE_SKULL_TOKEN && - OTRGlobals::Instance->gRandoContext->IsQuestOfLocationActive(rc)) || - (loc->GetRCType() == RCTYPE_SHOP && showShops && !hideShopUnshuffledChecks); + return !Rando::Context::GetInstance()->GetItemLocation(rc)->IsExcluded() && + (IsCheckShuffled(rc) || + (alwaysShowGS && loc->GetRCType() == RCTYPE_SKULL_TOKEN && + OTRGlobals::Instance->gRandoContext->IsQuestOfLocationActive(rc)) || + (loc->GetRCType() == RCTYPE_SHOP && showShops && !hideShopUnshuffledChecks)); } else { return loc->IsVanillaCompletion() && (!loc->IsDungeon() || (loc->IsDungeon() && loc->GetQuest() == gSaveContext.ship.quest.id)); diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp index e023f9afe..43bd25b23 100644 --- a/soh/soh/SaveManager.cpp +++ b/soh/soh/SaveManager.cpp @@ -179,6 +179,9 @@ void SaveManager::LoadRandomizer() { // all ItemLocations is 0 anyway. randoContext->GetItemLocation(i)->SetCustomPrice(price); } + bool excluded = false; + SaveManager::Instance->LoadData("excluded", excluded, false); + randoContext->GetItemLocation(i)->SetExcludedOption(excluded); }); }); @@ -269,6 +272,9 @@ void SaveManager::SaveRandomizer(SaveContext* saveContext, int sectionID, bool f // TODO: German (trick names don't have german translations yet) }); } + if (randoContext->GetItemLocation(i)->IsExcluded()) { + SaveManager::Instance->SaveData("excluded", true); + } if (randoContext->GetItemLocation(i)->HasCustomPrice()) { SaveManager::Instance->SaveData("price", randoContext->GetItemLocation(i)->GetPrice()); } |
