pause state helper example

This commit is contained in:
inspectredc
2023-10-07 00:39:43 +01:00
parent d0d7e684c2
commit b731571a92
2 changed files with 16 additions and 7 deletions
@@ -1,12 +1,16 @@
#include "GameInteractor.h"
bool GameInteractor::IsSaveLoaded() {
// todo
return false;
}
#include "game/level_update.h"
extern int16_t sCurrPlayMode;
// Taken from game/level_update.c
#define PLAY_MODE_NORMAL 0
#define PLAY_MODE_PAUSED 2
#define PLAY_MODE_CHANGE_AREA 3
#define PLAY_MODE_CHANGE_LEVEL 4
#define PLAY_MODE_FRAME_ADVANCE 5
bool GameInteractor::IsGameplayPaused() {
// todo
return false;
return sCurrPlayMode == PLAY_MODE_PAUSED;
}
@@ -1,3 +1,6 @@
#ifndef GameInteractor_h
#define GameInteractor_h
#ifdef __cplusplus
extern "C" {
#endif
@@ -38,9 +41,9 @@ public:
DEFINE_HOOK(OnHealthChange, void(int16_t health));
// Helpers
static bool IsSaveLoaded();
static bool IsGameplayPaused();
// Game Actions
class RawAction {
};
@@ -48,3 +51,5 @@ public:
};
#endif // __cplusplus
#endif // GameInteractor_h