From 22d27976037411c844fb055fea13d2a91c1d3089 Mon Sep 17 00:00:00 2001 From: Wanne Date: Sat, 16 Sep 2006 07:44:38 +0000 Subject: [PATCH] Auto save: Externalized the auto save feature (see GameSettings.cpp). No more need to create a file named "AutoSave.pls" in your JA2 root directory. But there is one bug in the game: The game always crashes after loading a "normal" savegame after an auto savegame was loaded. The error occurs, because the game tries to remove a mouse region that does not exists. I could not fix the bug, so I did not make an entry for auto save in the ja2_options.ini. Auto save is always false in the game, until this bug is fixed. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@526 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- GameSettings.cpp | 13 ++++++++++--- GameSettings.h | 2 ++ JA2.suo | Bin 100352 -> 102400 bytes SaveLoadScreen.cpp | 7 +++---- Tactical/Handle UI.cpp | 6 +++++- Utils/message.cpp | 14 +++++++------- 6 files changed, 27 insertions(+), 15 deletions(-) diff --git a/GameSettings.cpp b/GameSettings.cpp index 5fbbe525..6ab331ec 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -467,10 +467,17 @@ void LoadGameExternalOptions() // WANNE: Drop Items gGameExternalOptions.ubEnemiesItemDrop = iniReader.ReadInteger("JA2 Gameplay Settings","ENEMIES_ITEM_DROP", 0); + // WANNE: Auto save: I did not set USE_AUTO_SAVE in the ja2_options.ini, because + // the game always crashes after a "normal" savegame is loaded after loading an autosave + // So for now USE_AUTO_SAVE is always false. + // The game crashes when removing mouse region that are not set + // After we fix that bug, we can make the entry USE_AUTO_SAVE in the ja2_options.ini + gGameExternalOptions.gfUseAutoSave = iniReader.ReadBoolean("JA2 Gameplay Settings","USE_AUTO_SAVE",FALSE); + // Militia settings - gGameExternalOptions.gfAllowMilitiaGroups = iniReader.ReadBoolean("JA2 Gameplay Settings","ALLOW_MILITIA_MOBILE_GROUPS",0); - gGameExternalOptions.gfAllowReinforcements = iniReader.ReadBoolean("JA2 Gameplay Settings","ALLOW_REINFORCEMENTS",0); - gGameExternalOptions.gfAllowReinforcementsOnlyInCity = iniReader.ReadBoolean("JA2 Gameplay Settings","ALLOW_REINFORCEMENTS_ONLY_IN_CITIES",0); + gGameExternalOptions.gfAllowMilitiaGroups = iniReader.ReadBoolean("JA2 Gameplay Settings","ALLOW_MILITIA_MOBILE_GROUPS",FALSE); + gGameExternalOptions.gfAllowReinforcements = iniReader.ReadBoolean("JA2 Gameplay Settings","ALLOW_REINFORCEMENTS",FALSE); + gGameExternalOptions.gfAllowReinforcementsOnlyInCity = iniReader.ReadBoolean("JA2 Gameplay Settings","ALLOW_REINFORCEMENTS_ONLY_IN_CITIES",FALSE); gGameExternalOptions.guiBaseQueenPoolIncrement = iniReader.ReadInteger("JA2 Gameplay Settings","QUEEN_POOL_INCREMENT_PER_DIFFICULTY_LEVEL",60); gGameExternalOptions.guiCreateEachNHours = iniReader.ReadInteger("JA2 Gameplay Settings","CREATE_EACH_N_HOURS",24); diff --git a/GameSettings.h b/GameSettings.h index b4a46bf2..65c96224 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -309,6 +309,8 @@ typedef struct // WANNE INT32 ubEnemiesItemDrop; + BOOLEAN gfUseAutoSave; + //Merc Assignment settings INT32 ubAssignmentUnitsPerDay; INT32 ubMinutesForAssignmentToCount; diff --git a/JA2.suo b/JA2.suo index 1e3ba24dd8af935395e5f623c43a6cf5e827935f..116de0a15e0c94aa2a6e5b94d25af7acff975309 100644 GIT binary patch delta 1741 zcmcJPUrbw79LImZ+e=$mxfEJxVViEt!sqcEnUE&LJG{^X0T;iL$fH#pnEp86ni!qw`pbty-WMY;WqEUlN{hnJkz&}eg*=;`e zob&sg{?6~;x%p{({$2ZQS~sS5kox$uVNYN;bQHD-od>XqAkTr|W&oq&)=$dg&XdxDpt_#|w^X9V4$u1i) zV~_O+!>B7?!18OLi)zCoBF0%gSVtsY7PaClW4AY`EDqqrahyJeH&IY*ukv>XU6`JL za1_qHq{KCN9mh`P=P2F@C?Hk_VsLxZGLTgwbGT|+w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