mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-23 06:35:33 -07:00
move ER weather override to AfterSceneCommands
This commit is contained in:
parent
448a6242fc
commit
183d2728e0
2 changed files with 15 additions and 6 deletions
|
@ -1761,10 +1761,6 @@ void RandomizerOnSceneInitHandler(int16_t sceneNum) {
|
||||||
|
|
||||||
// Handle updated link spawn positions
|
// Handle updated link spawn positions
|
||||||
Entrance_OverrideSpawnScene(sceneNum, gPlayState->curSpawn);
|
Entrance_OverrideSpawnScene(sceneNum, gPlayState->curSpawn);
|
||||||
|
|
||||||
Entrance_OverrideWeatherState();
|
|
||||||
// Need to reinitialize the environment after replacing the weather mode
|
|
||||||
Play_InitEnvironment(gPlayState, gPlayState->skyboxId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// LACs & Prelude checks
|
// LACs & Prelude checks
|
||||||
|
@ -1803,6 +1799,13 @@ void RandomizerOnSceneInitHandler(int16_t sceneNum) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RandomizerAfterSceneCommandsHandler(int16_t sceneNum) {
|
||||||
|
// ENTRTODO: Move all entrance rando handling to a dedicated file
|
||||||
|
if (RAND_GET_OPTION(RSK_SHUFFLE_ENTRANCES)) {
|
||||||
|
Entrance_OverrideWeatherState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void EnSi_DrawRandomizedItem(EnSi* enSi, PlayState* play) {
|
void EnSi_DrawRandomizedItem(EnSi* enSi, PlayState* play) {
|
||||||
GetItemEntry randoItem = enSi->sohGetItemEntry;
|
GetItemEntry randoItem = enSi->sohGetItemEntry;
|
||||||
if (CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0)) {
|
if (CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0)) {
|
||||||
|
@ -2358,6 +2361,7 @@ void RandomizerRegisterHooks() {
|
||||||
static uint32_t onDialogMessageHook = 0;
|
static uint32_t onDialogMessageHook = 0;
|
||||||
static uint32_t onVanillaBehaviorHook = 0;
|
static uint32_t onVanillaBehaviorHook = 0;
|
||||||
static uint32_t onSceneInitHook = 0;
|
static uint32_t onSceneInitHook = 0;
|
||||||
|
static uint32_t afterSceneCommandsHook = 0;
|
||||||
static uint32_t onActorInitHook = 0;
|
static uint32_t onActorInitHook = 0;
|
||||||
static uint32_t onActorUpdateHook = 0;
|
static uint32_t onActorUpdateHook = 0;
|
||||||
static uint32_t onPlayerUpdateHook = 0;
|
static uint32_t onPlayerUpdateHook = 0;
|
||||||
|
@ -2394,6 +2398,7 @@ void RandomizerRegisterHooks() {
|
||||||
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnItemReceive>(onDialogMessageHook);
|
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnItemReceive>(onDialogMessageHook);
|
||||||
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnVanillaBehavior>(onVanillaBehaviorHook);
|
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnVanillaBehavior>(onVanillaBehaviorHook);
|
||||||
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnSceneInit>(onSceneInitHook);
|
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnSceneInit>(onSceneInitHook);
|
||||||
|
GameInteractor::Instance->UnregisterGameHook<GameInteractor::AfterSceneCommands>(afterSceneCommandsHook);
|
||||||
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnActorInit>(onActorInitHook);
|
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnActorInit>(onActorInitHook);
|
||||||
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnActorUpdate>(onActorUpdateHook);
|
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnActorUpdate>(onActorUpdateHook);
|
||||||
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnPlayerUpdate>(onPlayerUpdateHook);
|
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnPlayerUpdate>(onPlayerUpdateHook);
|
||||||
|
@ -2426,6 +2431,7 @@ void RandomizerRegisterHooks() {
|
||||||
onDialogMessageHook = 0;
|
onDialogMessageHook = 0;
|
||||||
onVanillaBehaviorHook = 0;
|
onVanillaBehaviorHook = 0;
|
||||||
onSceneInitHook = 0;
|
onSceneInitHook = 0;
|
||||||
|
afterSceneCommandsHook = 0;
|
||||||
onActorInitHook = 0;
|
onActorInitHook = 0;
|
||||||
onActorUpdateHook = 0;
|
onActorUpdateHook = 0;
|
||||||
onPlayerUpdateHook = 0;
|
onPlayerUpdateHook = 0;
|
||||||
|
@ -2477,6 +2483,8 @@ void RandomizerRegisterHooks() {
|
||||||
RandomizerOnVanillaBehaviorHandler);
|
RandomizerOnVanillaBehaviorHandler);
|
||||||
onSceneInitHook =
|
onSceneInitHook =
|
||||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnSceneInit>(RandomizerOnSceneInitHandler);
|
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnSceneInit>(RandomizerOnSceneInitHandler);
|
||||||
|
afterSceneCommandsHook = GameInteractor::Instance->RegisterGameHook<GameInteractor::AfterSceneCommands>(
|
||||||
|
RandomizerAfterSceneCommandsHandler);
|
||||||
onActorInitHook =
|
onActorInitHook =
|
||||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnActorInit>(RandomizerOnActorInitHandler);
|
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnActorInit>(RandomizerOnActorInitHandler);
|
||||||
onActorUpdateHook =
|
onActorUpdateHook =
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include <libultraship/libultraship.h>
|
#include <libultraship/libultraship.h>
|
||||||
#include "soh/resource/type/Scene.h"
|
#include "soh/resource/type/Scene.h"
|
||||||
#include <utils/StringHelper.h>
|
#include <utils/StringHelper.h>
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "vt.h"
|
#include "vt.h"
|
||||||
#include <Vertex.h>
|
#include <Vertex.h>
|
||||||
|
@ -59,7 +59,7 @@ extern "C" void OTRPlay_SpawnScene(PlayState* play, s32 sceneId, s32 spawn) {
|
||||||
|
|
||||||
osSyncPrintf("ROOM SIZE=%fK\n", roomSize / 1024.0f);
|
osSyncPrintf("ROOM SIZE=%fK\n", roomSize / 1024.0f);
|
||||||
|
|
||||||
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnSceneInit>(play->sceneNum);
|
GameInteractor_ExecuteOnSceneInit(play->sceneNum);
|
||||||
SPDLOG_INFO("Scene Init - sceneNum: {0:#x}, entranceIndex: {1:#x}", play->sceneNum, gSaveContext.entranceIndex);
|
SPDLOG_INFO("Scene Init - sceneNum: {0:#x}, entranceIndex: {1:#x}", play->sceneNum, gSaveContext.entranceIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,6 +79,7 @@ void OTRPlay_InitScene(PlayState* play, s32 spawn) {
|
||||||
YREG(15) = 0;
|
YREG(15) = 0;
|
||||||
gSaveContext.worldMapArea = 0;
|
gSaveContext.worldMapArea = 0;
|
||||||
OTRScene_ExecuteCommands(play, (SOH::Scene*)play->sceneSegment);
|
OTRScene_ExecuteCommands(play, (SOH::Scene*)play->sceneSegment);
|
||||||
|
GameInteractor_ExecuteAfterSceneCommands(play->sceneNum);
|
||||||
Play_InitEnvironment(play, play->skyboxId);
|
Play_InitEnvironment(play, play->skyboxId);
|
||||||
/* auto data = static_cast<LUS::Vertex*>(Ship::Context::GetInstance()
|
/* auto data = static_cast<LUS::Vertex*>(Ship::Context::GetInstance()
|
||||||
->GetResourceManager()
|
->GetResourceManager()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue