Page MenuHomeWildfire Games

Use class semantics for the loading screen
ClosedPublic

Authored by elexis on Nov 12 2019, 4:33 PM.

Details

Summary

In the course of #5387, this patch splits the different logical pieces of the loading screen into individual classes to be extended in the future (for example D1730).

Style changes:

  • New user config option to display the loading screen description. This may be extended in the future to display more information, even to interested players. The alternative would be to delete the feature in JS and C++, but it seems useful.
  • Tip display receives functions that may be reused for D1730.
  • The tip coordinates were recomputed to be harmony with / comparable with the other size values.
  • One JS class and one GUI object XML file per page element with the filenames indicating the classname.
  • Use translation for the percent value format
Test Plan

default value

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.Nov 12 2019, 4:33 PM

Successful build - Chance fights ever on the side of the prudent.

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

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/loading/TipDisplay.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/loading/TipDisplay.js
|  29|  29| 			"stretched:" + this.ImagePath + tipFile + ".png";
|  30|  30| 
|  31|  31| 		let tipText = Engine.TranslateLines(Engine.ReadFile(
|  32|    |-				this.TextPath + tipFile + ".txt")).split("\n");
|    |  32|+			this.TextPath + tipFile + ".txt")).split("\n");
|  33|  33| 
|  34|  34| 		this.tipTitle.caption = tipText.shift();
|  35|  35| 
Executing section cli...

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

elexis edited the summary of this revision. (Show Details)Nov 12 2019, 4:39 PM
elexis added inline comments.Nov 12 2019, 4:50 PM
binaries/data/mods/public/gui/loading/loading.xml
22 ↗(On Diff #10310)

Loading files comes with a cost, but future developers should not insert new Quote or Title GUI objects in this files but in the child file to keep this file abstract. So if that new file isnt added in this commit, then we can, judging from the commits in this codebase assume that new GUI objects will be added in this page instead of the child page. Therefore the cost of introducing a file with minimal contents must be paid now with the benefit being that people dont break the pattern next time they touch the code.

This revision was not accepted when it landed; it landed in state Needs Review.Nov 12 2019, 4:54 PM
This revision was automatically updated to reflect the committed changes.
Owners added a subscriber: Restricted Owners Package.Nov 12 2019, 4:54 PM