diff --git a/soh/soh/Enhancements/cosmetics/TimeFlowFileSelect.cpp b/soh/soh/Enhancements/cosmetics/TimeFlowFileSelect.cpp new file mode 100644 index 000000000..d33f4f7e8 --- /dev/null +++ b/soh/soh/Enhancements/cosmetics/TimeFlowFileSelect.cpp @@ -0,0 +1,20 @@ +#include +#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 }); diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index a212085ae..8fa504748 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -3597,10 +3597,6 @@ void FileChoose_Main(GameState* thisx) { sWindowContentColors[0][2] = 255; } - if (CVarGetInteger(CVAR_ENHANCEMENT("TimeFlowFileSelect"), 0) != 0) { - gSaveContext.skyboxTime += 0x10; - } - OPEN_DISPS(this->state.gfxCtx); this->n64ddFlag = 0;