use RegisterShipInitFunc

This commit is contained in:
briaguya 2025-01-21 16:38:39 -05:00
parent 2bc46bfa68
commit 849c4325b9
3 changed files with 15 additions and 12 deletions

View File

@ -1,19 +1,24 @@
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/ShipInit.hpp"
extern "C" { extern "C" {
#include "macros.h" #include "macros.h"
#include "z64.h" #include "z64.h"
} }
void SkipLogoTitle_Register() { // Allows pressing A to skip the boot logo and go to the next state (opening or file select)
// Allows pressing A to skip the boot logo and go to the next state (opening or file select) void OnZTitleUpdateSkipLogoTitle(void* gameState) {
COND_HOOK(OnZTitleUpdate, true, [](void* gameState) { TitleContext* titleContext = (TitleContext*)gameState;
TitleContext* titleContext = (TitleContext*)gameState;
if (CHECK_BTN_ANY(titleContext->state.input->press.button, BTN_A | BTN_B | BTN_START)) { if (CHECK_BTN_ANY(titleContext->state.input->press.button, BTN_A | BTN_B | BTN_START)) {
// Force the title state to start fading to black and to last roughly 5 frames based on current fade in/out // Force the title state to start fading to black and to last roughly 5 frames based on current fade in/out
titleContext->visibleDuration = 0; titleContext->visibleDuration = 0;
titleContext->addAlpha = (255 - titleContext->coverAlpha) / 5; titleContext->addAlpha = (255 - titleContext->coverAlpha) / 5;
} }
});
} }
void RegisterSkipLogoTitle() {
COND_HOOK(OnZTitleUpdate, true, OnZTitleUpdateSkipLogoTitle);
}
static RegisterShipInitFunc initFunc(RegisterSkipLogoTitle);

View File

@ -9,7 +9,6 @@ void TimeSavers_Register() {
SkipToGivingZeldasLetter_Register(); SkipToGivingZeldasLetter_Register();
SkipZeldaFleeingCastle_Register(); SkipZeldaFleeingCastle_Register();
SkipIntro_Register(); SkipIntro_Register();
SkipLogoTitle_Register();
// SkipMiscInteractions // SkipMiscInteractions
MoveJabuJabuElevator_Register(); MoveJabuJabuElevator_Register();
MoveMidoInKokiriForest_Register(); MoveMidoInKokiriForest_Register();

View File

@ -11,7 +11,6 @@ void TimeSavers_Register();
void SkipToGivingZeldasLetter_Register(); void SkipToGivingZeldasLetter_Register();
void SkipZeldaFleeingCastle_Register(); void SkipZeldaFleeingCastle_Register();
void SkipIntro_Register(); void SkipIntro_Register();
void SkipLogoTitle_Register();
// SkipMiscInteractions // SkipMiscInteractions
void MoveJabuJabuElevator_Register(); void MoveJabuJabuElevator_Register();
void MoveMidoInKokiriForest_Register(); void MoveMidoInKokiriForest_Register();