[Enhancement] Reworked targetting (#6322)

Adds an enhancement that changes targeting behavior, allowing

Switching targets with the chosen button combo
(In Switch mode) Untargeting by just pressing Z
This commit is contained in:
OtherBlue
2026-03-21 15:41:08 -03:00
committed by GitHub
parent b6bf97e2f1
commit 2af5d21125
4 changed files with 87 additions and 2 deletions
@@ -3829,7 +3829,8 @@ void Player_UpdateZTargeting(Player* this, PlayState* play) {
if (!isTalking) {
if (!(this->stateFlags1 & PLAYER_STATE1_BOOMERANG_THROWN) &&
((this->heldItemAction != PLAYER_IA_FISHING_POLE) || (this->unk_860 == 0)) &&
CHECK_BTN_ALL(sControlInput->press.button, BTN_Z)) {
GameInteractor_Should(VB_TOGGLE_Z_TARGET_SWITCH_DIRECTION,
CHECK_BTN_ALL(sControlInput->press.button, BTN_Z))) {
if (this->actor.category == ACTORCAT_PLAYER) {
// The next lock-on actor defaults to the actor Navi is hovering over.
@@ -3855,7 +3856,7 @@ void Player_UpdateZTargeting(Player* this, PlayState* play) {
nextLockOnActor = play->actorCtx.targetCtx.unk_94;
}
if (nextLockOnActor != this->focusActor) {
if (GameInteractor_Should(VB_TOGGLE_Z_TARGET_SWITCH_TARGETS, nextLockOnActor != this->focusActor)) {
// Set new lock-on
if (!usingHoldTargeting) {