Add option to disable Link spinning with the Goron Pot (#6138)

Make Link focus on Goron Pot instead
This commit is contained in:
Jordan Longstaff
2026-01-16 08:55:36 -05:00
committed by GitHub
parent 6e4c010ffe
commit 6606eefbf1
4 changed files with 44 additions and 1 deletions

View File

@@ -0,0 +1,29 @@
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/ShipInit.hpp"
extern "C" {
#include "functions.h"
#include "src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h"
extern PlayState* gPlayState;
}
static constexpr int32_t CVAR_LINK_SPIN_DISABLE_DEFAULT = 0;
#define CVAR_LINK_SPIN_DISABLE_NAME CVAR_ENHANCEMENT("DisableLinkSpinWithGoronPot")
#define CVAR_LINK_SPIN_DISABLE_VALUE CVarGetInteger(CVAR_LINK_SPIN_DISABLE_NAME, CVAR_LINK_SPIN_DISABLE_DEFAULT)
static void MakeLinkFocusOnPot() {
BgSpot18Basket* bgSpot18 =
(BgSpot18Basket*)Actor_Find(&gPlayState->actorCtx, ACTOR_BG_SPOT18_BASKET, ACTORCAT_PROP);
if (bgSpot18 != NULL) {
func_8002DF38(gPlayState, &bgSpot18->dyna.actor, 1);
}
}
static void RegisterDisableLinkSpinWithGoronPot() {
COND_VB_SHOULD(VB_LINK_SPIN_WITH_GORON_POT, CVAR_LINK_SPIN_DISABLE_VALUE, {
MakeLinkFocusOnPot();
*should = false;
});
}
static RegisterShipInitFunc initFunc(RegisterDisableLinkSpinWithGoronPot, { CVAR_LINK_SPIN_DISABLE_NAME });

View File

@@ -1338,6 +1338,14 @@ typedef enum {
// - `*EnKz`
VB_KING_ZORA_TUNIC_CHECK,
// #### `result`
// ```c
// true
// ```
// #### `args`
// - None
VB_LINK_SPIN_WITH_GORON_POT,
// #### `result`
// ```c
// !Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)

View File

@@ -695,6 +695,10 @@ void SohMenu::AddMenuEnhancements() {
.CVar(CVAR_ENHANCEMENT("RemoveSpinAttackDarkness"))
.RaceDisable(false)
.Options(CheckboxOptions().Tooltip("Remove the Darkness that appears when charging a Spin Attack."));
AddWidget(path, "Disable Link Spinning With Goron Pot", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_ENHANCEMENT("DisableLinkSpinWithGoronPot"))
.RaceDisable(false)
.Options(CheckboxOptions().Tooltip("Link will not spin when the Goron Pot starts to spin."));
AddWidget(path, "Draw Distance", WIDGET_SEPARATOR_TEXT).RaceDisable(false);
AddWidget(path, "Increase Actor Draw Distance: %dx", WIDGET_CVAR_SLIDER_INT)
.CVar(CVAR_ENHANCEMENT("DisableDrawDistance"))

View File

@@ -883,7 +883,9 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 camIdx, s16 csId, Actor* actor
csInfo->keyFrameCnt = 1;
func_800C0808(play, camIdx, player, CAM_SET_CS_C);
func_8002DF38(play, &player->actor, 1);
if (GameInteractor_Should(VB_LINK_SPIN_WITH_GORON_POT, true)) {
func_8002DF38(play, &player->actor, 1);
}
i = Quake_Add(csCam, 3);
Quake_SetSpeed(i, 12000);