Added description of HOOK_GAMEMODECHANGE to hookscripts.txt.

Fixed the line break for debug.log message of GameReset.
Minor edits to Tiles.cpp code format.
This commit is contained in:
NovaRain
2018-05-28 23:37:45 +08:00
parent 4ef20c3526
commit 2d8ea2b44c
3 changed files with 22 additions and 5 deletions
+8
View File
@@ -498,3 +498,11 @@ int arg3 - the hour part of the length of resting time
int arg4 - the minute part of the length of resting time int arg4 - the minute part of the length of resting time
int ret1 - pass 1 to interrupt the resting int ret1 - pass 1 to interrupt the resting
-------------------------------------------
HOOK_GAMEMODECHANGE (hs_gamemodechange.int)
Runs once every time when the game mode was changed, like opening/closing the inventory, character screen, pipboy, etc.
int arg1 - event type: 1 - when the player exits the game, 0 - otherwise
+12 -3
View File
@@ -37,8 +37,16 @@
namespace sfall namespace sfall
{ {
#define _InLoop(type, flag) _asm pushad _asm push flag _asm push type _asm call SetInLoop _asm popad #define _InLoop(type, flag) __asm { \
#define _InLoop2(type, flag) _asm push flag _asm push type _asm call SetInLoop _asm pushad \
_asm push flag \
_asm push type \
_asm call SetInLoop \
_asm popad }
#define _InLoop2(type, flag) __asm { \
_asm push flag \
_asm push type \
_asm call SetInLoop }
static Delegate<> onGameInit; static Delegate<> onGameInit;
static Delegate<> onGameReset; static Delegate<> onGameReset;
@@ -206,7 +214,7 @@ static void _stdcall GameReset(DWORD isGameLoad) {
if (isDebug) { if (isDebug) {
char* str = (isGameLoad) ? "on Load" : "on Exit"; char* str = (isGameLoad) ? "on Load" : "on Exit";
fo::func::debug_printf("n\[SFALL: State reset %s]", str); fo::func::debug_printf("\n[SFALL: State reset %s]\n", str);
} }
} }
@@ -564,4 +572,5 @@ Delegate<>& LoadGameHook::OnAfterNewGame() {
Delegate<DWORD>& LoadGameHook::OnGameModeChange() { Delegate<DWORD>& LoadGameHook::OnGameModeChange() {
return onGameModeChange; return onGameModeChange;
} }
} }