From e4cfc8852d9e84fbfa29811896a0ea41c2cd21be Mon Sep 17 00:00:00 2001 From: Pepe20129 <72659707+Pepe20129@users.noreply.github.com> Date: Mon, 30 Oct 2023 16:54:53 +0100 Subject: [PATCH] Add gRegEditEnabled (#3173) * Add gRegEditEnabled * Remove TCRF link --- soh/soh/SohMenuBar.cpp | 2 ++ soh/src/code/game.c | 2 +- soh/src/code/z_debug.c | 35 +++++++++++++++++++++++++++++------ 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index 018b05fe9..0dd87bd82 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -1387,6 +1387,8 @@ void DrawDeveloperToolsMenu() { UIWidgets::EnhancementCheckbox("OoT Debug Mode", "gDebugEnabled"); UIWidgets::Tooltip("Enables Debug Mode, allowing you to select maps with L + R + Z, noclip with L + D-pad Right, and open the debug menu with L on the pause screen"); if (CVarGetInteger("gDebugEnabled", 0)) { + UIWidgets::EnhancementCheckbox("OoT Registry Editor", "gRegEditEnabled"); + UIWidgets::Tooltip("Enables the registry editor"); ImGui::Text("Debug Save File Mode:"); UIWidgets::EnhancementCombobox("gDebugSaveFileMode", DebugSaveFileModes, 1); UIWidgets::Tooltip( diff --git a/soh/src/code/game.c b/soh/src/code/game.c index 4167a5a96..b46aa4ebd 100644 --- a/soh/src/code/game.c +++ b/soh/src/code/game.c @@ -93,7 +93,7 @@ void func_800C4344(GameState* gameState) { HREG(95) = CHECK_BTN_ALL(selectedInput->press.button, hReg82); } - if (gIsCtrlr2Valid) { + if (CVarGetInteger("gRegEditEnabled", 0) || gIsCtrlr2Valid) { func_8006390C(&gameState->input[1]); } diff --git a/soh/src/code/z_debug.c b/soh/src/code/z_debug.c index 8eb9de5a8..267846eb4 100644 --- a/soh/src/code/z_debug.c +++ b/soh/src/code/z_debug.c @@ -24,12 +24,35 @@ Color_RGBA8 printTextColors[] = { }; InputCombo inputCombos[REG_GROUPS] = { - { BTN_L, BTN_CUP }, { BTN_L, BTN_CLEFT }, { BTN_L, BTN_CDOWN }, { BTN_L, BTN_A }, { BTN_R, BTN_CDOWN }, - { BTN_L, BTN_CRIGHT }, { BTN_L, BTN_R }, { BTN_L, BTN_DLEFT }, { BTN_L, BTN_DRIGHT }, { BTN_L, BTN_DUP }, - { BTN_L, BTN_B }, { BTN_L, BTN_Z }, { BTN_L, BTN_DDOWN }, { BTN_R, BTN_A }, { BTN_R, BTN_B }, - { BTN_R, BTN_Z }, { BTN_R, BTN_L }, { BTN_R, BTN_CUP }, { BTN_R, BTN_CRIGHT }, { BTN_R, BTN_DLEFT }, - { BTN_R, BTN_CLEFT }, { BTN_R, BTN_START }, { BTN_L, BTN_START }, { BTN_R, BTN_DRIGHT }, { BTN_R, BTN_DUP }, - { BTN_START, BTN_R }, { BTN_START, BTN_A }, { BTN_START, BTN_B }, { BTN_START, BTN_CRIGHT }, + { BTN_L, BTN_CUP }, //REG + { BTN_L, BTN_CLEFT }, //SREG + { BTN_L, BTN_CDOWN }, //OREG + { BTN_L, BTN_A }, //PREG + { BTN_R, BTN_CDOWN }, //QREG + { BTN_L, BTN_CRIGHT }, //MREG + { BTN_L, BTN_R }, //YREG + { BTN_L, BTN_DLEFT }, //DREG + { BTN_L, BTN_DRIGHT }, //UREG + { BTN_L, BTN_DUP }, //IREG + { BTN_L, BTN_B }, //ZREG + { BTN_L, BTN_Z }, //CREG + { BTN_L, BTN_DDOWN }, //NREG + { BTN_R, BTN_A }, //KREG + { BTN_R, BTN_B }, //XREG + { BTN_R, BTN_Z }, //cREG + { BTN_R, BTN_L }, //sREG + { BTN_R, BTN_CUP }, //iREG + { BTN_R, BTN_CRIGHT }, //WREG + { BTN_R, BTN_DLEFT }, //AREG + { BTN_R, BTN_CLEFT }, //VREG + { BTN_R, BTN_START }, //HREG + { BTN_L, BTN_START }, //GREG + { BTN_R, BTN_DRIGHT }, //mREG + { BTN_R, BTN_DUP }, //nREG + { BTN_START, BTN_R }, //BREG + { BTN_START, BTN_A }, //dREG + { BTN_START, BTN_B }, //kREG + { BTN_START, BTN_CRIGHT }, //bREG }; char regChar[] = " SOPQMYDUIZCNKXcsiWAVHGmnBdkb";