Fixes a few bugs I introduced for MQ file select screen. (#1808)

* Fixes a few bugs I introduced for MQ file select screen.

- MQ Saves could not be loaded while only an mq otr is present, because `requiresOriginal` was true when `gSaveContext.mqDungeonCount` was less than 12. That value only ever gets set for rando saves, so I added a check for the rando flag to that conditional.
- The rando tag was not getting grayed out with the rest of the save file.
- Some necessary meta info wasn't getting loaded when the randomizer CVar was off. Removed that check so that the rando save data always gets loaded during InitMeta. That way the amount of mq dungeons can be checked for validity with the loaded set of OTRs even if randomizer isn't enabled.

* i not 1

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
This commit is contained in:
Christopher Leggett 2022-10-20 22:13:08 -04:00 committed by GitHub
parent f4ac37f54a
commit f756da02e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -128,8 +128,6 @@ void SaveManager::LoadRandomizerVersion1() {
} }
void SaveManager::LoadRandomizerVersion2() { void SaveManager::LoadRandomizerVersion2() {
if(!CVar_GetS32("gRandomizer", 0)) return;
SaveManager::Instance->LoadArray("itemLocations", RC_MAX, [&](size_t i) { SaveManager::Instance->LoadArray("itemLocations", RC_MAX, [&](size_t i) {
gSaveContext.itemLocations[i].check = RandomizerCheck(i); gSaveContext.itemLocations[i].check = RandomizerCheck(i);
SaveManager::Instance->LoadStruct("", [&]() { SaveManager::Instance->LoadStruct("", [&]() {
@ -338,8 +336,11 @@ void SaveManager::InitMeta(int fileNum) {
} }
fileMetaInfo[fileNum].randoSave = gSaveContext.n64ddFlag; fileMetaInfo[fileNum].randoSave = gSaveContext.n64ddFlag;
fileMetaInfo[fileNum].requiresMasterQuest = gSaveContext.isMasterQuest || gSaveContext.mqDungeonCount > 0; // If the file is marked as a Master Quest file or if we're randomized and have at least one master quest dungeon, we need the mq otr.
fileMetaInfo[fileNum].requiresOriginal = !gSaveContext.isMasterQuest || gSaveContext.mqDungeonCount < 12; fileMetaInfo[fileNum].requiresMasterQuest = gSaveContext.isMasterQuest > 0 || (gSaveContext.n64ddFlag && gSaveContext.mqDungeonCount > 0);
// If the file is not marked as Master Quest, it could still theoretically be a rando save with all 12 MQ dungeons, in which case
// we don't actually require a vanilla OTR.
fileMetaInfo[fileNum].requiresOriginal = !gSaveContext.isMasterQuest && (!gSaveContext.n64ddFlag || gSaveContext.mqDungeonCount < 12);
} }
void SaveManager::InitFile(bool isDebug) { void SaveManager::InitFile(bool isDebug) {

View File

@ -1113,7 +1113,7 @@ void FileChoose_DrawWindowContents(GameState* thisx) {
// draw rando label // draw rando label
if (Save_GetSaveMetaInfo(i)->randoSave) { if (Save_GetSaveMetaInfo(i)->randoSave) {
if (CVar_GetS32("gHudColors", 1) == 2) { if (CVar_GetS32("gHudColors", 1) == 2 && FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i))) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->nameAlpha[i]); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->nameAlpha[i]);
} else if (!FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i))) { } else if (!FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i))) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[1][0], sWindowContentColors[1][1], gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[1][0], sWindowContentColors[1][1],