HomeWildfire Games

Rewrite Main Menu.
AuditedrP22854

Description

Rewrite Main Menu.

Specify menu and submenu buttons title, tooltip, hotkey and actions comfortably in an extensible JS object and derive the GUI object settings based on that rather than relying on complex markup alternating with JS in the same file.
Automatically compute the position and number of submenu items instead of letting the author manually compute and keep that in sync in various places of the XML file.

Use object oriented programming, so that there is a strong separation of concerns, allowing the readers and authors to only involve themselves with the component relevant to the feature they work on, refs #5387.
Use class keyword instead of prototype keyword for the JS classes, because that enforces a policy where no globals are inserted between class members and informs the reader of that as soon as reading the classes first line, anticipating fragmentation.

Group project information and community links in a more clearly arranged JS file.
Keep and document splashscreen onTick hack from rP13597, #2042, #5578.
String change: Inform instead of warn (deter) about the state of the game in the main menu.
Depends on Engine.SetGlobalHotkey from D2260.

Differential Revision: https://code.wildfiregames.com/D2240
Class syntax comments by: Krinkle, bb, Chakakhan, smiley, nani, fpre
Main menu comments by: Krinkle, nani, Stan (and Imarok in D820)

Event Timeline

Freagarach raised a concern with this commit.Nov 24 2019, 12:18 PM
Freagarach added a subscriber: Freagarach.
Freagarach added inline comments.
/ps/trunk/binaries/data/mods/public/gui/pregame/MainMenuItems.js
46

Click here to start a new single player game. (MainMenu.xml L153; Fix can be included in D2428.)

This commit now has outstanding concerns.Nov 24 2019, 12:18 PM
elexis requested verification of this commit.Jan 10 2020, 8:25 PM

Reported concern fixed in rP23360.

(Standard disclaimer: "Requesting Verification" and a green checkmark is ambiguous, tbecause he green checkmark indicates (or doesn't clearly distinguishes from) that the patch is good. But if noone reviewed/audited or "verified" the entire patch, the statement is inaccurate rP23360. So requesting auditor removal or green checkmark if the patch was audited, though I won't oppose an ambiguous green checkmark for this patch.)

This commit now requires verification by auditors.Jan 10 2020, 8:25 PM
Freagarach accepted this commit.Jan 10 2020, 8:36 PM

My concern of the main menu tooltip has been fixed.

(Even when a full audit of the patch was done there might still be oversights, thus making it impossible to ever award the "green" checkmark, hence I award it because the (currently known to me) issue is fixed.)

All concerns with this commit have now been addressed.Jan 10 2020, 8:36 PM