Adds saving and loading for location exclusion, and hooks the check tracker up to return false from IsVisibleInCheckTracker if a location was excluded. (#5594)

This commit is contained in:
Malkierian 2025-06-19 13:26:43 -07:00 committed by GitHub
parent 2daf343755
commit a9a49ccbe6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 4 deletions

View file

@ -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));

View file

@ -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());
}