Changed AutoQuickSave to use the current selected page if AutoQuickSavePage is disabled.

This commit is contained in:
NovaRain
2018-12-05 13:35:37 +08:00
parent 4249006ba9
commit cedfce37be
2 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -421,7 +421,7 @@ ExtraSaveSlots=0
;AutoQuickSave sets how many save slots on a page you want to use for quick saving (valid range: 1..10) ;AutoQuickSave sets how many save slots on a page you want to use for quick saving (valid range: 1..10)
;AutoQuickSavePage is the page number to use (valid range: 1..1000) if ExtraSaveSlots is enabled ;AutoQuickSavePage is the page number to use (valid range: 1..1000) if ExtraSaveSlots is enabled
;The quick saves will be rotated from the first slot on the page to the n-th slot ;The quick saves will be rotated from the first slot on the page to the n-th slot
;Set to 0 to disable. AutoQuickSave will use page 1 if AutoQuickSavePage is disabled ;Set to 0 to disable. AutoQuickSave will use the current selected page if AutoQuickSavePage is disabled
AutoQuickSave=0 AutoQuickSave=0
AutoQuickSavePage=0 AutoQuickSavePage=0
+11 -11
View File
@@ -419,7 +419,7 @@ static void CreateSaveComment(char* bufstr) {
} }
static DWORD autoQuickSave = 0; static DWORD autoQuickSave = 0;
static DWORD quickSavePage = 0; static long quickSavePage = 0;
static FILETIME ftPrevSlot; static FILETIME ftPrevSlot;
static DWORD __stdcall QuickSaveGame(fo::DbFile* file, char* filename) { static DWORD __stdcall QuickSaveGame(fo::DbFile* file, char* filename) {
@@ -433,7 +433,7 @@ static DWORD __stdcall QuickSaveGame(fo::DbFile* file, char* filename) {
|| (ftCurrSlot.dwHighDateTime == ftPrevSlot.dwHighDateTime && ftCurrSlot.dwLowDateTime > ftPrevSlot.dwLowDateTime)) { || (ftCurrSlot.dwHighDateTime == ftPrevSlot.dwHighDateTime && ftCurrSlot.dwLowDateTime > ftPrevSlot.dwLowDateTime)) {
ftPrevSlot.dwHighDateTime = ftCurrSlot.dwHighDateTime; ftPrevSlot.dwHighDateTime = ftCurrSlot.dwHighDateTime;
ftPrevSlot.dwLowDateTime = ftCurrSlot.dwLowDateTime; ftPrevSlot.dwLowDateTime = ftCurrSlot.dwLowDateTime;
if (++currSlot > 9 || currSlot > autoQuickSave) { if (++currSlot > autoQuickSave) {
currSlot = 0; currSlot = 0;
} else { } else {
fo::var::slot_cursor = currSlot; fo::var::slot_cursor = currSlot;
@@ -481,20 +481,20 @@ void ExtraSaveSlots::init() {
} }
autoQuickSave = GetConfigInt("Misc", "AutoQuickSave", 0); autoQuickSave = GetConfigInt("Misc", "AutoQuickSave", 0);
quickSavePage = GetConfigInt("Misc", "AutoQuickSavePage", 0); if (autoQuickSave > 0) {
if (autoQuickSave >= 1 && autoQuickSave <= 10) {
dlog("Applying auto quick save patch.", DL_INIT); dlog("Applying auto quick save patch.", DL_INIT);
autoQuickSave--; if (autoQuickSave > 10) autoQuickSave = 10;
if (quickSavePage > 0) { autoQuickSave--; // reserved slot count
if (quickSavePage > 1000) quickSavePage = 1000;
quickSavePage = (quickSavePage - 1) * 10;
}
if (extraSaveSlots) { quickSavePage = GetConfigInt("Misc", "AutoQuickSavePage", 0);
if (quickSavePage > 1000) quickSavePage = 1000;
if (extraSaveSlots && quickSavePage > 0) {
quickSavePage = (quickSavePage - 1) * 10;
MakeCall(0x47B923, SaveGame_hack1, 1); MakeCall(0x47B923, SaveGame_hack1, 1);
} else { } else {
SafeWrite8(0x47B923, 0x89); SafeWrite8(0x47B923, 0x89);
SafeWrite32(0x47B924, 0x5193B83D); // mov [slot_cursor], edi(0) SafeWrite32(0x47B924, 0x5193B83D); // mov [slot_cursor], edi = 0
} }
MakeJump(0x47B984, SaveGame_hack0); MakeJump(0x47B984, SaveGame_hack0);
dlogr(" Done", DL_INIT); dlogr(" Done", DL_INIT);