diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index d5d40f1b..52ce2975 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -554,6 +554,9 @@ InstantWeaponEquip=0 ;Set to 1 to display numbered dialogue options NumbersInDialogue=0 +;Set to 1 to use Fallout font on the world map instead of system font +WorldMapFont=0 + ;Set to 1 to display sfall built-in credits at the bottom of credits.txt contents instead of at the top CreditsAtBottom=0 diff --git a/sfall/Modules/Worldmap.cpp b/sfall/Modules/Worldmap.cpp index 14e09f45..b93781f4 100644 --- a/sfall/Modules/Worldmap.cpp +++ b/sfall/Modules/Worldmap.cpp @@ -225,6 +225,14 @@ static __declspec(naked) void PathfinderFix() { } } +static void __declspec(naked) wmInterfaceInit_text_font_hook() { + __asm { + mov eax, 0x65; // normal text font + call fo::funcoffs::text_font_; + retn; + } +} + static void RestRestore() { if (!restMode) return; @@ -421,6 +429,14 @@ void StartingStatePatches() { } } +void WorldMapFontPatch() { + if (GetConfigInt("Misc", "WorldMapFont", 0)) { + dlog("Applying world map font patch.", DL_INIT); + HookCall(0x4C2343, wmInterfaceInit_text_font_hook); + dlogr(" Done", DL_INIT); + } +} + void Worldmap::init() { PathfinderFixInit(); StartingStatePatches(); @@ -428,6 +444,7 @@ void Worldmap::init() { TownMapsHotkeyFix(); WorldLimitsPatches(); WorldmapFpsPatch(); + WorldMapFontPatch(); LoadGameHook::OnGameReset() += []() { SetCarInterfaceArt(0x1B1);