From c6d612f4a7d9237f41bcc815f88ec76faa96765c Mon Sep 17 00:00:00 2001 From: NovaRain Date: Fri, 23 Aug 2019 10:35:17 +0800 Subject: [PATCH] Added MainMenuBigFontColour option to change button text color Changed the fix for player's direction after climbing ladder (61aa11) --- artifacts/ddraw.ini | 6 ++++-- sfall/AnimationsAtOnceLimit.cpp | 10 ++-------- sfall/FalloutEngine.cpp | 2 +- sfall/FalloutEngine.h | 2 +- sfall/MainMenu.cpp | 18 +++++++++++------- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index 91c21494..4a7789b2 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -478,8 +478,10 @@ RemoveCriticalTimelimits=0 NPCStage6Fix=0 ;Change the colour of the font used on the main menu for the Fallout/sfall version number and copyright text -;It's the last byte ('3c' by default) that picks the colour used. The first byte supplies additional flags -;MainMenuFontColour=0x0600003c +;It's the last byte ('3C' by default) that picks the colour used. The first byte supplies additional flags for this option +;MainMenuFontColour=0x00003C +;Change the colour of the font used on the main menu for the button text +;MainMenuBigFontColour=0x3C ;Two alternate fixes to the interaction between HtH attacks and the fast shot trait ;0 - Fallout 2 original behaviour diff --git a/sfall/AnimationsAtOnceLimit.cpp b/sfall/AnimationsAtOnceLimit.cpp index 7e4592dd..a4ae786b 100644 --- a/sfall/AnimationsAtOnceLimit.cpp +++ b/sfall/AnimationsAtOnceLimit.cpp @@ -149,10 +149,6 @@ static const DWORD sad_28[] = { 0x4173CE, 0x4174C1, 0x4175F1, 0x417730, }; -static const DWORD use_ladder_stairs[] = { - 0x49C972, 0x49CA16, 0x49CABA, -}; - static void __declspec(naked) anim_set_end_hack() { __asm { mov edi, _anim_set; @@ -365,10 +361,8 @@ void AnimationsAtOnceInit() { // Fix crash when the critter goes through a door with animation trigger MakeJump(0x41755E, object_move_hack); - // Fix player's direction after leaving a map via ladder/stairs - for (int i = 0; i < sizeof(use_ladder_stairs) / 4; i++) { - SafeWrite8(use_ladder_stairs[i], 25); - } + // Fix player's direction after ladder climbing animation + SafeWrite16(0x49CA14, 0xB190); // mov cl, 26 (skip setting the direction) } void AnimationsAtOnceExit() { diff --git a/sfall/FalloutEngine.cpp b/sfall/FalloutEngine.cpp index a926a463..8ba0622b 100644 --- a/sfall/FalloutEngine.cpp +++ b/sfall/FalloutEngine.cpp @@ -1102,7 +1102,7 @@ void __stdcall MapDirErase(const char* folder, const char* ext) { } } -long __fastcall ObjBlockingAt(TGameObj* object, long tile, long elevation) { +TGameObj* __fastcall ObjBlockingAt(TGameObj* object, long tile, long elevation) { __asm { mov ebx, elevation; mov eax, ecx; diff --git a/sfall/FalloutEngine.h b/sfall/FalloutEngine.h index e923511a..416b0884 100644 --- a/sfall/FalloutEngine.h +++ b/sfall/FalloutEngine.h @@ -1069,7 +1069,7 @@ FrmFrameData* __fastcall FramePtr(FrmHeaderData* frm, long frame, long direction void __stdcall MapDirErase(const char* folder, const char* ext); -long __fastcall ObjBlockingAt(TGameObj* object, long tile, long elevation); +TGameObj* __fastcall ObjBlockingAt(TGameObj* object, long tile, long elevation); long __fastcall TileNumInDirection(long tile, long rotation, long distance); diff --git a/sfall/MainMenu.cpp b/sfall/MainMenu.cpp index 9ccb88f7..a0dcf80c 100644 --- a/sfall/MainMenu.cpp +++ b/sfall/MainMenu.cpp @@ -30,7 +30,7 @@ static const char* VerString1 = "SFALL " VERSION_STRING " Debug Build"; static DWORD MainMenuYOffset; static DWORD MainMenuTextOffset; -static long OverrideColour; +static long OverrideColour, OverrideColour2; static const DWORD MainMenuButtonYHookRet = 0x48184A; static void __declspec(naked) MainMenuButtonYHook() { @@ -51,13 +51,13 @@ static void __declspec(naked) MainMenuTextYHook() { static void __declspec(naked) FontColour() { __asm { - cmp OverrideColour, 0; - jg override; + test OverrideColour, 0xFF; + jnz override; movzx eax, byte ptr ds:[0x6A8B33]; - or eax, 0x6000000; + or eax, 0x6000000; retn; override: - mov eax, OverrideColour; + mov eax, OverrideColour; retn; } } @@ -117,9 +117,13 @@ void MainMenuInit() { } MakeJump(0x4817AB, MainMenuTextHook); + OverrideColour = GetPrivateProfileInt("Misc", "MainMenuFontColour", 0, ini); - if (OverrideColour > 0) { - OverrideColour |= 0x6000000; + if (OverrideColour & 0xFF) { + OverrideColour &= 0x00FF00FF; + OverrideColour |= 0x06000000; SafeWrite32(0x481748, (DWORD)&OverrideColour); } + OverrideColour2 = GetPrivateProfileInt("Misc", "MainMenuBigFontColour", 0, ini) & 0xFF; + if (OverrideColour2) SafeWrite32(0x481906, (DWORD)&OverrideColour2); }