diff options
| -rw-r--r-- | mm/2s2h/BenGui/BenMenu.cpp | 4 | ||||
| -rw-r--r-- | mm/2s2h/Enhancements/Restorations/DayTelopDuration.cpp | 29 |
2 files changed, 33 insertions, 0 deletions
diff --git a/mm/2s2h/BenGui/BenMenu.cpp b/mm/2s2h/BenGui/BenMenu.cpp index 74e41861f..2e143c126 100644 --- a/mm/2s2h/BenGui/BenMenu.cpp +++ b/mm/2s2h/BenGui/BenMenu.cpp @@ -1704,6 +1704,10 @@ void BenMenu::AddEnhancements() { AddWidget(path, "JP Deku Palace Grottos", WIDGET_CVAR_CHECKBOX) .CVar("gEnhancements.Restorations.JPGrottos") .Options(CheckboxOptions().Tooltip("Restores the Deku Palace Grottos to their original Japanese layout.")); + AddWidget(path, "Day Transition Duration", WIDGET_CVAR_CHECKBOX) + .CVar("gEnhancements.Restorations.DayTelopDuration") + .Options(CheckboxOptions().Tooltip("Restores the day transition title card duration, which was longer on " + "original hardware due to disguising load times.")); AddWidget(path, "Bonk Collision", WIDGET_CVAR_CHECKBOX) .CVar("gEnhancements.Restorations.BonkCollision") .Options( diff --git a/mm/2s2h/Enhancements/Restorations/DayTelopDuration.cpp b/mm/2s2h/Enhancements/Restorations/DayTelopDuration.cpp new file mode 100644 index 000000000..024924a73 --- /dev/null +++ b/mm/2s2h/Enhancements/Restorations/DayTelopDuration.cpp @@ -0,0 +1,29 @@ +#include <libultraship/bridge/consolevariablebridge.h> +#include "2s2h/GameInteractor/GameInteractor.h" +#include "2s2h/ShipInit.hpp" + +extern "C" { +#include "variables.h" +#include "overlays/gamestates/ovl_daytelop/z_daytelop.h" +} + +#define CVAR_NAME "gEnhancements.Restorations.DayTelopDuration" +#define CVAR CVarGetInteger(CVAR_NAME, 0) + +void RegisterDayTelopDurationRestoration() { + COND_HOOK(OnGameStateMainStart, CVAR, []() { + if (gGameState == nullptr || gGameState->destroy != DayTelop_Destroy) { + return; + } + + // Only add frames the first time the DayTelop state is detected + if (gGameState->frames != 1) { + return; + } + + DayTelopState* dayTelop = reinterpret_cast<DayTelopState*>(gGameState); + dayTelop->transitionCountdown += 120; + }); +} + +static RegisterShipInitFunc initFunc(RegisterDayTelopDurationRestoration, { CVAR_NAME }); |
