Added WorldMapFont option to use Fallout font on the world map instead of system font. (#48)

This commit is contained in:
NovaRain
2018-05-29 16:22:58 +08:00
parent 62d4577152
commit 120a8cd964
2 changed files with 20 additions and 0 deletions
+3
View File
@@ -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
+17
View File
@@ -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);