mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-02-24 14:51:46 -05:00
skip z_title with button press
This commit is contained in:
parent
63046a89ec
commit
2bc46bfa68
@ -0,0 +1,19 @@
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
}
|
||||
});
|
||||
}
|
@ -9,6 +9,7 @@ void TimeSavers_Register() {
|
||||
SkipToGivingZeldasLetter_Register();
|
||||
SkipZeldaFleeingCastle_Register();
|
||||
SkipIntro_Register();
|
||||
SkipLogoTitle_Register();
|
||||
// SkipMiscInteractions
|
||||
MoveJabuJabuElevator_Register();
|
||||
MoveMidoInKokiriForest_Register();
|
||||
|
@ -11,6 +11,7 @@ void TimeSavers_Register();
|
||||
void SkipToGivingZeldasLetter_Register();
|
||||
void SkipZeldaFleeingCastle_Register();
|
||||
void SkipIntro_Register();
|
||||
void SkipLogoTitle_Register();
|
||||
// SkipMiscInteractions
|
||||
void MoveJabuJabuElevator_Register();
|
||||
void MoveMidoInKokiriForest_Register();
|
||||
|
@ -5,6 +5,7 @@
|
||||
* - Argument 1: Name of the hook
|
||||
* - Argument 2: Function type that the hook uses
|
||||
*/
|
||||
DEFINE_HOOK(OnZTitleUpdate, (void* gameState));
|
||||
DEFINE_HOOK(OnLoadGame, (int32_t fileNum));
|
||||
DEFINE_HOOK(OnExitGame, (int32_t fileNum));
|
||||
DEFINE_HOOK(OnGameFrameUpdate, ());
|
||||
|
@ -2,6 +2,10 @@
|
||||
|
||||
// MARK: - Gameplay
|
||||
|
||||
void GameInteractor_ExecuteOnZTitleUpdate(void* gameState) {
|
||||
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnZTitleUpdate>(gameState);
|
||||
}
|
||||
|
||||
void GameInteractor_ExecuteOnLoadGame(int32_t fileNum) {
|
||||
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnLoadGame>(fileNum);
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
// MARK: - Gameplay
|
||||
void GameInteractor_ExecuteOnZTitleUpdate(void* gameState);
|
||||
void GameInteractor_ExecuteOnLoadGame(int32_t fileNum);
|
||||
void GameInteractor_ExecuteOnExitGame(int32_t fileNum);
|
||||
void GameInteractor_ExecuteOnGameFrameUpdate();
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include <soh/GameVersions.h>
|
||||
#include <soh/SaveManager.h>
|
||||
#include "soh/ResourceManagerHelpers.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||
#include <string.h>
|
||||
|
||||
#include "time.h"
|
||||
@ -275,6 +276,8 @@ void Title_Main(GameState* thisx) {
|
||||
SET_NEXT_GAMESTATE(&this->state, Opening_Init, OpeningContext);
|
||||
}
|
||||
|
||||
GameInteractor_ExecuteOnZTitleUpdate(this);
|
||||
|
||||
CLOSE_DISPS(this->state.gfxCtx);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user