Add PAUSEWIN (Ctrl+P) to LoadGameHook game modes

This commit is contained in:
phobos2077
2024-06-01 22:14:11 +02:00
parent ca5012b227
commit f7bf341d78
3 changed files with 13 additions and 0 deletions
+1
View File
@@ -23,6 +23,7 @@
#define HEROWIN (0x40000) #define HEROWIN (0x40000)
#define DIALOGVIEW (0x80000) #define DIALOGVIEW (0x80000)
#define COUNTERWIN (0x100000) // counter window for moving multiple items or setting a timer #define COUNTERWIN (0x100000) // counter window for moving multiple items or setting a timer
#define PAUSEWIN (0x200000) // Ctrl+P pause window
#define SPECIAL (0x80000000) #define SPECIAL (0x80000000)
// Valid arguments to register_hook_proc // Valid arguments to register_hook_proc
+11
View File
@@ -569,6 +569,15 @@ static void __declspec(naked) HelpMenuHook() {
} }
} }
static void __declspec(naked) PauseWindowHook() {
__asm {
_InLoop(1, PAUSEWIN);
call fo::funcoffs::PauseWindow_;
_InLoop(0, PAUSEWIN);
retn;
}
}
static void __declspec(naked) CharacterHook() { static void __declspec(naked) CharacterHook() {
__asm { __asm {
push edx; push edx;
@@ -865,6 +874,8 @@ void LoadGameHook::init() {
HookCall(0x447A7E, gdialog_bk_hook); // set when switching from dialog mode to barter mode (unset when entering barter) HookCall(0x447A7E, gdialog_bk_hook); // set when switching from dialog mode to barter mode (unset when entering barter)
HookCall(0x4457B1, gdialogUpdatePartyStatus_hook1); // set when a party member joins/leaves HookCall(0x4457B1, gdialogUpdatePartyStatus_hook1); // set when a party member joins/leaves
HookCall(0x4457BC, gdialogUpdatePartyStatus_hook0); // unset HookCall(0x4457BC, gdialogUpdatePartyStatus_hook0); // unset
HookCall(0x443482, PauseWindowHook);
} }
Delegate<>& LoadGameHook::OnBeforeGameInit() { Delegate<>& LoadGameHook::OnBeforeGameInit() {
+1
View File
@@ -101,6 +101,7 @@ enum LoopFlag : unsigned long {
HEROWIN = 1 << 18, // 0x40000 Hero Appearance mod HEROWIN = 1 << 18, // 0x40000 Hero Appearance mod
DIALOGVIEW = 1 << 19, // 0x80000 DIALOGVIEW = 1 << 19, // 0x80000
COUNTERWIN = 1 << 20, // 0x100000 Counter window for moving multiple items or setting a timer COUNTERWIN = 1 << 20, // 0x100000 Counter window for moving multiple items or setting a timer
PAUSEWIN = 1 << 21, // 0x200000 Ctrl+P pause window
SPECIAL = 1UL << 31 // 0x80000000 Additional special flag for all modes SPECIAL = 1UL << 31 // 0x80000000 Additional special flag for all modes
}; };