mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-24 15:15:33 -07:00
Feedback Update
-A new hook was created 'OnPauseMenu' so now PauseWarp_Main is only called when the pause menu is open -Moved pauswarp.c to the Enhancements folder -Removed from graph.c PR Change: Changing to the main branch instead of sulu
This commit is contained in:
parent
a5b851cfe6
commit
b1e621b375
6 changed files with 25 additions and 1 deletions
|
@ -184,6 +184,8 @@ public:
|
||||||
|
|
||||||
DEFINE_HOOK(OnSetGameLanguage, void());
|
DEFINE_HOOK(OnSetGameLanguage, void());
|
||||||
|
|
||||||
|
DEFINE_HOOK(OnPauseMenu, void());
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
static bool IsSaveLoaded();
|
static bool IsSaveLoaded();
|
||||||
static bool IsGameplayPaused();
|
static bool IsGameplayPaused();
|
||||||
|
|
|
@ -161,3 +161,8 @@ void GameInteractor_ExecuteOnUpdateFileNameSelection(int16_t charCode) {
|
||||||
void GameInteractor_ExecuteOnSetGameLanguage() {
|
void GameInteractor_ExecuteOnSetGameLanguage() {
|
||||||
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnSetGameLanguage>();
|
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnSetGameLanguage>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: - Pause Menu
|
||||||
|
void GameInteractor_ExecuteOnPauseMenu() {
|
||||||
|
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnPauseMenu>();
|
||||||
|
}
|
|
@ -51,6 +51,10 @@ void GameInteractor_ExecuteOnUpdateFileNameSelection(int16_t charCode);
|
||||||
|
|
||||||
// MARK: - Game
|
// MARK: - Game
|
||||||
void GameInteractor_ExecuteOnSetGameLanguage();
|
void GameInteractor_ExecuteOnSetGameLanguage();
|
||||||
|
|
||||||
|
//MARK: - Pause Menu
|
||||||
|
void GameInteractor_ExecuteOnPauseMenu();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -32,6 +32,7 @@ extern SaveContext gSaveContext;
|
||||||
extern PlayState* gPlayState;
|
extern PlayState* gPlayState;
|
||||||
extern void Overlay_DisplayText(float duration, const char* text);
|
extern void Overlay_DisplayText(float duration, const char* text);
|
||||||
uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum);
|
uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum);
|
||||||
|
void PauseWarp_Main();
|
||||||
}
|
}
|
||||||
bool performDelayedSave = false;
|
bool performDelayedSave = false;
|
||||||
bool performSave = false;
|
bool performSave = false;
|
||||||
|
@ -974,6 +975,12 @@ void RegisterRandomizerSheikSpawn() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RegisterPauseWarp() {
|
||||||
|
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnPauseMenu>([]() {
|
||||||
|
PauseWarp_Main();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void InitMods() {
|
void InitMods() {
|
||||||
RegisterTTS();
|
RegisterTTS();
|
||||||
RegisterInfiniteMoney();
|
RegisterInfiniteMoney();
|
||||||
|
@ -1000,4 +1007,5 @@ void InitMods() {
|
||||||
RegisterAltTrapTypes();
|
RegisterAltTrapTypes();
|
||||||
RegisterRandomizerSheikSpawn();
|
RegisterRandomizerSheikSpawn();
|
||||||
NameTag_RegisterHooks();
|
NameTag_RegisterHooks();
|
||||||
|
RegisterPauseWarp();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,9 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "soh/Enhancements/gameconsole.h"
|
#include "soh/Enhancements/gameconsole.h"
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "../custom-message/CustomMessageTypes.h"
|
#include <soh/Enhancements/custom-message/CustomMessageTypes.h>
|
||||||
|
|
||||||
|
#include "luslog.h"
|
||||||
|
|
||||||
// Defining the structure for the pause warp state, which holds different flags and cooldowns
|
// Defining the structure for the pause warp state, which holds different flags and cooldowns
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -67,6 +69,7 @@ void HandleCooldowns(PauseWarpState* state) {
|
||||||
|
|
||||||
// The main function that gets called every frame
|
// The main function that gets called every frame
|
||||||
void PauseWarp_Main() {
|
void PauseWarp_Main() {
|
||||||
|
LUSLOG_CRITICAL("PauseWarp_Main Called");
|
||||||
static PauseWarpState state; // The state is static so it retains its value between function calls
|
static PauseWarpState state; // The state is static so it retains its value between function calls
|
||||||
|
|
||||||
// Checking if the pause warp feature is enabled
|
// Checking if the pause warp feature is enabled
|
|
@ -56,6 +56,8 @@ void KaleidoScopeCall_Update(PlayState* play) {
|
||||||
KaleidoMgrOverlay* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE];
|
KaleidoMgrOverlay* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE];
|
||||||
PauseContext* pauseCtx = &play->pauseCtx;
|
PauseContext* pauseCtx = &play->pauseCtx;
|
||||||
|
|
||||||
|
GameInteractor_ExecuteOnPauseMenu();
|
||||||
|
|
||||||
if (!gSaveContext.sohStats.gameComplete &&
|
if (!gSaveContext.sohStats.gameComplete &&
|
||||||
(!gSaveContext.isBossRush || !gSaveContext.isBossRushPaused)) {
|
(!gSaveContext.isBossRush || !gSaveContext.isBossRushPaused)) {
|
||||||
gSaveContext.sohStats.pauseTimer++;
|
gSaveContext.sohStats.pauseTimer++;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue