From b131806acbc74e4087cce0495d806bab94b0796b Mon Sep 17 00:00:00 2001 From: Patrick12115 <115201185+Patrick12115@users.noreply.github.com> Date: Sun, 19 May 2024 20:18:01 -0400 Subject: [PATCH] [Enhancement] Tatl ISG (#301) * Tatl ISG Navi ISG, but with Tatl * Separated into its own file Thanks aMannus :) * Rename Enum * Added comment * Spelling error * NULL instead of 0 Co-authored-by: Archez --------- Co-authored-by: Archez --- mm/2s2h/BenGui/BenMenuBar.cpp | 3 +++ mm/2s2h/Enhancements/Enhancements.cpp | 1 + mm/2s2h/Enhancements/Enhancements.h | 1 + mm/2s2h/Enhancements/GameInteractor/GameInteractor.h | 1 + mm/2s2h/Enhancements/Restorations/TatlISG.cpp | 10 ++++++++++ mm/2s2h/Enhancements/Restorations/TatlISG.h | 6 ++++++ mm/src/overlays/actors/ovl_player_actor/z_player.c | 4 +++- 7 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 mm/2s2h/Enhancements/Restorations/TatlISG.cpp create mode 100644 mm/2s2h/Enhancements/Restorations/TatlISG.h diff --git a/mm/2s2h/BenGui/BenMenuBar.cpp b/mm/2s2h/BenGui/BenMenuBar.cpp index e75209c10..2c0a32784 100644 --- a/mm/2s2h/BenGui/BenMenuBar.cpp +++ b/mm/2s2h/BenGui/BenMenuBar.cpp @@ -460,6 +460,9 @@ void DrawEnhancementsMenu() { UIWidgets::CVarCheckbox("Side Rolls", "gEnhancements.Restorations.SideRoll", { .tooltip = "Restores side rolling from OOT." }); + UIWidgets::CVarCheckbox("Tatl ISG", "gEnhancements.Restorations.TatlISG", { + .tooltip = "Restores Navi ISG from OOT, but now with Tatl." + }); ImGui::EndMenu(); } diff --git a/mm/2s2h/Enhancements/Enhancements.cpp b/mm/2s2h/Enhancements/Enhancements.cpp index 80a387afe..aeddce992 100644 --- a/mm/2s2h/Enhancements/Enhancements.cpp +++ b/mm/2s2h/Enhancements/Enhancements.cpp @@ -30,6 +30,7 @@ void InitEnhancements() { // Restorations RegisterPowerCrouchStab(); RegisterSideRoll(); + RegisterTatlISG(); // Cutscenes RegisterSkipEntranceCutscenes(); diff --git a/mm/2s2h/Enhancements/Enhancements.h b/mm/2s2h/Enhancements/Enhancements.h index 4055d2ed2..0e0b948cc 100644 --- a/mm/2s2h/Enhancements/Enhancements.h +++ b/mm/2s2h/Enhancements/Enhancements.h @@ -16,6 +16,7 @@ #include "Cutscenes/HideTitleCards.h" #include "Restorations/PowerCrouchStab.h" #include "Restorations/SideRoll.h" +#include "Restorations/TatlISG.h" #include "Graphics/PlayAsKafei.h" #include "Songs/EnableSunsSong.h" diff --git a/mm/2s2h/Enhancements/GameInteractor/GameInteractor.h b/mm/2s2h/Enhancements/GameInteractor/GameInteractor.h index bd6bc2bce..4a04b7742 100644 --- a/mm/2s2h/Enhancements/GameInteractor/GameInteractor.h +++ b/mm/2s2h/Enhancements/GameInteractor/GameInteractor.h @@ -38,6 +38,7 @@ typedef enum { GI_VB_SET_BLAST_MASK_COOLDOWN_TIMER, GI_VB_PATCH_POWER_CROUCH_STAB, GI_VB_PATCH_SIDEROLL, + GI_VB_TATL_CONVERSATION_AVAILABLE, GI_VB_PREVENT_MASK_TRANSFORMATION_CS, GI_VB_PREVENT_CLOCK_DISPLAY, GI_VB_SONG_AVAILABLE_TO_PLAY, diff --git a/mm/2s2h/Enhancements/Restorations/TatlISG.cpp b/mm/2s2h/Enhancements/Restorations/TatlISG.cpp new file mode 100644 index 000000000..6c32120c2 --- /dev/null +++ b/mm/2s2h/Enhancements/Restorations/TatlISG.cpp @@ -0,0 +1,10 @@ +#include +#include "Enhancements/GameInteractor/GameInteractor.h" + +void RegisterTatlISG() { + REGISTER_VB_SHOULD(GI_VB_TATL_CONVERSATION_AVAILABLE, { + if (CVarGetInteger("gEnhancements.Restorations.TatlISG", 0)) { + *should = false; + } + }); +} diff --git a/mm/2s2h/Enhancements/Restorations/TatlISG.h b/mm/2s2h/Enhancements/Restorations/TatlISG.h new file mode 100644 index 000000000..d1ed5afd6 --- /dev/null +++ b/mm/2s2h/Enhancements/Restorations/TatlISG.h @@ -0,0 +1,6 @@ +#ifndef RESTORATIONS_TATL_ISG_H +#define RESTORATIONS_TATL_ISG_H + +void RegisterTatlISG(); + +#endif // RESTORATIONS_TATL_ISG_H diff --git a/mm/src/overlays/actors/ovl_player_actor/z_player.c b/mm/src/overlays/actors/ovl_player_actor/z_player.c index 94e56d609..10a64dc47 100644 --- a/mm/src/overlays/actors/ovl_player_actor/z_player.c +++ b/mm/src/overlays/actors/ovl_player_actor/z_player.c @@ -7805,7 +7805,9 @@ s32 Player_ActionChange_4(Player* this, PlayState* play) { if (var_a1 != NULL) { if (!var_t1) { this->stateFlags2 |= PLAYER_STATE2_200000; - if (!CutsceneManager_IsNext(CS_ID_GLOBAL_TALK) || + // This code is the same as the OoT code, except for the !CutsceneManager_IsNext(CS_ID_GLOBAL_TALK), which is what prevented Tatl ISG from working + bool vanillaCondition = !CutsceneManager_IsNext(CS_ID_GLOBAL_TALK); + if (GameInteractor_Should(GI_VB_TATL_CONVERSATION_AVAILABLE, vanillaCondition, NULL) || !CHECK_BTN_ALL(sPlayerControlInput->press.button, BTN_CUP)) { return false; }