Page MenuHomeWildfire Games

Absorb duplicated summary tab code to the tab_buttons gui
ClosedPublic

Authored by bb on Jan 7 2018, 5:59 PM.

Details

Summary

The summary screen handles tabs in a strange way, which seems inefficient and duplicative. So rewriting that to use the tab_buttons objects. For this the tab/-buttons code is extended to allow horizontally aligning the tabs.

refs rP20644/rP20684

Test Plan

Notice duplication is gone,
yell for hiding magical values,
maybe yell for some jsDocs,
make sure panel/chart remember still works, and the front doesn't fall

Event Timeline

bb created this revision.Jan 7 2018, 5:59 PM
Owners added a subscriber: Restricted Owners Package.Jan 7 2018, 5:59 PM
bb updated this revision to Diff 5165.Jan 7 2018, 6:00 PM
elexis added a subscriber: elexis.Jan 7 2018, 6:17 PM
elexis added inline comments.
binaries/data/mods/public/gui/common/tab_buttons.js
9

g_Tab prefix, the variable name sounds like it's very easy to get a naming conflict with some other global.
(Soon there might be sufficient variables to hide them behind a prototype)

92–98

Don't split strings that are filenames, people should be able to search for them

Vulcan added a subscriber: Vulcan.Jan 7 2018, 7:45 PM

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

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
Vulcan added a comment.Jan 7 2018, 8:53 PM
Executing section Default...
Executing section Source...
Executing section JS...

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

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
Executing section Default...
Executing section Source...
Executing section JS...
bb updated this revision to Diff 5200.Jan 9 2018, 11:07 PM
bb marked 2 inline comments as done.
bb added inline comments.
binaries/data/mods/public/gui/common/tab_buttons.js
9

ffs

92–98

sad we need more code now...

Executing section Default...
Executing section Source...
Executing section JS...

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

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
Stan added a subscriber: Stan.Sep 5 2019, 1:57 PM
Stan added inline comments.
binaries/data/mods/public/gui/common/tab_buttons.js
25–27

https://jsdoc.app/tags-type.html I believe it should be boolean :)

binaries/data/mods/public/gui/summary/layout.js
228

Jsdoc ?

bb updated this revision to Diff 11863.May 14 2020, 5:25 PM
bb marked 2 inline comments as done.

rebase

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

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

bb updated this revision to Diff 11864.May 14 2020, 5:28 PM

jsdoc

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

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

Freagarach requested changes to this revision.May 14 2020, 5:56 PM
Freagarach added a subscriber: Freagarach.

ERROR: GL error GL_INVALID_VALUE (0x0501) occurred in the Single-Player Game Setup menu. (With buttons on the right-hand side not present.)

This revision now requires changes to proceed.May 14 2020, 5:56 PM
bb updated this revision to Diff 11867.May 14 2020, 11:21 PM

Fix GL error

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

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

Freagarach resigned from this revision.May 18 2020, 7:00 PM
Freagarach removed a reviewer: Freagarach.

(Black-box testing passes.)

bb updated this revision to Diff 12433.Jun 23 2020, 4:52 PM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 119| 119| 			sprintf(
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122|    |-				option.min !== undefined && option.max === undefined ?
|    | 122|+					option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123|    |-					translateWithContext("option number", "Min: %(min)s") :
|    | 123|+						translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124|    |-				option.min === undefined && option.max !== undefined ?
|    | 124|+						option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125|    |-					translateWithContext("option number", "Max: %(max)s") :
|    | 125|+							translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126|    |-					"",
|    | 126|+							"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
| 129| 129| 					"max": option.max

binaries/data/mods/public/gui/options/options.js
| 240| »   »   »   let·value·=·optionType.guiToValue(control);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'value' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 450| 450| 	Engine.GetGUIObjectByName("summaryText").caption =
| 451| 451| 		g_GameData.gui.isInGame ?
| 452| 452| 			translate("Current Scores") :
| 453|    |-		g_GameData.gui.isReplay ?
|    | 453|+			g_GameData.gui.isReplay ?
| 454| 454| 			translate("Scores at the end of the game.") :
| 455| 455| 		g_GameData.gui.disconnected ?
| 456| 456| 			translate("You have been disconnected.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 451| 451| 		g_GameData.gui.isInGame ?
| 452| 452| 			translate("Current Scores") :
| 453| 453| 		g_GameData.gui.isReplay ?
| 454|    |-			translate("Scores at the end of the game.") :
|    | 454|+				translate("Scores at the end of the game.") :
| 455| 455| 		g_GameData.gui.disconnected ?
| 456| 456| 			translate("You have been disconnected.") :
| 457| 457| 		!assignedState ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 452| 452| 			translate("Current Scores") :
| 453| 453| 		g_GameData.gui.isReplay ?
| 454| 454| 			translate("Scores at the end of the game.") :
| 455|    |-		g_GameData.gui.disconnected ?
|    | 455|+				g_GameData.gui.disconnected ?
| 456| 456| 			translate("You have been disconnected.") :
| 457| 457| 		!assignedState ?
| 458| 458| 			translate("You have left the game.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 453| 453| 		g_GameData.gui.isReplay ?
| 454| 454| 			translate("Scores at the end of the game.") :
| 455| 455| 		g_GameData.gui.disconnected ?
| 456|    |-			translate("You have been disconnected.") :
|    | 456|+					translate("You have been disconnected.") :
| 457| 457| 		!assignedState ?
| 458| 458| 			translate("You have left the game.") :
| 459| 459| 		assignedState.state == "won" ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 454| 454| 			translate("Scores at the end of the game.") :
| 455| 455| 		g_GameData.gui.disconnected ?
| 456| 456| 			translate("You have been disconnected.") :
| 457|    |-		!assignedState ?
|    | 457|+					!assignedState ?
| 458| 458| 			translate("You have left the game.") :
| 459| 459| 		assignedState.state == "won" ?
| 460| 460| 			translate("You have won the battle!") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 455| 455| 		g_GameData.gui.disconnected ?
| 456| 456| 			translate("You have been disconnected.") :
| 457| 457| 		!assignedState ?
| 458|    |-			translate("You have left the game.") :
|    | 458|+						translate("You have left the game.") :
| 459| 459| 		assignedState.state == "won" ?
| 460| 460| 			translate("You have won the battle!") :
| 461| 461| 		assignedState.state == "defeated" ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 456| 456| 			translate("You have been disconnected.") :
| 457| 457| 		!assignedState ?
| 458| 458| 			translate("You have left the game.") :
| 459|    |-		assignedState.state == "won" ?
|    | 459|+						assignedState.state == "won" ?
| 460| 460| 			translate("You have won the battle!") :
| 461| 461| 		assignedState.state == "defeated" ?
| 462| 462| 			translate("You have been defeated…") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 457| 457| 		!assignedState ?
| 458| 458| 			translate("You have left the game.") :
| 459| 459| 		assignedState.state == "won" ?
| 460|    |-			translate("You have won the battle!") :
|    | 460|+							translate("You have won the battle!") :
| 461| 461| 		assignedState.state == "defeated" ?
| 462| 462| 			translate("You have been defeated…") :
| 463| 463| 			translate("You have abandoned the game.");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 458| 458| 			translate("You have left the game.") :
| 459| 459| 		assignedState.state == "won" ?
| 460| 460| 			translate("You have won the battle!") :
| 461|    |-		assignedState.state == "defeated" ?
|    | 461|+							assignedState.state == "defeated" ?
| 462| 462| 			translate("You have been defeated…") :
| 463| 463| 			translate("You have abandoned the game.");
| 464| 464| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 459| 459| 		assignedState.state == "won" ?
| 460| 460| 			translate("You have won the battle!") :
| 461| 461| 		assignedState.state == "defeated" ?
| 462|    |-			translate("You have been defeated…") :
|    | 462|+								translate("You have been defeated…") :
| 463| 463| 			translate("You have abandoned the game.");
| 464| 464| 
| 465| 465| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 460| 460| 			translate("You have won the battle!") :
| 461| 461| 		assignedState.state == "defeated" ?
| 462| 462| 			translate("You have been defeated…") :
| 463|    |-			translate("You have abandoned the game.");
|    | 463|+								translate("You have abandoned the game.");
| 464| 464| 
| 465| 465| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
| 466| 466| 		translate("Game time elapsed: %(time)s"), {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 465| 465| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
| 466| 466| 		translate("Game time elapsed: %(time)s"), {
| 467| 467| 			"time": timeToString(g_GameData.sim.timeElapsed)
| 468|    |-	});
|    | 468|+		});
| 469| 469| 
| 470| 470| 	let mapType = g_Settings.MapTypes.find(type => type.Name == g_GameData.sim.mapSettings.mapType);
| 471| 471| 	let mapSize = g_Settings.MapSizes.find(size => size.Tiles == g_GameData.sim.mapSettings.Size || 0);

binaries/data/mods/public/gui/summary/summary.js
| 498| ·»   »   allPanelsData[tab].tooltip·=
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/gui/summary/summary.js
| 499| ·»   »   »   sprintf(translate("Toggle·the·%(name)s·summary·tab."),·{·"name":·allPanelsData[tab].label·})·+
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/gui/summary/summary.js
| 500| ·»   »   »   colorizeHotkey("\n"·+·translate("Use·%(hotkey)s·to·move·a·summary·tab·right."),·"tab.next")·+
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.
Executing section cli...

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

bb updated this revision to Diff 12435.Jun 23 2020, 6:15 PM

Fix some spaces

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 119| 119| 			sprintf(
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122|    |-				option.min !== undefined && option.max === undefined ?
|    | 122|+					option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123|    |-					translateWithContext("option number", "Min: %(min)s") :
|    | 123|+						translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124|    |-				option.min === undefined && option.max !== undefined ?
|    | 124|+						option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125|    |-					translateWithContext("option number", "Max: %(max)s") :
|    | 125|+							translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126|    |-					"",
|    | 126|+							"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
| 129| 129| 					"max": option.max

binaries/data/mods/public/gui/options/options.js
| 240| »   »   »   let·value·=·optionType.guiToValue(control);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'value' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 450| 450| 	Engine.GetGUIObjectByName("summaryText").caption =
| 451| 451| 		g_GameData.gui.isInGame ?
| 452| 452| 			translate("Current Scores") :
| 453|    |-		g_GameData.gui.isReplay ?
|    | 453|+			g_GameData.gui.isReplay ?
| 454| 454| 			translate("Scores at the end of the game.") :
| 455| 455| 		g_GameData.gui.disconnected ?
| 456| 456| 			translate("You have been disconnected.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 451| 451| 		g_GameData.gui.isInGame ?
| 452| 452| 			translate("Current Scores") :
| 453| 453| 		g_GameData.gui.isReplay ?
| 454|    |-			translate("Scores at the end of the game.") :
|    | 454|+				translate("Scores at the end of the game.") :
| 455| 455| 		g_GameData.gui.disconnected ?
| 456| 456| 			translate("You have been disconnected.") :
| 457| 457| 		!assignedState ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 452| 452| 			translate("Current Scores") :
| 453| 453| 		g_GameData.gui.isReplay ?
| 454| 454| 			translate("Scores at the end of the game.") :
| 455|    |-		g_GameData.gui.disconnected ?
|    | 455|+				g_GameData.gui.disconnected ?
| 456| 456| 			translate("You have been disconnected.") :
| 457| 457| 		!assignedState ?
| 458| 458| 			translate("You have left the game.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 453| 453| 		g_GameData.gui.isReplay ?
| 454| 454| 			translate("Scores at the end of the game.") :
| 455| 455| 		g_GameData.gui.disconnected ?
| 456|    |-			translate("You have been disconnected.") :
|    | 456|+					translate("You have been disconnected.") :
| 457| 457| 		!assignedState ?
| 458| 458| 			translate("You have left the game.") :
| 459| 459| 		assignedState.state == "won" ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 454| 454| 			translate("Scores at the end of the game.") :
| 455| 455| 		g_GameData.gui.disconnected ?
| 456| 456| 			translate("You have been disconnected.") :
| 457|    |-		!assignedState ?
|    | 457|+					!assignedState ?
| 458| 458| 			translate("You have left the game.") :
| 459| 459| 		assignedState.state == "won" ?
| 460| 460| 			translate("You have won the battle!") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 455| 455| 		g_GameData.gui.disconnected ?
| 456| 456| 			translate("You have been disconnected.") :
| 457| 457| 		!assignedState ?
| 458|    |-			translate("You have left the game.") :
|    | 458|+						translate("You have left the game.") :
| 459| 459| 		assignedState.state == "won" ?
| 460| 460| 			translate("You have won the battle!") :
| 461| 461| 		assignedState.state == "defeated" ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 456| 456| 			translate("You have been disconnected.") :
| 457| 457| 		!assignedState ?
| 458| 458| 			translate("You have left the game.") :
| 459|    |-		assignedState.state == "won" ?
|    | 459|+						assignedState.state == "won" ?
| 460| 460| 			translate("You have won the battle!") :
| 461| 461| 		assignedState.state == "defeated" ?
| 462| 462| 			translate("You have been defeated…") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 457| 457| 		!assignedState ?
| 458| 458| 			translate("You have left the game.") :
| 459| 459| 		assignedState.state == "won" ?
| 460|    |-			translate("You have won the battle!") :
|    | 460|+							translate("You have won the battle!") :
| 461| 461| 		assignedState.state == "defeated" ?
| 462| 462| 			translate("You have been defeated…") :
| 463| 463| 			translate("You have abandoned the game.");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 458| 458| 			translate("You have left the game.") :
| 459| 459| 		assignedState.state == "won" ?
| 460| 460| 			translate("You have won the battle!") :
| 461|    |-		assignedState.state == "defeated" ?
|    | 461|+							assignedState.state == "defeated" ?
| 462| 462| 			translate("You have been defeated…") :
| 463| 463| 			translate("You have abandoned the game.");
| 464| 464| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 459| 459| 		assignedState.state == "won" ?
| 460| 460| 			translate("You have won the battle!") :
| 461| 461| 		assignedState.state == "defeated" ?
| 462|    |-			translate("You have been defeated…") :
|    | 462|+								translate("You have been defeated…") :
| 463| 463| 			translate("You have abandoned the game.");
| 464| 464| 
| 465| 465| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 460| 460| 			translate("You have won the battle!") :
| 461| 461| 		assignedState.state == "defeated" ?
| 462| 462| 			translate("You have been defeated…") :
| 463|    |-			translate("You have abandoned the game.");
|    | 463|+								translate("You have abandoned the game.");
| 464| 464| 
| 465| 465| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
| 466| 466| 		translate("Game time elapsed: %(time)s"), {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 465| 465| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
| 466| 466| 		translate("Game time elapsed: %(time)s"), {
| 467| 467| 			"time": timeToString(g_GameData.sim.timeElapsed)
| 468|    |-	});
|    | 468|+		});
| 469| 469| 
| 470| 470| 	let mapType = g_Settings.MapTypes.find(type => type.Name == g_GameData.sim.mapSettings.mapType);
| 471| 471| 	let mapSize = g_Settings.MapSizes.find(size => size.Tiles == g_GameData.sim.mapSettings.Size || 0);
Executing section cli...

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

Imarok accepted this revision.Jun 23 2020, 9:16 PM
Imarok added a subscriber: Imarok.

Looks very good.
Notice my two comments.

binaries/data/mods/public/gui/common/tab_buttons.js
7

Sounds grammatically weird.
What about Align the buttons horizontally or vertically.?

binaries/data/mods/public/gui/summary/summary.js
177

Hmm, doesn't this assume that the charts panel is always at last place?

This revision is now accepted and ready to land.Jun 23 2020, 9:16 PM
bb marked an inline comment as done.Jun 23 2020, 10:12 PM
bb added inline comments.
binaries/data/mods/public/gui/common/tab_buttons.js
7

Don't think it was too wrong, but your string is certainly good.

binaries/data/mods/public/gui/summary/summary.js
177

Adding a comment

501–502

newline

This revision was landed with ongoing or failed builds.Jun 23 2020, 10:15 PM
This revision was automatically updated to reflect the committed changes.
bb marked an inline comment as done.