Added QuestsScrollButtonsX/Y, DisplaySwiftLearnerExp, and additional note for the new mode of UseScrollingQuestsList to ddraw.ini.

Changed a log message in BugFixes.cpp to be a bit more specific.
Edited some comments in QuestList.cpp.
This commit is contained in:
NovaRain
2018-08-12 19:07:52 +08:00
parent 118b186d4d
commit a7c66685b9
7 changed files with 46 additions and 35 deletions
+9
View File
@@ -370,8 +370,14 @@ Repair=293
RemoveWindowRounding=0
;Set to 1 to add scroll buttons to the pipboy quest list, and remove the quests per area limit
;Set to 2 to use a different set of scroll buttons
UseScrollingQuestsList=1
;To change the location of quest list scroll buttons, uncomment the next two lines
;Defaults are 140 in the x direction and 334 in the y direction
;QuestsScrollButtonsX=140
;QuestsScrollButtonsY=334
;Uncomment these lines to control the premade characters offered when starting a new game
;Multiple options should be separated by commas, and there must be the same number of entries in both lines
;PremadePaths=combat,diplomat,stealth
@@ -581,6 +587,9 @@ KeepWeaponSelectMode=1
;Set to 1 to display full item description for weapon/ammo in barter screen
FullItemDescInBarter=0
;Set to 1 to display experience points with the bonus from Swift Learner perk when gained from non-scripted situations
DisplaySwiftLearnerExp=1
;Set to 1 to display sfall built-in credits at the bottom of credits.txt contents instead of at the top
CreditsAtBottom=0
+2 -2
View File
@@ -1562,6 +1562,8 @@ FUNC(gsound_internal_effect_callback_, 0x451AD0)
FUNC(gsound_internal_speech_callback_, 0x451A90)
FUNC(gsound_load_sound_, 0x4510DC)
FUNC(gsound_load_sound_volume_, 0x45145C)
FUNC(gsound_med_butt_press_, 0x451988)
FUNC(gsound_med_butt_release_, 0x451990)
FUNC(gsound_open_, 0x451A08)
FUNC(gsound_play_sfx_file_, 0x4519A8)
FUNC(gsound_play_sfx_file_volume_, 0x45108C)
@@ -1569,8 +1571,6 @@ FUNC(gsound_play_sound_, 0x451510)
FUNC(gsound_read_, 0x451A30)
FUNC(gsound_red_butt_press_, 0x451970)
FUNC(gsound_red_butt_release_, 0x451978)
FUNC(gsound_med_butt_release_, 0x451990)
FUNC(gsound_med_butt_press_, 0x451988)
FUNC(gsound_reset_, 0x450164)
FUNC(gsound_seek_, 0x451A4C)
FUNC(gsound_set_master_volume_, 0x4502EC)
+2 -1
View File
@@ -33,10 +33,11 @@ namespace func
Add functions here if they have non-trivial wrapper implementation (like vararg functions or too many arguments, etc.)
Otherwise use Functions_def.h file (much easier).
*/
long __fastcall _word_wrap(const char* text, int maxWidth, DWORD* buf, BYTE* count);
bool __stdcall art_exists(long artFid);
long __fastcall _word_wrap(const char* text, int maxWidth, DWORD* buf, BYTE* count);
// Returns the name of the critter
const char* __stdcall critter_name(GameObject* critter);
+3 -3
View File
@@ -127,11 +127,11 @@
#define FO_VAR_objectTable 0x639DA0
#define FO_VAR_objItemOutlineState 0x519798
#define FO_VAR_optionRect 0x58ECC0
#define FO_VAR_optionsButtonDown1 0x570518
#define FO_VAR_optionsButtonUp1 0x570514
#define FO_VAR_optionsButtonDown 0x59D400
#define FO_VAR_optionsButtonUp 0x59D3FC
#define FO_VAR_optionsButtonDown1 0x570518
#define FO_VAR_optionsButtonDownKey 0x518F2C
#define FO_VAR_optionsButtonUp 0x59D3FC
#define FO_VAR_optionsButtonUp1 0x570514
#define FO_VAR_optionsButtonUpKey 0x518F28
#define FO_VAR_outlined_object 0x518D94
#define FO_VAR_partyMemberAIOptions 0x519DB8
+3 -3
View File
@@ -120,11 +120,11 @@ VAR_(obj_dude, GameObject*)
VAR_(objectTable, DWORD)
VAR_(objItemOutlineState, DWORD)
VAR_(optionRect, DWORD)
VAR_(optionsButtonDown1, DWORD)
VAR_(optionsButtonUp1, DWORD)
VAR_(optionsButtonDown, DWORD)
VAR_(optionsButtonUp, DWORD)
VAR_(optionsButtonDown1, DWORD)
VAR_(optionsButtonDownKey, DWORD)
VAR_(optionsButtonUp, DWORD)
VAR_(optionsButtonUp1, DWORD)
VAR_(optionsButtonUpKey, DWORD)
VAR_(outlined_object, GameObject*)
VAR_(partyMemberAIOptions, DWORD)
+11 -10
View File
@@ -57,6 +57,7 @@ static void __declspec(naked) PipStatus_hook() {
retn;
}
}
// corrects saving script blocks (to *.sav file) by properly accounting for actual number of scripts to be saved
static void __declspec(naked) scr_write_ScriptNode_hook() {
__asm {
@@ -1291,6 +1292,7 @@ skip:
}
}
void BugFixes::init()
{
#ifndef NDEBUG
@@ -1310,14 +1312,14 @@ void BugFixes::init()
//}
// Fixes for clickability issue in Pip-Boy and exploit that allows to rest in places where you shouldn't be able to rest
dlog("Applying fix for Pip-Boy rest exploit.", DL_INIT);
dlog("Applying fix for Pip-Boy clickability issues and rest exploit.", DL_INIT);
MakeCall(0x4971C7, pipboy_hack);
MakeCall(0x499530, PipAlarm_hack);
dlogr(" Done", DL_INIT);
// Fixes of clickability holodisk
// Fix for clickability issue of holodisk list
HookCall(0x497E9F, PipStatus_hook);
SafeWrite16(0x497E8C, 0xD389); // mov ebx, edx
SafeMemSet(0x497E8E, 0x90, 4);
SafeWrite32(0x497E8E, 0x90909090);
dlogr(" Done", DL_INIT);
// Fix for "Too Many Items" bug
//if (GetConfigInt("Misc", "TooManyItemsBugFix", 1)) {
@@ -1636,17 +1638,16 @@ void BugFixes::init()
dlogr(" Done", DL_INIT);
}
// In derivation of number of experience points obtained, consider perk 'SwiftLearner' (Crafty)
if (GetConfigInt("Misc", "ExperienceSwiftLearnerFix", 1) != 0) {
dlog("Applying fix displayed experience points of Swift Learner perk.", DL_INIT);
HookCall(0x4221E2, combat_give_exps_hook);
HookCall(0x4C0AEB, wmRndEncounterOccurred_hook);
// Display experience points with the bonus from Swift Learner perk when gained from non-scripted situations
if (GetConfigInt("Misc", "DisplaySwiftLearnerExp", 1) != 0) {
dlog("Applying Swift Learner exp display patch.", DL_INIT);
MakeCall(0x4AFAEF, statPCAddExperienceCheckPMs_hack);
HookCall(0x4221E2, combat_give_exps_hook);
MakeJump(0x4745AE, loot_container_exp_hack);
SafeWrite16(0x4C0AB1, 0x23EB); // jmps 0x4C0AD6
HookCall(0x4C0AEB, wmRndEncounterOccurred_hook);
dlogr(" Done", DL_INIT);
}
}
}
+8 -8
View File
@@ -45,14 +45,14 @@ static bool calledflag = false;
static DWORD called_quest_number = 0;
static DWORD total_quests_pages = 0;
static DWORD curent_quest_page = 0;
static DWORD look_quests = 0; // current check quest
static DWORD look_quests = 0; // check current quests
static DWORD first_quest_page = 0;
static DWORD last_quest_page = MAXINT;
static std::vector<int> pageQuest;
// Fixes a crash when the quest list is overfull
// Fix crash when the quest list is too long
static void __declspec(naked) PipStatus_hook_printfix() {
__asm {
test outRangeFlag, 0xFF;
@@ -81,7 +81,7 @@ force:
// ------------------------------------
// Add an unused bit for an additional text offset 60 pixels to the right
// maybe it might be needed outside the function to display the pages of the quest list
// it might be needed outside of the function to display quest list pages
static void __declspec(naked) pip_print_hack() {
__asm {
test bh, 1;
@@ -109,10 +109,10 @@ static void ResetPageValues() {
last_quest_page = MAXINT;
}
// Event of entering the list of quests and keystrokes up/down
// Event of entering the quest list and up/down keystrokes
static void __declspec(naked) pipboy_hack_press0() {
__asm {
// fixed vanilla bug, preventing display the listing of quests from other locations when clicking on the pipboy screen
// fixed vanilla bug, preventing displaying the quest list of other locations when clicking on the pipboy screen
test InQuestsList, 0xFF;
jz skip;
test buttonsPressed, 0xFF;
@@ -173,7 +173,7 @@ skip:
static void AddPage(int lines) {
total_quests_pages++;
pageQuest.push_back(look_quests); // add to array the quest number at top of page
pageQuest.push_back(look_quests); // add the quest number to array at top of page
fo::var::cursor_line = 3 + lines; // reset current line to beginning, and add text lines
outRangeFlag = true;
}
@@ -445,7 +445,7 @@ static void __declspec(naked) StartPipboy_hack() {
}
}
// Resets states on close pipboy
// Reset states when closing pipboy
static void __declspec(naked) pipboy_hook() {
__asm {
call fo::funcoffs::EndPipboy_;
@@ -497,7 +497,7 @@ void QuestList::init() {
dlogr(" Done", DL_INIT);
} else {
HookCall(0x498186, PipStatus_hook_printfix); //fix 'out-of-range' bug when printing a list of quests
HookCall(0x498186, PipStatus_hook_printfix); // fix "out of range" bug when printing a list of quests
}
}