HomeWildfire Games

Unify gamesetup option handling, fixes #3994, refs #3049.


Unify gamesetup option handling, fixes #3994, refs #3049.

Removes a lot of duplication and ugly GUI handling code with very similar, yet different code paths.
Move the setting specific logic to the functions of that setting and keep the universal logic in global atomic functions.
Make gamesetup.xml agnostic of all gamesetup settings.

Adding a new gamesetup option now only requires adding one hunk with the titles and values and one line in g_OptionOrderGUI.
Opens up the possibility to iterate over all settings, refs #3806, #3883.

Allow starting singleplayer games in observermode with only AIs assigned, fixes #4078.
Autocomplete translations of all setting titles and selected title values like playernames and victory conditions.

Transfer the AI difficulty when swapping with a player.
Move logic from onTick to the GUI handling functions.
Change some global consts to var, so that contributors become invited to change them from a different place.
Add missing startGameButton tooltip translation.

Differential Revision: https://code.wildfiregames.com/D322
Reviewed By: wraitii
Some strings reviewed By: leper


elexisMay 2 2017, 10:57 PM
Differential Revision
D322: Gamesetup Option Unification
rP19503: Bump year number of files changed this year in the license headers.
Build Status
Buildable 1401
Build 2205: Post-Commit BuildJenkins

Event Timeline

mimo raised a concern with this commit.May 4 2017, 8:45 PM
mimo added a subscriber: mimo.
mimo added inline comments.

not a good practise to have affectation in the return statement. I think it was only overlooked as all other occurences of such affectations are (rightly) put inside brackets.

This commit now has outstanding concerns.May 4 2017, 8:45 PM
Imarok raised a concern with this commit.EditedMay 5 2017, 11:46 PM
Imarok added a subscriber: Imarok.

host game -> join with client -> client presses on I'm ready -> host changes setting -> button of client still has the label "Stay ready"(should be "I'm ready")
Also the "gamesettings have changed" message doesn't appear for the client

Imarok accepted this commit.May 15 2017, 9:27 PM

Both issues fixed.

elexis requested verification of this commit.May 18 2017, 12:04 AM

Pair of braces in rP19542. Readystate in rP19586, persistmatchsettings+player+AI in same slot in rP19602

This commit now requires verification by auditors.May 18 2017, 12:04 AM
elexis removed an auditor: mimo.May 19 2017, 10:23 AM
All concerns with this commit have now been addressed.May 19 2017, 10:23 AM