mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-07-06 04:51:30 -07:00
Enhancement to double pause menu animation speed (#5615)
* Add enhancement to speed up pause menu animation * Rename CVar to FasterPauseMenu * Rename kaleido to pause menu * Rename register func to InitFasterPauseMenu
This commit is contained in:
parent
e15f8d395b
commit
9924ebbd05
2 changed files with 38 additions and 0 deletions
35
soh/soh/Enhancements/TimeSavers/FasterPauseMenu.cpp
Normal file
35
soh/soh/Enhancements/TimeSavers/FasterPauseMenu.cpp
Normal file
|
@ -0,0 +1,35 @@
|
|||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||
#include "soh/ShipInit.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include "variables.h"
|
||||
extern PlayState* gPlayState;
|
||||
extern void func_808237B4(PlayState* play, Input* input);
|
||||
}
|
||||
|
||||
#define CVAR_FASTER_PAUSE_MENU_NAME CVAR_ENHANCEMENT("FasterPauseMenu")
|
||||
#define CVAR_FASTER_PAUSE_MENU_VALUE CVarGetInteger(CVAR_FASTER_PAUSE_MENU_NAME, 0)
|
||||
|
||||
void OnKaleidoUpdateFaster() {
|
||||
ZREG(46) = 2; // pauseCtx->eye and pauseCtx->unk_1EA multiply by this for animation. Double the default value.
|
||||
WREG(6) = 4; // Numerous kaleido animations divide by this for movement and alpha. Half the default value.
|
||||
|
||||
// Page turn animation is governed by func_808237B4. Those values don't use registers to modify the speed, so we
|
||||
// just directly call it twice to effectively double the speed.
|
||||
if (gPlayState->pauseCtx.state == 6 && gPlayState->pauseCtx.unk_1E4 == 1) { // In page turning mode
|
||||
func_808237B4(gPlayState, gPlayState->state.input);
|
||||
}
|
||||
}
|
||||
|
||||
void InitFasterPauseMenu() {
|
||||
COND_HOOK(GameInteractor::OnKaleidoUpdate, CVAR_FASTER_PAUSE_MENU_VALUE, OnKaleidoUpdateFaster);
|
||||
|
||||
// Reset register values on close. These values are only used by z_kaleido_scope_PAL.c
|
||||
COND_VB_SHOULD(VB_KALEIDO_UNPAUSE_CLOSE, CVAR_FASTER_PAUSE_MENU_VALUE, {
|
||||
// Default values, as defined in Regs_InitDataImpl
|
||||
ZREG(46) = 1;
|
||||
WREG(6) = 8;
|
||||
});
|
||||
}
|
||||
|
||||
static RegisterShipInitFunc initFunc(InitFasterPauseMenu, { CVAR_FASTER_PAUSE_MENU_NAME });
|
|
@ -351,6 +351,9 @@ void SohMenu::AddMenuEnhancements() {
|
|||
AddWidget(path, "King Zora Speed: %.2fx", WIDGET_CVAR_SLIDER_FLOAT)
|
||||
.CVar(CVAR_ENHANCEMENT("MweepSpeed"))
|
||||
.Options(FloatSliderOptions().Min(0.1f).Max(5.0f).DefaultValue(1.0f).Format("%.2fx"));
|
||||
AddWidget(path, "Faster Pause Menu", WIDGET_CVAR_CHECKBOX)
|
||||
.CVar(CVAR_ENHANCEMENT("FasterPauseMenu"))
|
||||
.Options(CheckboxOptions().Tooltip("Speeds up animation of the pause menu, similar to Majora's Mask"));
|
||||
|
||||
path.column = SECTION_COLUMN_3;
|
||||
AddWidget(path, "Misc", WIDGET_SEPARATOR_TEXT);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue