From 02bdbf2ed7dc81796b1876021e1ddd92643ea4b2 Mon Sep 17 00:00:00 2001 From: Wanne Date: Fri, 27 Dec 2013 08:05:51 +0000 Subject: [PATCH] - Bugfix: SaveLoad-Dialog does not automatically jump to the correct page, when trying to load the last savegame (by Sionus) o Before patch: openned first page, none saved game slot selected. o Now: openned page with last save game, slot with last saved game selected. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6711 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- SaveLoadScreen.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/SaveLoadScreen.cpp b/SaveLoadScreen.cpp index 444a4e25..82a3226e 100644 --- a/SaveLoadScreen.cpp +++ b/SaveLoadScreen.cpp @@ -562,7 +562,7 @@ BOOLEAN NewEnterSaveLoadScreen() //if it is not the Quick Save slot, and we are loading if( !gfSaveGame || gfSaveGame && gGameSettings.bLastSavedGameSlot != 0 ) { - gbSelectedSaveLocation = gGameSettings.bLastSavedGameSlot; + gbSelectedSaveLocation = gGameSettings.bLastSavedGameSlot%NUM_SLOT; gbSaveGameSelectedLocation[ gbSelectedSaveLocation ] = SLG_SELECTED_SLOT_GRAPHICS_NUMBER; //load the save gamed header string @@ -848,6 +848,22 @@ BOOLEAN EnterSaveLoadScreen() gfGettingNameFromSaveLoadScreen = FALSE; + //Go to page with last saved game + if ( gGameSettings.bLastSavedGameSlot >= NUM_SLOT) + { + PAGE_SLOT = gGameSettings.bLastSavedGameSlot/NUM_SLOT; + VAL_SLOT_START = (PAGE_SLOT * NUM_SLOT); + + if ( PAGE_SLOT > 0 ) + EnableButton( guiPrevButton ); + + if (PAGE_SLOT == MAX_PAGE_SLOT || PAGE_SLOT > MAX_PAGE_SLOT ) + DisableButton( guiNextButton ); + + DestroySaveLoadTextInputBoxes(); + NewEnterSaveLoadScreen(); + } + return( TRUE ); }