mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-09-02 02:32:34 -04:00
2dd51f1288
Migrate File Select CVars Co-authored-by: Unreference <87878910+unreference@users.noreply.github.com>
23 lines
759 B
C++
23 lines
759 B
C++
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
|
#include "soh/ShipInit.hpp"
|
|
|
|
extern "C" {
|
|
#include "z64save.h"
|
|
}
|
|
|
|
extern "C" SaveContext gSaveContext;
|
|
|
|
static constexpr int32_t CVAR_TIMEFLOWFILESELECT_DEFAULT = 0;
|
|
#define CVAR_TIMEFLOWFILESELECT_NAME CVAR_ENHANCEMENT("FileSelect.TimeFlow")
|
|
#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(RegisterTimeFlowFileSelect, { CVAR_TIMEFLOWFILESELECT_NAME });
|