diff --git a/soh/soh/Enhancements/randomizer/context.cpp b/soh/soh/Enhancements/randomizer/context.cpp index 7ab837ea6..7b33df771 100644 --- a/soh/soh/Enhancements/randomizer/context.cpp +++ b/soh/soh/Enhancements/randomizer/context.cpp @@ -121,6 +121,13 @@ void Context::AddLocations(const Container& locations, std::vectorinsert(destination->end(), std::cbegin(locations), std::cend(locations)); } +bool Context::IsQuestOfLocationActive(RandomizerCheck rc) { + const auto loc = Rando::StaticData::GetLocation(rc); + return loc->GetQuest() == RCQUEST_BOTH || + loc->GetQuest() == RCQUEST_MQ && mDungeons->GetDungeonFromScene(loc->GetScene())->IsMQ() || + loc->GetQuest() == RCQUEST_VANILLA && mDungeons->GetDungeonFromScene(loc->GetScene())->IsVanilla(); +} + void Context::GenerateLocationPool() { allLocations.clear(); if (mSettings->GetOption(RSK_TRIFORCE_HUNT)) { diff --git a/soh/soh/Enhancements/randomizer/context.h b/soh/soh/Enhancements/randomizer/context.h index 6542c792f..e2baf9559 100644 --- a/soh/soh/Enhancements/randomizer/context.h +++ b/soh/soh/Enhancements/randomizer/context.h @@ -50,6 +50,7 @@ class Context { void AddLocation(RandomizerCheck loc, std::vector* destination = nullptr); template void AddLocations(const Container& locations, std::vector* destination = nullptr); + bool IsQuestOfLocationActive(RandomizerCheck rc); void GenerateLocationPool(); static std::vector GetLocations(const std::vector& locationPool, const RandomizerCheckType checkType); void AddExcludedOptions(); diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_objects.cpp b/soh/soh/Enhancements/randomizer/randomizer_check_objects.cpp index a13c2b0e1..b8d435fd8 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_check_objects.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_check_objects.cpp @@ -111,7 +111,7 @@ void RandomizerCheckObjects::UpdateImGuiVisibility() { auto itemLoc = ctx->GetItemLocation(location.GetRandomizerCheck()); itemLoc->SetVisible( (location.GetRandomizerCheck() != RC_UNKNOWN_CHECK) && - (!RandomizerCheckObjects::AreaIsDungeon(location.GetArea()) || location.GetQuest() == RCQUEST_BOTH || + (location.GetQuest() == RCQUEST_BOTH || location.GetQuest() == RCQUEST_MQ && ((CVarGetInteger(CVAR_RANDOMIZER_SETTING("MQDungeons"), RO_MQ_DUNGEONS_NONE) == RO_MQ_DUNGEONS_SET_NUMBER && (CVarGetInteger(CVAR_RANDOMIZER_SETTING("MQDungeonCount"), 12) > 0) || // at least one MQ dungeon diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp index 52894d966..c78ff62ce 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp @@ -1297,11 +1297,7 @@ bool IsCheckShuffled(RandomizerCheck rc) { (loc->GetRCType() != RCTYPE_CHEST_GAME) && // don't show non final reward chest game checks until we support shuffling them (rc != RC_HC_ZELDAS_LETTER) && // don't show zeldas letter until we support shuffling it (rc != RC_LINKS_POCKET || showLinksPocket) && - (!RandomizerCheckObjects::AreaIsDungeon(loc->GetArea()) || - loc->GetQuest() == RCQUEST_BOTH || - loc->GetQuest() == RCQUEST_MQ && OTRGlobals::Instance->gRandoContext->GetDungeons()->GetDungeonFromScene(loc->GetScene())->IsMQ() || - loc->GetQuest() == RCQUEST_VANILLA && OTRGlobals::Instance->gRandoContext->GetDungeons()->GetDungeonFromScene(loc->GetScene())->IsVanilla() - ) && + OTRGlobals::Instance->gRandoContext->IsQuestOfLocationActive(rc) && (loc->GetRCType() != RCTYPE_SHOP || (showShops && OTRGlobals::Instance->gRandomizer->IdentifyShopItem(loc->GetScene(), loc->GetActorParams() + 1).enGirlAShopItem == 50)) && (rc != RC_TRIFORCE_COMPLETED || !hideTriforceCompleted) && @@ -1351,10 +1347,7 @@ bool IsCheckShuffled(RandomizerCheck rc) { ); } else if (loc->IsVanillaCompletion()) { - return (loc->GetQuest() == RCQUEST_BOTH || - (loc->GetQuest() == RCQUEST_MQ && OTRGlobals::Instance->gRandoContext->GetDungeons()->GetDungeonFromScene(loc->GetScene())->IsMQ()) || - (loc->GetQuest() == RCQUEST_VANILLA && OTRGlobals::Instance->gRandoContext->GetDungeons()->GetDungeonFromScene(loc->GetScene())->IsVanilla()) || - rc == RC_GIFT_FROM_RAURU) && rc != RC_LINKS_POCKET; + return (OTRGlobals::Instance->gRandoContext->IsQuestOfLocationActive(rc) || rc == RC_GIFT_FROM_RAURU) && rc != RC_LINKS_POCKET; } return false; } @@ -1362,8 +1355,10 @@ bool IsCheckShuffled(RandomizerCheck rc) { bool IsVisibleInCheckTracker(RandomizerCheck rc) { auto loc = Rando::StaticData::GetLocation(rc); if (IS_RANDO) { - return IsCheckShuffled(rc) || (loc->GetRCType() == RCTYPE_SKULL_TOKEN && alwaysShowGS) || - (loc->GetRCType() == RCTYPE_SHOP && (showShops && (!hideShopUnshuffledChecks))); + return 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.questId)); } @@ -1711,7 +1706,7 @@ void ImGuiDrawTwoColorPickerSection(const char* text, const char* cvarMainName, ImGui::EndTable(); } } - if (tooltip != "") { + if (tooltip != NULL && strlen(tooltip) != 0) { ImGui::SameLine(); ImGui::Text(" ?"); UIWidgets::Tooltip(tooltip);