From 12d8fad5a1bbf5d66cde2265a420e9c49c54c284 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 11 Oct 2026 22:10:59 -0400 Subject: [PATCH] Hide shuffle indicators on excluded checks (#7364) --- .../Enhancements/randomizer/ShuffleBeehives.cpp | 3 ++- soh/soh/Enhancements/randomizer/ShuffleCrates.cpp | 8 ++++++++ soh/soh/Enhancements/randomizer/ShuffleGrass.cpp | 3 ++- .../Enhancements/randomizer/ShuffleIcicles.cpp | 4 ++++ soh/soh/Enhancements/randomizer/ShufflePots.cpp | 3 ++- soh/soh/Enhancements/randomizer/ShuffleRedIce.cpp | 3 ++- soh/soh/Enhancements/randomizer/ShuffleRocks.cpp | 15 ++++++++++++--- soh/soh/Enhancements/randomizer/ShuffleSigns.cpp | 3 ++- soh/soh/Enhancements/randomizer/ShuffleTrees.cpp | 4 ++++ .../randomizer/ShuffleWonderItems.cpp | 3 ++- 10 files changed, 40 insertions(+), 9 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/ShuffleBeehives.cpp b/soh/soh/Enhancements/randomizer/ShuffleBeehives.cpp index fc5c0bbb82..61e3d6db51 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleBeehives.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleBeehives.cpp @@ -52,7 +52,8 @@ void ObjComb_RandomizerWait(ObjComb* objComb, PlayState* play) { const auto beehiveIdentity = ObjectExtension::GetInstance().Get(&objComb->actor); if (RAND_GET_OPTION(RSK_SHUFFLE_BEEHIVES) && beehiveIdentity != nullptr && - !Flags_GetRandomizerInf(beehiveIdentity->randomizerInf)) { + !Flags_GetRandomizerInf(beehiveIdentity->randomizerInf) && + !Rando::Context::GetInstance()->GetItemLocation(beehiveIdentity->randomizerCheck)->IsExcluded()) { if (objComb->unk_1B0 <= -5000) { objComb->unk_1B0 = 1500; } diff --git a/soh/soh/Enhancements/randomizer/ShuffleCrates.cpp b/soh/soh/Enhancements/randomizer/ShuffleCrates.cpp index c07261406b..9eab91743b 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleCrates.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleCrates.cpp @@ -281,6 +281,10 @@ void RegisterShuffleCrates() { COND_VB_SHOULD(VB_CRATE_SETUP_DRAW, shouldRegister, { ObjKibako2* crateActor = va_arg(args, ObjKibako2*); if (ObjKibako2_RandomizerHoldsItem(crateActor, gPlayState)) { + const auto crateIdentity = ObjectExtension::GetInstance().Get(&crateActor->dyna.actor); + if (Rando::Context::GetInstance()->GetItemLocation(crateIdentity->randomizerCheck)->IsExcluded()) { + return; + } crateActor->dyna.actor.draw = (ActorFunc)ObjKibako2_RandomizerDraw; *should = false; } @@ -301,6 +305,10 @@ void RegisterShuffleCrates() { COND_VB_SHOULD(VB_SMALL_CRATE_SETUP_DRAW, shouldRegister, { ObjKibako* smallCrateActor = va_arg(args, ObjKibako*); if (ObjKibako_RandomizerHoldsItem(smallCrateActor, gPlayState)) { + const auto crateIdentity = ObjectExtension::GetInstance().Get(&smallCrateActor->actor); + if (Rando::Context::GetInstance()->GetItemLocation(crateIdentity->randomizerCheck)->IsExcluded()) { + return; + } smallCrateActor->actor.draw = (ActorFunc)ObjKibako_RandomizerDraw; *should = false; } diff --git a/soh/soh/Enhancements/randomizer/ShuffleGrass.cpp b/soh/soh/Enhancements/randomizer/ShuffleGrass.cpp index f93fe85e88..347ee37c96 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleGrass.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleGrass.cpp @@ -38,7 +38,8 @@ extern "C" void EnKusa_RandomizerDraw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); if (grassIdentity != nullptr && grassIdentity->randomizerCheck != RC_MAX && - Flags_GetRandomizerInf(grassIdentity->randomizerInf) == 0) { + Flags_GetRandomizerInf(grassIdentity->randomizerInf) == 0 && + !Rando::Context::GetInstance()->GetItemLocation(grassIdentity->randomizerCheck)->IsExcluded()) { bool csmc = CVarGetInteger(CVAR_ENHANCEMENT("ChestSizeAndTextureMatchContents"), 0); int requiresStoneAgony = CVarGetInteger(CVAR_ENHANCEMENT("ChestSizeDependsStoneOfAgony"), 0); diff --git a/soh/soh/Enhancements/randomizer/ShuffleIcicles.cpp b/soh/soh/Enhancements/randomizer/ShuffleIcicles.cpp index 88a2ae1b30..8e1db4e7fc 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleIcicles.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleIcicles.cpp @@ -128,6 +128,10 @@ void RegisterShuffleIcicles() { BgIceTurara* icicleActor = va_arg(args, BgIceTurara*); if (BgIceTurara_RandomizerHoldsItem(&icicleActor->dyna.actor) && !ObjectExtension::GetInstance().Has(&icicleActor->dyna.actor)) { + const auto icicleIdentity = ObjectExtension::GetInstance().Get(&icicleActor->dyna.actor); + if (Rando::Context::GetInstance()->GetItemLocation(icicleIdentity->randomizerCheck)->IsExcluded()) { + return; + } DrawItemHalo(&icicleActor->dyna.actor); } }); diff --git a/soh/soh/Enhancements/randomizer/ShufflePots.cpp b/soh/soh/Enhancements/randomizer/ShufflePots.cpp index 6b658b758e..28785c1481 100644 --- a/soh/soh/Enhancements/randomizer/ShufflePots.cpp +++ b/soh/soh/Enhancements/randomizer/ShufflePots.cpp @@ -28,7 +28,8 @@ extern "C" void ObjTsubo_RandomizerDraw(Actor* thisx, PlayState* play) { const auto potIdentity = ObjectExtension::GetInstance().Get(thisx); if (potIdentity != nullptr && potIdentity->randomizerCheck != RC_MAX && - Flags_GetRandomizerInf(potIdentity->randomizerInf) == 0) { + Flags_GetRandomizerInf(potIdentity->randomizerInf) == 0 && + !Rando::Context::GetInstance()->GetItemLocation(potIdentity->randomizerCheck)->IsExcluded()) { bool csmc = CVarGetInteger(CVAR_ENHANCEMENT("ChestSizeAndTextureMatchContents"), 0); int requiresStoneAgony = CVarGetInteger(CVAR_ENHANCEMENT("ChestSizeDependsStoneOfAgony"), 0); diff --git a/soh/soh/Enhancements/randomizer/ShuffleRedIce.cpp b/soh/soh/Enhancements/randomizer/ShuffleRedIce.cpp index cd221d2bfb..4047a16390 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleRedIce.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleRedIce.cpp @@ -75,7 +75,8 @@ void BgIceShelter_RandomizerDrawSetup(void* actor) { Color_RGBA8 envColor; const auto redIceIdentity = ObjectExtension::GetInstance().Get(redIceActor); - if (redIceIdentity == nullptr) { + if (redIceIdentity == nullptr || + Rando::Context::GetInstance()->GetItemLocation(redIceIdentity->randomizerCheck)->IsExcluded()) { return; } diff --git a/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp b/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp index 28f770a3cb..8389d4d0c0 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp @@ -230,8 +230,11 @@ void EnIshi_RandomizerInit(void* actorRef) { auto rockIdentity = IdentifyRock(gPlayState->sceneNum, (s16)actor->world.pos.x, (s16)actor->world.pos.z); if (Rock_RandomizerHoldsItem(rockIdentity, gPlayState, actor->params & 1) && rockActor->actor.draw != nullptr) { + bool isExcluded = Rando::Context::GetInstance()->GetItemLocation(rockIdentity.randomizerCheck)->IsExcluded(); ObjectExtension::GetInstance().Set(actor, std::move(rockIdentity)); - rockActor->actor.draw = EnIshi_RandomizerDraw; + if (!isExcluded) { + rockActor->actor.draw = EnIshi_RandomizerDraw; + } } } @@ -241,8 +244,11 @@ void ObjBombiwa_RandomizerInit(void* actorRef) { auto rockIdentity = IdentifyRock(gPlayState->sceneNum, (s16)actor->world.pos.x, (s16)actor->world.pos.z); if (Rock_RandomizerHoldsItem(rockIdentity, gPlayState, true) && rockActor->actor.draw != nullptr) { + bool isExcluded = Rando::Context::GetInstance()->GetItemLocation(rockIdentity.randomizerCheck)->IsExcluded(); ObjectExtension::GetInstance().Set(actor, std::move(rockIdentity)); - rockActor->actor.draw = ObjBombiwa_RandomizerDraw; + if (!isExcluded) { + rockActor->actor.draw = ObjBombiwa_RandomizerDraw; + } } } @@ -252,8 +258,11 @@ void ObjHamishi_RandomizerInit(void* actorRef) { auto rockIdentity = IdentifyRock(gPlayState->sceneNum, (s16)actor->world.pos.x, (s16)actor->world.pos.z); if (Rock_RandomizerHoldsItem(rockIdentity, gPlayState, true) && rockActor->actor.draw != nullptr) { + bool isExcluded = Rando::Context::GetInstance()->GetItemLocation(rockIdentity.randomizerCheck)->IsExcluded(); ObjectExtension::GetInstance().Set(actor, std::move(rockIdentity)); - rockActor->actor.draw = ObjHamishi_RandomizerDraw; + if (!isExcluded) { + rockActor->actor.draw = ObjHamishi_RandomizerDraw; + } } } diff --git a/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp b/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp index ea4ab5a2cd..e82b03c25c 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp @@ -63,7 +63,8 @@ void Sign_RandomizerDrawSetup(void* actor) { int isNotCMC = !cmc || (requiresStoneAgony && !CHECK_QUEST_ITEM(QUEST_STONE_OF_AGONY)); const auto signIdentity = ObjectExtension::GetInstance().Get(signActor); - if (signIdentity == nullptr) { + if (signIdentity == nullptr || + Rando::Context::GetInstance()->GetItemLocation(signIdentity->randomizerCheck)->IsExcluded()) { return; } diff --git a/soh/soh/Enhancements/randomizer/ShuffleTrees.cpp b/soh/soh/Enhancements/randomizer/ShuffleTrees.cpp index 16005caddc..e4445b3960 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleTrees.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleTrees.cpp @@ -176,6 +176,10 @@ void RegisterShuffleTrees() { COND_VB_SHOULD(VB_TREE_SETUP_DRAW, shouldRegisterTree || shouldRegisterBush, { EnWood02* treeActor = va_arg(args, EnWood02*); if (EnWood02_RandomizerHoldsItem(treeActor, gPlayState)) { + const auto treeIdentity = ObjectExtension::GetInstance().Get(&treeActor->actor); + if (Rando::Context::GetInstance()->GetItemLocation(treeIdentity->randomizerCheck)->IsExcluded()) { + return; + } EnWood02_RandomizerDraw(&treeActor->actor, gPlayState); } }); diff --git a/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp b/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp index 637df88f2b..c4b288a360 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp @@ -215,7 +215,8 @@ void EnWonderItem_RandomizerDrawSetup(void* refActor) { int isNotCMC = !cmc || (requiresStoneAgony && !CHECK_QUEST_ITEM(QUEST_STONE_OF_AGONY)); const auto wonderIdentity = ObjectExtension::GetInstance().Get(refActor); - if (wonderIdentity == nullptr) { + if (wonderIdentity == nullptr || + Rando::Context::GetInstance()->GetItemLocation(wonderIdentity->randomizerCheck)->IsExcluded()) { return; }