mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-19 13:00:11 -07:00
Converted "Passage of Time on File Select" to ShipInit Hook (#5595)
This commit is contained in:
parent
7514bdc08b
commit
7ecefa8f90
2 changed files with 20 additions and 4 deletions
20
soh/soh/Enhancements/cosmetics/TimeFlowFileSelect.cpp
Normal file
20
soh/soh/Enhancements/cosmetics/TimeFlowFileSelect.cpp
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
#include <libultraship/bridge.h>
|
||||||
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
|
#include "soh/ShipInit.hpp"
|
||||||
|
#include "z64save.h"
|
||||||
|
|
||||||
|
extern "C" SaveContext gSaveContext;
|
||||||
|
|
||||||
|
static constexpr int32_t CVAR_TIMEFLOWFILESELECT_DEFAULT = 0;
|
||||||
|
#define CVAR_TIMEFLOWFILESELECT_NAME CVAR_ENHANCEMENT("TimeFlowFileSelect")
|
||||||
|
#define CVAR_TIMEFLOWFILESELECT_VALUE CVarGetInteger(CVAR_TIMEFLOWFILESELECT_NAME, CVAR_TIMEFLOWFILESELECT_DEFAULT)
|
||||||
|
|
||||||
|
void OnFileChooseMainTimeFlowFileSelect(void* gameState) {
|
||||||
|
gSaveContext.skyboxTime += 0x10;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegisterTimeFlowFileSelect() {
|
||||||
|
COND_HOOK(OnFileChooseMain, CVAR_TIMEFLOWFILESELECT_VALUE, OnFileChooseMainTimeFlowFileSelect);
|
||||||
|
}
|
||||||
|
|
||||||
|
static RegisterShipInitFunc initFunc_TimeFlowFileSelect(RegisterTimeFlowFileSelect, { CVAR_TIMEFLOWFILESELECT_NAME });
|
|
@ -3597,10 +3597,6 @@ void FileChoose_Main(GameState* thisx) {
|
||||||
sWindowContentColors[0][2] = 255;
|
sWindowContentColors[0][2] = 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CVarGetInteger(CVAR_ENHANCEMENT("TimeFlowFileSelect"), 0) != 0) {
|
|
||||||
gSaveContext.skyboxTime += 0x10;
|
|
||||||
}
|
|
||||||
|
|
||||||
OPEN_DISPS(this->state.gfxCtx);
|
OPEN_DISPS(this->state.gfxCtx);
|
||||||
|
|
||||||
this->n64ddFlag = 0;
|
this->n64ddFlag = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue