HomeWildfire Games

Unify loadgame and savegame dialog following rP13579, refs #2030.

Description

Unify loadgame and savegame dialog following rP13579, refs #2030.

This way the save dialog gains the sortable list and details section feature from rP19351 / D246 by removing a folder of code, refs #4413.
Fixes a style warning about the old dialog using a style for an 'olist' type for a 'list' type, refs rP22792 / D2232.

Subsequently move the gui/common/ helper file to the page code, meaning it's not loaded for every GUI page needlessly anymore.
Fix map preview aspect ratio.
Use object-oriented code for the moved savegame code, refs #5387, but conserve the rest of the code to limit the changes for auditability.

Differential Revision: https://code.wildfiregames.com/D2290
Tested on: Jenkins

Details

Event Timeline

elexis added inline comments.Sep 19 2019, 4:30 AM
/ps/trunk/binaries/data/mods/public/gui/loadgame/SavegameWriter.js
18

unused following Hack removal in rP22922, see https://code.wildfiregames.com/D2290?id=9762

/ps/trunk/binaries/data/mods/public/gui/loadgame/functions_utility_loadsave.js
70

Concern:

Refers to session.savedgames.delete, session.savedgames.noconfirmation, stored in functions_utility_loadsave.js.
Looks like a savegame function, acts like a savegame function. Is not a savegame function, but was a function used by savegame and replaymenu.

So it broke the replay menu.

Further camouflaging is seen in the string not speaking about savegames but "entries".
The fix (duplication) will allow use of more specialized strings.

Will transform the rest of this folder into OOP while at it.

/ps/trunk/binaries/data/mods/public/gui/loadgame/load.xml
48

saveGame() must be g_SavegameWriter.saveGame()

Notice that we get a reference error when we have onPress = saveGame in JS, but we don't have this if it is specified in XML!!!
That by itself is sufficient reason to not specify JS in XML.

/ps/trunk/binaries/data/mods/public/gui/savegame/save.js
1

all files deleted, empty folder remaining.