From 3e0225272fdca600132da124dcaae28eb60bd747 Mon Sep 17 00:00:00 2001 From: OtherBlue <93625085+OtherBlue@users.noreply.github.com> Date: Fri, 9 Jan 2026 22:03:03 -0300 Subject: [PATCH] Make "Move in First Person" require "Right Stick Aiming" (#6104) --- .../controls/SohInputEditorWindow.cpp | 11 +++++------ .../overlays/actors/ovl_player_actor/z_player.c | 15 ++++++++++----- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp b/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp index 208833d61..4bf41ec49 100644 --- a/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp +++ b/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp @@ -1377,12 +1377,11 @@ void SohInputEditorWindow::DrawCameraControlPanel() { CheckboxOptions() .Color(THEME_COLOR) .Tooltip("Allows for aiming with the right stick in:\n-First-Person/C-Up view\n-Weapon Aiming")); - if (CVarGetInteger(CVAR_SETTING("Controls.RightStickAim"), 0)) { - CVarCheckbox("Allow moving while in first-person mode", CVAR_SETTING("MoveInFirstPerson"), - CheckboxOptions() - .Color(THEME_COLOR) - .Tooltip("Changes the left stick to move the player while in first-person mode")); - } + CVarCheckbox("Allow moving while in first-person mode", CVAR_SETTING("MoveInFirstPerson"), + CheckboxOptions({ { .disabled = !CVarGetInteger(CVAR_SETTING("Controls.RightStickAim"), 0), + .disabledTooltip = "Forced off because Right Stick Aiming is disabled." } }) + .Color(THEME_COLOR) + .Tooltip("Changes the left stick to move the player while in first-person mode")); CVarCheckbox("Invert Aiming X Axis", CVAR_SETTING("Controls.InvertAimingXAxis"), CheckboxOptions() .Color(THEME_COLOR) 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 e6d73a529..218f232ad 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -12746,7 +12746,8 @@ s16 func_8084ABD8(PlayState* play, Player* this, s32 arg2, s16 arg3) { if (!func_8002DD78(this) && !func_808334B4(this) && (arg2 == 0)) { // First person without weapon // Y Axis - if (!CVarGetInteger(CVAR_SETTING("MoveInFirstPerson"), 0)) { + if (!(CVarGetInteger(CVAR_SETTING("MoveInFirstPerson"), 0) && + CVarGetInteger(CVAR_SETTING("Controls.RightStickAim"), 0))) { temp2 += sControlInput->rel.stick_y * 240.0f * invertYAxisMulti * yAxisMulti; } if (CVarGetInteger(CVAR_SETTING("Controls.RightStickAim"), 0)) { @@ -12764,7 +12765,8 @@ s16 func_8084ABD8(PlayState* play, Player* this, s32 arg2, s16 arg3) { // X Axis temp2 = 0; - if (!CVarGetInteger(CVAR_SETTING("MoveInFirstPerson"), 0)) { + if (!(CVarGetInteger(CVAR_SETTING("MoveInFirstPerson"), 0) && + CVarGetInteger(CVAR_SETTING("Controls.RightStickAim"), 0))) { temp2 += sControlInput->rel.stick_x * -16.0f * invertXAxisMulti * xAxisMulti; } if (CVarGetInteger(CVAR_SETTING("Controls.RightStickAim"), 0)) { @@ -12779,7 +12781,8 @@ s16 func_8084ABD8(PlayState* play, Player* this, s32 arg2, s16 arg3) { // Y Axis temp1 = (this->stateFlags1 & PLAYER_STATE1_ON_HORSE) ? 3500 : 14000; - if (!CVarGetInteger(CVAR_SETTING("MoveInFirstPerson"), 0)) { + if (!(CVarGetInteger(CVAR_SETTING("MoveInFirstPerson"), 0) && + CVarGetInteger(CVAR_SETTING("Controls.RightStickAim"), 0))) { temp3 += ((sControlInput->rel.stick_y >= 0) ? 1 : -1) * (s32)((1.0f - Math_CosS(sControlInput->rel.stick_y * 200)) * 1500.0f) * invertYAxisMulti * yAxisMulti; @@ -12799,7 +12802,8 @@ s16 func_8084ABD8(PlayState* play, Player* this, s32 arg2, s16 arg3) { temp1 = 19114; temp2 = this->actor.focus.rot.y - this->actor.shape.rot.y; temp3 = 0; - if (!CVarGetInteger(CVAR_SETTING("MoveInFirstPerson"), 0)) { + if (!(CVarGetInteger(CVAR_SETTING("MoveInFirstPerson"), 0) && + CVarGetInteger(CVAR_SETTING("Controls.RightStickAim"), 0))) { temp3 = ((sControlInput->rel.stick_x >= 0) ? 1 : -1) * (s32)((1.0f - Math_CosS(sControlInput->rel.stick_x * 200)) * -1500.0f) * invertXAxisMulti * xAxisMulti; @@ -12816,7 +12820,8 @@ s16 func_8084ABD8(PlayState* play, Player* this, s32 arg2, s16 arg3) { this->actor.focus.rot.y = CLAMP(temp2, -temp1, temp1) + this->actor.shape.rot.y; } - if (CVarGetInteger(CVAR_SETTING("MoveInFirstPerson"), 0)) { + if (CVarGetInteger(CVAR_SETTING("MoveInFirstPerson"), 0) && + CVarGetInteger(CVAR_SETTING("Controls.RightStickAim"), 0)) { f32 movementSpeed = LINK_IS_ADULT ? 9.0f : 8.25f; if (CVarGetInteger(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA && this->currentMask == PLAYER_MASK_BUNNY) {