Tweaks to warp point (#666)

* Tweaks to warp point

* wait for console logo exit

---------

Co-authored-by: Archez <Archez@users.noreply.github.com>
This commit is contained in:
Garrett Cox
2024-06-25 00:16:10 -04:00
committed by GitHub
co-authored by Archez
parent 3ef3e7a239
commit 2e4710c6c2
13 changed files with 109 additions and 26 deletions
@@ -0,0 +1,33 @@
#include <libultraship/bridge.h>
#include "Enhancements/GameInteractor/GameInteractor.h"
extern "C" {
#include "z64.h"
#include "z64game.h"
#include "overlays/gamestates/ovl_file_choose/z_file_select.h"
#include "overlays/gamestates/ovl_title/z_title.h"
extern SaveContext gSaveContext;
extern GameState* gGameState;
}
void RegisterSkipToFileSelect() {
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnConsoleLogoUpdate>([]() {
if (CVarGetInteger("gEnhancements.Cutscenes.SkipToFileSelect", 0)) {
ConsoleLogoState* consoleLogoState = (ConsoleLogoState*)gGameState;
// Wait for the console logo to fade out
if (consoleLogoState->exit) {
// Normally the PRNG seed is set at least once from the title opening running Play_Init
// We need to call it manually before file select creates RNG values for new saves
Rand_Seed(osGetTime());
// Normally called on console logo screen
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
gSaveContext.ambienceId = AMBIENCE_ID_DISABLED;
gSaveContext.gameMode = GAMEMODE_TITLE_SCREEN;
STOP_GAMESTATE(gGameState);
SET_NEXT_GAMESTATE(gGameState, FileSelect_Init, sizeof(FileSelectState));
}
}
});
}