From 1de5b72802cf00ad467112e7b741e3e7b11fb106 Mon Sep 17 00:00:00 2001 From: vaguerant Date: Sun, 24 Jul 2022 23:13:43 +1000 Subject: [PATCH] L-button cheats disable minimap toggle (#514) * L-button cheats disable minimap toggle * Add debug mode to exclusion list per @briaguya-ai --- soh/src/code/z_map_exp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/soh/src/code/z_map_exp.c b/soh/src/code/z_map_exp.c index a636a0abf..6572f6fc1 100644 --- a/soh/src/code/z_map_exp.c +++ b/soh/src/code/z_map_exp.c @@ -713,6 +713,11 @@ void Minimap_Draw(GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); + // 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("gEnableMapToggle", 0); + if (globalCtx->pauseCtx.state < 4) { //Minimap margins s16 X_Margins_Minimap; @@ -781,7 +786,7 @@ void Minimap_Draw(GlobalContext* globalCtx) { } } - if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Gameplay_InCsMode(globalCtx)) { + if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Gameplay_InCsMode(globalCtx) && enableMapToggle) { osSyncPrintf("Game_play_demo_mode_check=%d\n", Gameplay_InCsMode(globalCtx)); // clang-format off if (!R_MINIMAP_DISABLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4, @@ -948,7 +953,7 @@ void Minimap_Draw(GlobalContext* globalCtx) { Minimap_DrawCompassIcons(globalCtx); // Draw icons for the player spawn and current position } - if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Gameplay_InCsMode(globalCtx)) { + if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Gameplay_InCsMode(globalCtx) && enableMapToggle) { // clang-format off if (!R_MINIMAP_DISABLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); }