From 3a4a9d7240ac0473ff0f7fb8c3e4f30b05c72c51 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Sun, 29 Dec 2019 01:55:59 +0800 Subject: [PATCH] Increased the width of the total weight display in the inventory (moved from the CritterInvSizeLimitMode option) Updated version number and year. Minor format edits to some code and README.md. --- README.md | 8 ++++---- sfall/FalloutEngine/Functions.cpp | 2 +- sfall/Modules/Credits.cpp | 2 +- sfall/Modules/ExtraSaveSlots.cpp | 6 +++++- sfall/Modules/Inventory.cpp | 5 +++-- sfall/version.h | 6 +++--- 6 files changed, 17 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index e43f9ea1..e1f49bf4 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # sfall -A set of engine modifications for the classic game Fallout 2 in form of a DLL, which modifies executable in memory without changing anything in EXE file itself. +A set of engine modifications for the classic game Fallout 2 in form of a DLL, which modifies executable in memory without changing anything in EXE file itself. -Engine modifications include: +**Engine modifications include:** - Better support for modern operating systems - Externalizing many settings like starting map and game time, skills, perks, critical hit tables, books, etc. - Bug fixes @@ -10,7 +10,7 @@ Engine modifications include: - Extended scripting capabilities for modders (many new opcodes to control sfall features as well as previously unavailable vanilla engine functions) -Original author: timeslip +Original author: timeslip -Original description: A set of engine modifications for the classic game Fallout 2 by Interplay. Includes fixes for bugs in the original engine, allows fallout to run correctly on modern operating systems, and adds additional features for modders. +Original description: A set of engine modifications for the classic game Fallout 2 by Interplay. Includes fixes for bugs in the original engine, allows fallout to run correctly on modern operating systems, and adds additional features for modders. diff --git a/sfall/FalloutEngine/Functions.cpp b/sfall/FalloutEngine/Functions.cpp index f951e1cd..a077a1c2 100644 --- a/sfall/FalloutEngine/Functions.cpp +++ b/sfall/FalloutEngine/Functions.cpp @@ -317,7 +317,7 @@ long __stdcall message_exit(MessageList *msgList) { long __fastcall tile_num(long x, long y) { __asm push ebx; // don't delete (bug in tile_num_) - WRAP_WATCOM_FCALL2(tile_num_, x, x); + WRAP_WATCOM_FCALL2(tile_num_, x, y) __asm pop ebx; } diff --git a/sfall/Modules/Credits.cpp b/sfall/Modules/Credits.cpp index 31618d9d..a9625c94 100644 --- a/sfall/Modules/Credits.cpp +++ b/sfall/Modules/Credits.cpp @@ -34,7 +34,7 @@ static const char* ExtraLines[] = { "#SFALL " VERSION_STRING, "", "sfall is free software, licensed under the GPL", - "Copyright 2008-2019 The sfall team", + "Copyright 2008-2020 The sfall team", "", "@Author", "Timeslip", diff --git a/sfall/Modules/ExtraSaveSlots.cpp b/sfall/Modules/ExtraSaveSlots.cpp index a697bf97..782abe1c 100644 --- a/sfall/Modules/ExtraSaveSlots.cpp +++ b/sfall/Modules/ExtraSaveSlots.cpp @@ -86,6 +86,7 @@ static void __declspec(naked) load_page_offsets(void) { //------------------------------------------ static void CreateButtons() { DWORD winRef = fo::var::lsgwin; + // left button -10 | X | Y | W | H |HOn |HOff |BDown |BUp |PicUp |PicDown |? |ButType fo::func::win_register_button(winRef, 100, 60, 24, 20, -1, 0x500, 0x54B, 0x14B, 0, 0, 0, 32); // left button -100 @@ -379,7 +380,7 @@ void EnableSuperSaving() { // load saved page and list positions from file MakeCalls(load_page_offsets, {0x47B82B}); - // Add Load/Save page offset to Load/Save folder number///////////////// + // Add Load/Save page offset to Load/Save folder number MakeCalls(AddPageOffset01, { 0x47B929, 0x47D8DB, 0x47D9B0, 0x47DA34, 0x47DABF, 0x47DB58, 0x47DBE9, 0x47DC9C, 0x47EC77, 0x47F5AB, 0x47F694, 0x47F6EB, 0x47F7FB, 0x47F892, @@ -422,17 +423,20 @@ static long autoQuickSave = 0; static long quickSavePage = 0; static FILETIME ftPrevSlot; + static DWORD __stdcall QuickSaveGame(fo::DbFile* file, char* filename) { long currSlot = fo::var::slot_cursor; if (file) { // This slot is not empty fo::func::db_fclose(file); + FILETIME ftCurrSlot; GetSaveFileTime(filename, &ftCurrSlot); if (currSlot == 0 || ftCurrSlot.dwHighDateTime > ftPrevSlot.dwHighDateTime || (ftCurrSlot.dwHighDateTime == ftPrevSlot.dwHighDateTime && ftCurrSlot.dwLowDateTime > ftPrevSlot.dwLowDateTime)) { ftPrevSlot.dwHighDateTime = ftCurrSlot.dwHighDateTime; ftPrevSlot.dwLowDateTime = ftCurrSlot.dwLowDateTime; + if (++currSlot > autoQuickSave) { currSlot = 0; } else { diff --git a/sfall/Modules/Inventory.cpp b/sfall/Modules/Inventory.cpp index 02d805ef..53f55000 100644 --- a/sfall/Modules/Inventory.cpp +++ b/sfall/Modules/Inventory.cpp @@ -737,8 +737,6 @@ void Inventory::init() { SafeWrite8(0x47260F, 0x20); SafeWrite32(0x4725F9, 0x9C + 0x0C); SafeWrite8(0x472606, 0x10 + 0x0C); - SafeWrite32(0x472632, 150); // width - SafeWrite8(0x472638, 0); // x offset position // Display item size when examining HookCall(0x472FFE, inven_obj_examine_func_hook); @@ -755,6 +753,9 @@ void Inventory::init() { SafeWrite8(0x449150, 0x10 + 0x08); } } + // Adjust the max text width of the total weight display in the inventory + SafeWrite32(0x472632, 150); + SafeWrite8(0x472638, 0); // x offset position if (GetConfigInt("Misc", "SuperStimExploitFix", 0)) { superStimMsg = Translate("sfall", "SuperStimExploitMsg", "You cannot use a super stim on someone who is not injured!"); diff --git a/sfall/version.h b/sfall/version.h index 1a9d0c4e..ec2f81d3 100644 --- a/sfall/version.h +++ b/sfall/version.h @@ -20,11 +20,11 @@ #define TARGETVERSION "Fallout 2 v1.02 US" -#define LEGAL_COPYRIGHT "Copyright (C) 2006-2019, sfall team" +#define LEGAL_COPYRIGHT "Copyright (C) 2006-2020, sfall team" #define VERSION_MAJOR 4 #define VERSION_MINOR 2 -#define VERSION_BUILD 2 +#define VERSION_BUILD 3 #define VERSION_REV 0 -#define VERSION_STRING "4.2.2" +#define VERSION_STRING "4.2.3"