From 655d82462e18e5e1f43fc70339b9667985813288 Mon Sep 17 00:00:00 2001 From: aMannus Date: Sat, 4 May 2024 15:22:59 +0200 Subject: [PATCH] Recategorize current enhancements (#257) --- mm/2s2h/BenGui/BenMenuBar.cpp | 41 ++++++++++++------- .../Enhancements/Cutscenes/HideTitleCards.cpp | 10 +++++ .../Enhancements/Cutscenes/HideTitleCards.h | 6 +++ .../Cutscenes/SkipEntranceCutscenes.cpp | 10 +++++ .../Cutscenes/SkipEntranceCutscenes.h | 6 +++ mm/2s2h/Enhancements/Enhancements.cpp | 6 ++- mm/2s2h/Enhancements/Enhancements.h | 5 ++- .../Enhancements/TimeSavers/TimeSavers.cpp | 15 ------- mm/2s2h/Enhancements/TimeSavers/TimeSavers.h | 6 --- mm/src/code/z_message.c | 6 +-- mm/src/code/z_message_nes.c | 4 +- mm/src/code/z_parameter.c | 4 +- .../overlays/gamestates/ovl_title/z_title.c | 4 +- 13 files changed, 74 insertions(+), 49 deletions(-) create mode 100644 mm/2s2h/Enhancements/Cutscenes/HideTitleCards.cpp create mode 100644 mm/2s2h/Enhancements/Cutscenes/HideTitleCards.h create mode 100644 mm/2s2h/Enhancements/Cutscenes/SkipEntranceCutscenes.cpp create mode 100644 mm/2s2h/Enhancements/Cutscenes/SkipEntranceCutscenes.h delete mode 100644 mm/2s2h/Enhancements/TimeSavers/TimeSavers.cpp delete mode 100644 mm/2s2h/Enhancements/TimeSavers/TimeSavers.h diff --git a/mm/2s2h/BenGui/BenMenuBar.cpp b/mm/2s2h/BenGui/BenMenuBar.cpp index 83f2b3756..0c4daed28 100644 --- a/mm/2s2h/BenGui/BenMenuBar.cpp +++ b/mm/2s2h/BenGui/BenMenuBar.cpp @@ -290,6 +290,17 @@ extern std::shared_ptr mHudEditorWindow; void DrawEnhancementsMenu() { if (UIWidgets::BeginMenu("Enhancements")) { + + if (UIWidgets::BeginMenu("Graphics")) { + MotionBlur_RenderMenuOptions(); + ImGui::SeparatorText("Other"); + UIWidgets::CVarCheckbox("Authentic logo", "gEnhancements.Graphics.AuthenticLogo", { + .tooltip = "Hide the game version and build details and display the authentic model and texture on the boot logo start screen" + }); + UIWidgets::CVarCheckbox("24 Hours Clock", "gEnhancements.Graphics.24HoursClock"); + + ImGui::EndMenu(); + } if (UIWidgets::BeginMenu("Cycle")) { UIWidgets::CVarCheckbox("Do not reset Bottle content", "gEnhancements.Cycle.DoNotResetBottleContent", { @@ -317,16 +328,18 @@ void DrawEnhancementsMenu() { ImGui::EndMenu(); } - if (UIWidgets::BeginMenu("Restorations")) { - UIWidgets::CVarCheckbox("Side Rolls", "gEnhancements.Restorations.SideRoll", { - .tooltip = "Restores side rolling from OOT." - }); + if (UIWidgets::BeginMenu("Cutscenes")) { + UIWidgets::CVarCheckbox("Skip Entrance Cutscenes", "gEnhancements.Cutscenes.SkipEntranceCutscenes"); + UIWidgets::CVarCheckbox("Hide Title Cards", "gEnhancements.Cutscenes.HideTitleCards"); ImGui::EndMenu(); } - if (UIWidgets::BeginMenu("Graphics")) { - MotionBlur_RenderMenuOptions(); + if (UIWidgets::BeginMenu("Dialogue")) { + UIWidgets::CVarCheckbox("Fast Text", "gEnhancements.Dialogue.FastText", { + .tooltip = "Speeds up text rendering, and enables holding of B progress to next message" + }); + ImGui::EndMenu(); } @@ -338,15 +351,13 @@ void DrawEnhancementsMenu() { ImGui::EndMenu(); } - UIWidgets::CVarCheckbox("Fast Text", "gEnhancements.TimeSavers.FastText", { - .tooltip = "Speeds up text rendering, and enables holding of B progress to next message" - }); - UIWidgets::CVarCheckbox("Authentic logo", "gEnhancements.General.AuthenticLogo", { - .tooltip = "Hide the game version and build details and display the authentic model and texture on the boot logo start screen" - }); - UIWidgets::CVarCheckbox("Skip Entrance Cutscenes", "gEnhancements.TimeSavers.SkipEntranceCutscenes"); - UIWidgets::CVarCheckbox("Hide Title Cards", "gEnhancements.TimeSavers.HideTitleCards"); - UIWidgets::CVarCheckbox("24 Hours Clock", "gEnhancements.General.24HoursClock"); + if (UIWidgets::BeginMenu("Restorations")) { + UIWidgets::CVarCheckbox("Side Rolls", "gEnhancements.Restorations.SideRoll", { + .tooltip = "Restores side rolling from OOT." + }); + + ImGui::EndMenu(); + } if (mHudEditorWindow) { UIWidgets::WindowButton("Hud Editor", "gWindows.HudEditor", mHudEditorWindow, { diff --git a/mm/2s2h/Enhancements/Cutscenes/HideTitleCards.cpp b/mm/2s2h/Enhancements/Cutscenes/HideTitleCards.cpp new file mode 100644 index 000000000..70f473c27 --- /dev/null +++ b/mm/2s2h/Enhancements/Cutscenes/HideTitleCards.cpp @@ -0,0 +1,10 @@ +#include +#include "Enhancements/GameInteractor/GameInteractor.h" + +void RegisterHideTitleCards() { + REGISTER_VB_SHOULD(GI_VB_SHOW_TITLE_CARD, { + if (CVarGetInteger("gEnhancements.Cutscenes.HideTitleCards", 0)) { + *should = false; + } + }); +} diff --git a/mm/2s2h/Enhancements/Cutscenes/HideTitleCards.h b/mm/2s2h/Enhancements/Cutscenes/HideTitleCards.h new file mode 100644 index 000000000..b537ae8cf --- /dev/null +++ b/mm/2s2h/Enhancements/Cutscenes/HideTitleCards.h @@ -0,0 +1,6 @@ +#ifndef CUTSCENES_HIDE_TITLE_CARDS_H +#define CUTSCENES_HIDE_TITLE_CARDS_H + +void RegisterHideTitleCards(); + +#endif // CUTSCENES_HIDE_TITLE_CARDS_H diff --git a/mm/2s2h/Enhancements/Cutscenes/SkipEntranceCutscenes.cpp b/mm/2s2h/Enhancements/Cutscenes/SkipEntranceCutscenes.cpp new file mode 100644 index 000000000..83c924bee --- /dev/null +++ b/mm/2s2h/Enhancements/Cutscenes/SkipEntranceCutscenes.cpp @@ -0,0 +1,10 @@ +#include +#include "Enhancements/GameInteractor/GameInteractor.h" + +void RegisterSkipEntranceCutscenes() { + REGISTER_VB_SHOULD(GI_VB_PLAY_ENTRANCE_CS, { + if (CVarGetInteger("gEnhancements.Cutscenes.SkipEntranceCutscenes", 0)) { + *should = false; + } + }); +} diff --git a/mm/2s2h/Enhancements/Cutscenes/SkipEntranceCutscenes.h b/mm/2s2h/Enhancements/Cutscenes/SkipEntranceCutscenes.h new file mode 100644 index 000000000..d2f9cd673 --- /dev/null +++ b/mm/2s2h/Enhancements/Cutscenes/SkipEntranceCutscenes.h @@ -0,0 +1,6 @@ +#ifndef CUTSCENES_SKIP_ENTRANCE_CUTSCENES_H +#define CUTSCENES_SKIP_ENTRANCE_CUTSCENES_H + +void RegisterSkipEntranceCutscenes(); + +#endif // CUTSCENES_SKIP_ENTRANCE_CUTSCENES_H \ No newline at end of file diff --git a/mm/2s2h/Enhancements/Enhancements.cpp b/mm/2s2h/Enhancements/Enhancements.cpp index 74a71960a..44de70c9a 100644 --- a/mm/2s2h/Enhancements/Enhancements.cpp +++ b/mm/2s2h/Enhancements/Enhancements.cpp @@ -15,6 +15,8 @@ void InitEnhancements() { // Restorations RegisterSideRoll(); - // Time Savers - RegisterTimeSaversHooks(); + // Cutscenes + RegisterSkipEntranceCutscenes(); + RegisterHideTitleCards(); + } diff --git a/mm/2s2h/Enhancements/Enhancements.h b/mm/2s2h/Enhancements/Enhancements.h index 4b01d646d..5da214300 100644 --- a/mm/2s2h/Enhancements/Enhancements.h +++ b/mm/2s2h/Enhancements/Enhancements.h @@ -5,9 +5,10 @@ #include "Cheats/Infinite.h" #include "Cycle/EndOfCycle.h" #include "Masks/FierceDeityAnywhere.h" -#include "Restorations/SideRoll.h" #include "Masks/FastTransformation.h" -#include "TimeSavers/TimeSavers.h" +#include "Cutscenes/SkipEntranceCutscenes.h" +#include "Cutscenes/HideTitleCards.h" +#include "Restorations/SideRoll.h" #ifdef __cplusplus extern "C" { diff --git a/mm/2s2h/Enhancements/TimeSavers/TimeSavers.cpp b/mm/2s2h/Enhancements/TimeSavers/TimeSavers.cpp deleted file mode 100644 index 86c47fc28..000000000 --- a/mm/2s2h/Enhancements/TimeSavers/TimeSavers.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include "Enhancements/GameInteractor/GameInteractor.h" - -void RegisterTimeSaversHooks() { - REGISTER_VB_SHOULD(GI_VB_PLAY_ENTRANCE_CS, { - if (CVarGetInteger("gEnhancements.TimeSavers.SkipEntranceCutscenes", 0)) { - *should = false; - } - }); - REGISTER_VB_SHOULD(GI_VB_SHOW_TITLE_CARD, { - if (CVarGetInteger("gEnhancements.TimeSavers.HideTitleCards", 0)) { - *should = false; - } - }); -} diff --git a/mm/2s2h/Enhancements/TimeSavers/TimeSavers.h b/mm/2s2h/Enhancements/TimeSavers/TimeSavers.h deleted file mode 100644 index 03466f19b..000000000 --- a/mm/2s2h/Enhancements/TimeSavers/TimeSavers.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef TIMESAVERS_H -#define TIMESAVERS_H - -void RegisterTimeSaversHooks(); - -#endif // TIMESAVERS_H diff --git a/mm/src/code/z_message.c b/mm/src/code/z_message.c index 26e09f390..b3a0c0010 100644 --- a/mm/src/code/z_message.c +++ b/mm/src/code/z_message.c @@ -319,7 +319,7 @@ s32 Message_ShouldAdvance(PlayState* play) { } return CHECK_BTN_ALL(controller->press.button, BTN_A) || CHECK_BTN_ALL(controller->press.button, BTN_B) || // 2S2H [Enhancement] When fast text is on, we want to check if B is held instead of only if it was just pressed - (CVarGetInteger("gEnhancements.TimeSavers.FastText", 0) && CHECK_BTN_ALL(controller->cur.button, BTN_B)) || + (CVarGetInteger("gEnhancements.Dialogue.FastText", 0) && CHECK_BTN_ALL(controller->cur.button, BTN_B)) || CHECK_BTN_ALL(controller->press.button, BTN_CUP); } } @@ -333,7 +333,7 @@ s32 Message_ShouldAdvanceSilent(PlayState* play) { } else { return CHECK_BTN_ALL(controller->press.button, BTN_A) || CHECK_BTN_ALL(controller->press.button, BTN_B) || // 2S2H [Enhancement] When fast text is on, we want to check if B is held instead of only if it was just pressed - (CVarGetInteger("gEnhancements.TimeSavers.FastText", 0) && CHECK_BTN_ALL(controller->cur.button, BTN_B)) || + (CVarGetInteger("gEnhancements.Dialogue.FastText", 0) && CHECK_BTN_ALL(controller->cur.button, BTN_B)) || CHECK_BTN_ALL(controller->press.button, BTN_CUP); } } @@ -5638,7 +5638,7 @@ void Message_Update(PlayState* play) { if (( CHECK_BTN_ALL(input->press.button, BTN_B) || // 2S2H [Enhancement] When fast text is on, we want to check if B is held instead of only if it was just pressed - (CVarGetInteger("gEnhancements.TimeSavers.FastText", 0) && CHECK_BTN_ALL(input->cur.button, BTN_B)) + (CVarGetInteger("gEnhancements.Dialogue.FastText", 0) && CHECK_BTN_ALL(input->cur.button, BTN_B)) ) && !msgCtx->textUnskippable) { msgCtx->textboxSkipped = true; msgCtx->textDrawPos = msgCtx->decodedTextLen; diff --git a/mm/src/code/z_message_nes.c b/mm/src/code/z_message_nes.c index 9e75e09ca..dec1e3160 100644 --- a/mm/src/code/z_message_nes.c +++ b/mm/src/code/z_message_nes.c @@ -920,14 +920,14 @@ void Message_DrawTextNES(PlayState* play, Gfx** gfxP, u16 textDrawPos) { } if (msgCtx->textDelayTimer == 0) { - msgCtx->textDrawPos = i + (CVarGetInteger("gEnhancements.TimeSavers.FastText", 0) ? 10 : 1); + msgCtx->textDrawPos = i + (CVarGetInteger("gEnhancements.Dialogue.FastText", 0) ? 10 : 1); msgCtx->textDelayTimer = 0; if (msgCtx->msgMode == MSGMODE_9) { msgCtx->msgMode = MSGMODE_TEXT_DISPLAYING; } } else { msgCtx->textDelayTimer--; - if (CVarGetInteger("gEnhancements.TimeSavers.FastText", 0)) { + if (CVarGetInteger("gEnhancements.Dialogue.FastText", 0)) { msgCtx->textDelayTimer = 0; } } diff --git a/mm/src/code/z_parameter.c b/mm/src/code/z_parameter.c index d41f28f8c..d2490db83 100644 --- a/mm/src/code/z_parameter.c +++ b/mm/src/code/z_parameter.c @@ -5246,7 +5246,7 @@ void Interface_DrawClock(PlayState* play) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, sThreeDayClockAlpha); gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[24], 8, 0); - OVERLAY_DISP = CVarGetInteger("gEnhancements.General.24HoursClock", 0) ? + OVERLAY_DISP = CVarGetInteger("gEnhancements.Graphics.24HoursClock", 0) ? Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTwentyHourHoursTextures[sp1C6], 4, 16, 11, 0) : Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTextures[sp1C6], 4, 16, 11, 0); @@ -5272,7 +5272,7 @@ void Interface_DrawClock(PlayState* play) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, sThreeDayClockAlpha); gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[32], 8, 0); - OVERLAY_DISP = CVarGetInteger("gEnhancements.General.24HoursClock", 0) ? + OVERLAY_DISP = CVarGetInteger("gEnhancements.Graphics.24HoursClock", 0) ? Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTwentyHourHoursTextures[sp1C6], 4, 16, 11, 0) : Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTextures[sp1C6], 4, 16, 11, 0); diff --git a/mm/src/overlays/gamestates/ovl_title/z_title.c b/mm/src/overlays/gamestates/ovl_title/z_title.c index 3b50439dc..599e0ec1d 100644 --- a/mm/src/overlays/gamestates/ovl_title/z_title.c +++ b/mm/src/overlays/gamestates/ovl_title/z_title.c @@ -115,7 +115,7 @@ void ConsoleLogo_Draw(GameState* thisx) { char* logoDL = gNintendo64LogoNDL; char* logoText = gNintendo64LogoTextTex; - if (!CVarGetInteger("gEnhancements.General.AuthenticLogo", 0)) { + if (!CVarGetInteger("gEnhancements.Graphics.AuthenticLogo", 0)) { logoDL = gShipLogoDL; logoText = gLUSLogoTextTex; } @@ -173,7 +173,7 @@ void ConsoleLogo_Draw(GameState* thisx) { 1 << 10, 1 << 10); } - if (!CVarGetInteger("gEnhancements.General.AuthenticLogo", 0)) { + if (!CVarGetInteger("gEnhancements.Graphics.AuthenticLogo", 0)) { ConsoleLogo_PrintBuildInfo(this); }