diff options
| author | Bradley Sherman <sirrus233@gmail.com> | 2026-07-16 05:10:29 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-16 08:10:29 -0400 |
| commit | 3465b31439eeef8c86566b55d54bf7d8da64b9f0 (patch) | |
| tree | 8943e7e65f0c3473d65d2ba4a38f6ad4528bbac1 | |
| parent | b3cc366288c0a3e7583810be816d5fed3cd54ac2 (diff) | |
Add extra frames to new day title card to simulate load time (#1787)
* Add extra frames to new day title card to simulate load time
* Make title card duration increase an optional enhancement
* Fix formatting
* Fix formatting - again
| -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 }); |
