From fe44916588dffbc6ccdc1899371c346e9d9eb1ef Mon Sep 17 00:00:00 2001 From: aMannus Date: Wed, 28 Aug 2024 20:26:03 +0200 Subject: [PATCH] Implement skipping cutscenes for common items --- soh/soh/SohMenuBar.cpp | 8 ++++++++ soh/src/overlays/actors/ovl_player_actor/z_player.c | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index cda689fd6..d43d3cedf 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -2142,6 +2142,14 @@ void DrawRandomizerMenu() { disableKeyColors = false; } + UIWidgets::PaddedEnhancementCheckbox( + "Skip Common Item Cutscenes", CVAR_RANDOMIZER_ENHANCEMENT("SkipCommonItemCutscenes"), true, false, + false, "", UIWidgets::CheckboxGraphics::Cross, true); + UIWidgets::Tooltip( + "Skips the animation of Link obtaining common items. \n\n" + "Items include: Green Rupee, Blue Rupee, Hearts refills, Ammo refills, Magic refills." + ); + static const char* disableKeyColorsText = "This setting is disabled because a savefile is loaded without any key\n" "shuffle settings set to \"Any Dungeon\", \"Overworld\" or \"Anywhere\""; diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index c5d1a65bd..f9e59ab7a 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -6812,6 +6812,13 @@ s32 Player_ActionChange_2(Player* this, PlayState* play) { interactedActor->id == ACTOR_EN_KAREBABA || interactedActor->id == ACTOR_EN_DEKUBABA; + // Automatically skip the pickup messages for very frequent items. + uint8_t isCommonItemToSkip = CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("SkipCommonItemCutscenes"), true) && giEntry.modIndex == MOD_NONE && + ((giEntry.itemId >= ITEM_RUPEE_GREEN && giEntry.itemId <= ITEM_RUPEE_BLUE) || + giEntry.itemId == ITEM_HEART || + (giEntry.itemId >= ITEM_NUTS_5 && giEntry.itemId <= ITEM_SEEDS_30) || + giEntry.itemId == ITEM_MAGIC_SMALL || giEntry.itemId == ITEM_MAGIC_LARGE); + // Skip cutscenes from picking up consumables with "Fast Pickup Text" enabled, even when the player never picked it up before. // But only for bushes/rocks/enemies because otherwise it can lead to softlocks in deku mask theatre and potentially other places. uint8_t skipItemCutscene = CVarGetInteger(CVAR_ENHANCEMENT("FastDrops"), 0) && isDropToSkip; @@ -6822,7 +6829,7 @@ s32 Player_ActionChange_2(Player* this, PlayState* play) { uint8_t skipItemCutsceneRando = IS_RANDO && Item_CheckObtainability(giEntry.itemId) != ITEM_NONE && isDropToSkip; // Show cutscene when picking up a item. - if (showItemCutscene && !skipItemCutscene && !skipItemCutsceneRando) { + if (showItemCutscene && !skipItemCutscene && !skipItemCutsceneRando && !isCommonItemToSkip) { Player_DetachHeldActor(play, this); func_8083AE40(this, giEntry.objectId);