mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-02-24 14:51:46 -05:00
use RegisterShipInitFunc
This commit is contained in:
parent
2bc46bfa68
commit
849c4325b9
@ -1,19 +1,24 @@
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||
#include "soh/ShipInit.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include "macros.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)
|
||||
COND_HOOK(OnZTitleUpdate, true, [](void* gameState) {
|
||||
TitleContext* titleContext = (TitleContext*)gameState;
|
||||
// Allows pressing A to skip the boot logo and go to the next state (opening or file select)
|
||||
void OnZTitleUpdateSkipLogoTitle(void* gameState) {
|
||||
TitleContext* titleContext = (TitleContext*)gameState;
|
||||
|
||||
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
|
||||
titleContext->visibleDuration = 0;
|
||||
titleContext->addAlpha = (255 - titleContext->coverAlpha) / 5;
|
||||
}
|
||||
});
|
||||
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
|
||||
titleContext->visibleDuration = 0;
|
||||
titleContext->addAlpha = (255 - titleContext->coverAlpha) / 5;
|
||||
}
|
||||
}
|
||||
|
||||
void RegisterSkipLogoTitle() {
|
||||
COND_HOOK(OnZTitleUpdate, true, OnZTitleUpdateSkipLogoTitle);
|
||||
}
|
||||
|
||||
static RegisterShipInitFunc initFunc(RegisterSkipLogoTitle);
|
||||
|
@ -9,7 +9,6 @@ void TimeSavers_Register() {
|
||||
SkipToGivingZeldasLetter_Register();
|
||||
SkipZeldaFleeingCastle_Register();
|
||||
SkipIntro_Register();
|
||||
SkipLogoTitle_Register();
|
||||
// SkipMiscInteractions
|
||||
MoveJabuJabuElevator_Register();
|
||||
MoveMidoInKokiriForest_Register();
|
||||
|
@ -11,7 +11,6 @@ void TimeSavers_Register();
|
||||
void SkipToGivingZeldasLetter_Register();
|
||||
void SkipZeldaFleeingCastle_Register();
|
||||
void SkipIntro_Register();
|
||||
void SkipLogoTitle_Register();
|
||||
// SkipMiscInteractions
|
||||
void MoveJabuJabuElevator_Register();
|
||||
void MoveMidoInKokiriForest_Register();
|
||||
|
Loading…
x
Reference in New Issue
Block a user