Page MenuHomeWildfire Games

Finish session menu.js OOP rewrite
ClosedPublic

Authored by elexis on Oct 18 2019, 3:56 PM.

Details

Summary

In the course of #5387, this patch changes the menu button code to use object orientation and thus removes the last remains of menu.js that weren't OOP.

  • It removes the **duplication and hardcoding of XML*, similar to rP22854 / D2240 and allows modders to insert a button by adding a single class.
  • Tooltips for menu buttons that can be triggered with hotkeys was added.
  • Small performance improvement, subscribing the onTick function only while animating the menu. As discovered by nani few days ago, the event handler currently can't be deleted due to the JSClass not having the deleter function (broken since ever).
Test Plan

Test that all hotkeys trigger correctly, that all buttons show a tooltip advertizing them.
Test that all button press events work correctly, pause the game and resume, but only in singleplayer mode.
Compare the menu layout with the previous layout and notice no pixels changed.
Test deleting with and without the hotkey pressed.
Test the civ icon hotkeys.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

elexis created this revision.Oct 18 2019, 3:56 PM
elexis updated the Trac tickets for this revision.Oct 18 2019, 3:56 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/984/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/469/display/redirect

This revision was not accepted when it landed; it landed in state Needs Review.Oct 18 2019, 4:12 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Owners added a subscriber: Restricted Owners Package.Oct 18 2019, 4:12 PM