Skip to content

Commit

Permalink
Controller option: Navi on L
Browse files Browse the repository at this point in the history
  • Loading branch information
vaguerant committed Jul 20, 2022
1 parent ba98822 commit 309c936
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions libultraship/libultraship/ImGuiImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,8 @@ namespace SohImGui {
EnhancementCheckbox("D-pad Support for Browsing Shop Items", "gDpadShop");
EnhancementCheckbox("D-pad as Equip Items", "gDpadEquips");
Tooltip("Allows the D-pad to be used as extra C buttons");
EnhancementCheckbox("Answer Navi Prompt with L Button", "gNaviOnL");
Tooltip("Speak to Navi with L but enter first-person camera with C-Up");
ImGui::Separator();

EnhancementCheckbox("Show Inputs", "gInputEnabled");
Expand Down
2 changes: 1 addition & 1 deletion soh/src/code/z_map_exp.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ void Minimap_Draw(GlobalContext* globalCtx) {

// If any of these CVars are enabled, disable toggling the minimap with L, unless gEnableMapToggle is set
bool enableMapToggle =
!(CVar_GetS32("gDebugEnabled", 0) || CVar_GetS32("gMoonJumpOnL", 0) || CVar_GetS32("gTurboOnL", 0)) ||
!(CVar_GetS32("gDebugEnabled", 0) || CVar_GetS32("gMoonJumpOnL", 0) || CVar_GetS32("gNaviOnL", 0) || CVar_GetS32("gTurboOnL", 0)) ||
CVar_GetS32("gEnableMapToggle", 0);

if (globalCtx->pauseCtx.state < 4) {
Expand Down
5 changes: 3 additions & 2 deletions soh/src/overlays/actors/ovl_player_actor/z_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -5191,7 +5191,7 @@ s32 func_8083B644(Player* this, GlobalContext* globalCtx) {
this->stateFlags2 |= PLAYER_STATE2_21;
}

if (!CHECK_BTN_ALL(sControlInput->press.button, BTN_CUP) && !sp28) {
if (!CHECK_BTN_ALL(sControlInput->press.button, CVar_GetS32("gNaviOnL", 0) ? BTN_L : BTN_CUP) && !sp28) {
return 0;
}

Expand Down Expand Up @@ -5247,7 +5247,8 @@ s32 func_8083B998(Player* this, GlobalContext* globalCtx) {
(CHECK_FLAG_ALL(this->unk_664->flags, ACTOR_FLAG_0 | ACTOR_FLAG_18) || (this->unk_664->naviEnemyId != 0xFF))) {
this->stateFlags2 |= PLAYER_STATE2_21;
}
else if ((this->naviTextId == 0) && !func_8008E9C4(this) && CHECK_BTN_ALL(sControlInput->press.button, BTN_CUP) &&
else if ((this->naviTextId == 0 || CVar_GetS32("gNaviOnL", 0)) &&
!func_8008E9C4(this) && CHECK_BTN_ALL(sControlInput->press.button, BTN_CUP) &&
(YREG(15) != 0x10) && (YREG(15) != 0x20) && !func_8083B8F4(this, globalCtx)) {
func_80078884(NA_SE_SY_ERROR);
}
Expand Down

0 comments on commit 309c936

Please sign in to comment.