Opened 8 years ago

Closed 8 years ago

#3680 closed enhancement (fixed)

Gamesetup cleanup

Reported by: elexis Owned by:
Priority: Should Have Milestone: Alpha 20
Component: UI & Simulation Keywords:
Cc: Patch:

Description

The current gamesetup needs a lot of cleanup. Commits which simplify the code and update the syntax without significantly changing the logic can be referenced to this ticket.

Refs #3049 #3355

Change History (5)

comment:1 by elexis, 8 years ago

In 17376:

Gamesetup cleanup. Refs #3680

Remove a broken implementation of default maps.
Remove some unneeded comments.

comment:2 by elexis, 8 years ago

In 17377:

Gamesetup cleanup. Refs #3680

Simplify mapfilter code and mark g_CivData as const.

comment:3 by elexis, 8 years ago

In 17378:

Simplify civ info (main menu -> learn how to play -> history).
Add JSDoc comments.
Refs #3680 a bit.

comment:4 by elexis, 8 years ago

In 17381:

Gamesetup cleanup. Refs #3680.

Don't even load non-playable civs in the gamesetup and add sanity checks to sanitizePlayerData() and loadCivData() so that we can remove later checks.
Remove some blatantly wrong code from launchGame().
Move hardcoded romanNumbers to a global.

comment:5 by elexis, 8 years ago

Milestone: BacklogAlpha 20
Resolution: fixed
Status: newclosed
Summary: Gamesetup coding conventionsGamesetup cleanup

See the last 53 revisions of gamesetup.js (<= r17554).

The code is mostly readable now. Still full of edge-cases and inconsitencies that hide many bugs.

Ideally gamesetup should use the model-view-controller pattern. (One file to update the gamesettings, one file to manage the GUI objects and one file to allow the controller(s) to change the settings from the GUI). This would also solve the persist-match-settings problem.

In order to remove those inconsistencies, it would be good to have one object that holds all GUI object settings, so that all dropdowns and checkboxes work identically (see r17499 in particular).

Note: See TracTickets for help on using tickets.