Page MenuHomeWildfire Games

Show summary graphs for teams
Needs ReviewPublic

Authored by Imarok on May 12 2019, 1:10 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Trac Tickets
#4552
Summary

Adds a button to toggle between the summary charts of every individual player and the ones of the teams.

Test Plan

Agree on the look, the GUI, the functionality and the code.

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 7504
Build 12228: Vulcan BuildJenkins
Build 12227: arc lint + arc unit

Event Timeline

Imarok created this revision.May 12 2019, 1:10 AM

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 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 250| 250| 	chartLegend.caption = g_ShowTeamCharts ?
| 251| 251| 		g_Teams.filter(el => el !== null).map(
| 252| 252| 			players => coloredText("■", playerColors[players[0] - 1]) + " " + players.map(player =>
| 253|    |-					g_GameData.sim.playerStates[player].name
|    | 253|+				g_GameData.sim.playerStates[player].name
| 254| 254| 				).join(translateWithContext("Player listing", ", "))
| 255| 255| 		).join("   ") :
| 256| 256| 		g_GameData.sim.playerStates.slice(1).map(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 251| 251| 		g_Teams.filter(el => el !== null).map(
| 252| 252| 			players => coloredText("■", playerColors[players[0] - 1]) + " " + players.map(player =>
| 253| 253| 					g_GameData.sim.playerStates[player].name
| 254|    |-				).join(translateWithContext("Player listing", ", "))
|    | 254|+			).join(translateWithContext("Player listing", ", "))
| 255| 255| 		).join("   ") :
| 256| 256| 		g_GameData.sim.playerStates.slice(1).map(
| 257| 257| 			(state, index) => coloredText("■", playerColors[index]) + " " + state.name
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 360| 360| 
| 361| 361| 	let series = [];
| 362| 362| 	if (g_ShowTeamCharts)
| 363|    |-	{
|    | 363|+	
| 364| 364| 		for (let team in g_Teams)
| 365| 365| 		{
| 366| 366| 			let data = [];
| 374| 374| 			}
| 375| 375| 			series.push(data);
| 376| 376| 		}
| 377|    |-	}
|    | 377|+	
| 378| 378| 	else
| 379| 379| 	{
| 380| 380| 		for (let j = 1; j <= g_PlayerCount; ++j)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 376| 376| 		}
| 377| 377| 	}
| 378| 378| 	else
| 379|    |-	{
|    | 379|+	
| 380| 380| 		for (let j = 1; j <= g_PlayerCount; ++j)
| 381| 381| 		{
| 382| 382| 			let playerState = g_GameData.sim.playerStates[j];
| 390| 390| 			}
| 391| 391| 			series.push(data);
| 392| 392| 		}
| 393|    |-	}
|    | 393|+	
| 394| 394| 
| 395| 395| 	chart.series = series;
| 396| 396| }
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 534| 534| 	Engine.GetGUIObjectByName("summaryText").caption =
| 535| 535| 		g_GameData.gui.isInGame ?
| 536| 536| 			translate("Current Scores") :
| 537|    |-		g_GameData.gui.isReplay ?
|    | 537|+			g_GameData.gui.isReplay ?
| 538| 538| 			translate("Scores at the end of the game.") :
| 539| 539| 		g_GameData.gui.disconnected ?
| 540| 540| 			translate("You have been disconnected.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 535| 535| 		g_GameData.gui.isInGame ?
| 536| 536| 			translate("Current Scores") :
| 537| 537| 		g_GameData.gui.isReplay ?
| 538|    |-			translate("Scores at the end of the game.") :
|    | 538|+				translate("Scores at the end of the game.") :
| 539| 539| 		g_GameData.gui.disconnected ?
| 540| 540| 			translate("You have been disconnected.") :
| 541| 541| 		!assignedState ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 536| 536| 			translate("Current Scores") :
| 537| 537| 		g_GameData.gui.isReplay ?
| 538| 538| 			translate("Scores at the end of the game.") :
| 539|    |-		g_GameData.gui.disconnected ?
|    | 539|+				g_GameData.gui.disconnected ?
| 540| 540| 			translate("You have been disconnected.") :
| 541| 541| 		!assignedState ?
| 542| 542| 			translate("You have left the game.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 537| 537| 		g_GameData.gui.isReplay ?
| 538| 538| 			translate("Scores at the end of the game.") :
| 539| 539| 		g_GameData.gui.disconnected ?
| 540|    |-			translate("You have been disconnected.") :
|    | 540|+					translate("You have been disconnected.") :
| 541| 541| 		!assignedState ?
| 542| 542| 			translate("You have left the game.") :
| 543| 543| 		assignedState.state == "won" ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 538| 538| 			translate("Scores at the end of the game.") :
| 539| 539| 		g_GameData.gui.disconnected ?
| 540| 540| 			translate("You have been disconnected.") :
| 541|    |-		!assignedState ?
|    | 541|+					!assignedState ?
| 542| 542| 			translate("You have left the game.") :
| 543| 543| 		assignedState.state == "won" ?
| 544| 544| 			translate("You have won the battle!") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 539| 539| 		g_GameData.gui.disconnected ?
| 540| 540| 			translate("You have been disconnected.") :
| 541| 541| 		!assignedState ?
| 542|    |-			translate("You have left the game.") :
|    | 542|+						translate("You have left the game.") :
| 543| 543| 		assignedState.state == "won" ?
| 544| 544| 			translate("You have won the battle!") :
| 545| 545| 		assignedState.state == "defeated" ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 540| 540| 			translate("You have been disconnected.") :
| 541| 541| 		!assignedState ?
| 542| 542| 			translate("You have left the game.") :
| 543|    |-		assignedState.state == "won" ?
|    | 543|+						assignedState.state == "won" ?
| 544| 544| 			translate("You have won the battle!") :
| 545| 545| 		assignedState.state == "defeated" ?
| 546| 546| 			translate("You have been defeated…") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 541| 541| 		!assignedState ?
| 542| 542| 			translate("You have left the game.") :
| 543| 543| 		assignedState.state == "won" ?
| 544|    |-			translate("You have won the battle!") :
|    | 544|+							translate("You have won the battle!") :
| 545| 545| 		assignedState.state == "defeated" ?
| 546| 546| 			translate("You have been defeated…") :
| 547| 547| 			translate("You have abandoned the game.");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 542| 542| 			translate("You have left the game.") :
| 543| 543| 		assignedState.state == "won" ?
| 544| 544| 			translate("You have won the battle!") :
| 545|    |-		assignedState.state == "defeated" ?
|    | 545|+							assignedState.state == "defeated" ?
| 546| 546| 			translate("You have been defeated…") :
| 547| 547| 			translate("You have abandoned the game.");
| 548| 548| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 543| 543| 		assignedState.state == "won" ?
| 544| 544| 			translate("You have won the battle!") :
| 545| 545| 		assignedState.state == "defeated" ?
| 546|    |-			translate("You have been defeated…") :
|    | 546|+								translate("You have been defeated…") :
| 547| 547| 			translate("You have abandoned the game.");
| 548| 548| 
| 549| 549| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 544| 544| 			translate("You have won the battle!") :
| 545| 545| 		assignedState.state == "defeated" ?
| 546| 546| 			translate("You have been defeated…") :
| 547|    |-			translate("You have abandoned the game.");
|    | 547|+								translate("You have abandoned the game.");
| 548| 548| 
| 549| 549| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
| 550| 550| 		translate("Game time elapsed: %(time)s"), {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 549| 549| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
| 550| 550| 		translate("Game time elapsed: %(time)s"), {
| 551| 551| 			"time": timeToString(g_GameData.sim.timeElapsed)
| 552|    |-	});
|    | 552|+		});
| 553| 553| 
| 554| 554| 	let mapType = g_Settings.MapTypes.find(type => type.Name == g_GameData.sim.mapSettings.mapType);
| 555| 555| 	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/differential/1370/display/redirect

Imarok updated this revision to Diff 7978.May 12 2019, 1:15 AM

Hide the Toggle button if no teams

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 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 250| 250| 	chartLegend.caption = g_ShowTeamCharts ?
| 251| 251| 		g_Teams.filter(el => el !== null).map(
| 252| 252| 			players => coloredText("■", playerColors[players[0] - 1]) + " " + players.map(player =>
| 253|    |-					g_GameData.sim.playerStates[player].name
|    | 253|+				g_GameData.sim.playerStates[player].name
| 254| 254| 				).join(translateWithContext("Player listing", ", "))
| 255| 255| 		).join("   ") :
| 256| 256| 		g_GameData.sim.playerStates.slice(1).map(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 251| 251| 		g_Teams.filter(el => el !== null).map(
| 252| 252| 			players => coloredText("■", playerColors[players[0] - 1]) + " " + players.map(player =>
| 253| 253| 					g_GameData.sim.playerStates[player].name
| 254|    |-				).join(translateWithContext("Player listing", ", "))
|    | 254|+			).join(translateWithContext("Player listing", ", "))
| 255| 255| 		).join("   ") :
| 256| 256| 		g_GameData.sim.playerStates.slice(1).map(
| 257| 257| 			(state, index) => coloredText("■", playerColors[index]) + " " + state.name
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 361| 361| 
| 362| 362| 	let series = [];
| 363| 363| 	if (g_ShowTeamCharts)
| 364|    |-	{
|    | 364|+	
| 365| 365| 		for (let team in g_Teams)
| 366| 366| 		{
| 367| 367| 			let data = [];
| 375| 375| 			}
| 376| 376| 			series.push(data);
| 377| 377| 		}
| 378|    |-	}
|    | 378|+	
| 379| 379| 	else
| 380| 380| 	{
| 381| 381| 		for (let j = 1; j <= g_PlayerCount; ++j)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 377| 377| 		}
| 378| 378| 	}
| 379| 379| 	else
| 380|    |-	{
|    | 380|+	
| 381| 381| 		for (let j = 1; j <= g_PlayerCount; ++j)
| 382| 382| 		{
| 383| 383| 			let playerState = g_GameData.sim.playerStates[j];
| 391| 391| 			}
| 392| 392| 			series.push(data);
| 393| 393| 		}
| 394|    |-	}
|    | 394|+	
| 395| 395| 
| 396| 396| 	chart.series = series;
| 397| 397| }
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 535| 535| 	Engine.GetGUIObjectByName("summaryText").caption =
| 536| 536| 		g_GameData.gui.isInGame ?
| 537| 537| 			translate("Current Scores") :
| 538|    |-		g_GameData.gui.isReplay ?
|    | 538|+			g_GameData.gui.isReplay ?
| 539| 539| 			translate("Scores at the end of the game.") :
| 540| 540| 		g_GameData.gui.disconnected ?
| 541| 541| 			translate("You have been disconnected.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 536| 536| 		g_GameData.gui.isInGame ?
| 537| 537| 			translate("Current Scores") :
| 538| 538| 		g_GameData.gui.isReplay ?
| 539|    |-			translate("Scores at the end of the game.") :
|    | 539|+				translate("Scores at the end of the game.") :
| 540| 540| 		g_GameData.gui.disconnected ?
| 541| 541| 			translate("You have been disconnected.") :
| 542| 542| 		!assignedState ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 537| 537| 			translate("Current Scores") :
| 538| 538| 		g_GameData.gui.isReplay ?
| 539| 539| 			translate("Scores at the end of the game.") :
| 540|    |-		g_GameData.gui.disconnected ?
|    | 540|+				g_GameData.gui.disconnected ?
| 541| 541| 			translate("You have been disconnected.") :
| 542| 542| 		!assignedState ?
| 543| 543| 			translate("You have left the game.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 538| 538| 		g_GameData.gui.isReplay ?
| 539| 539| 			translate("Scores at the end of the game.") :
| 540| 540| 		g_GameData.gui.disconnected ?
| 541|    |-			translate("You have been disconnected.") :
|    | 541|+					translate("You have been disconnected.") :
| 542| 542| 		!assignedState ?
| 543| 543| 			translate("You have left the game.") :
| 544| 544| 		assignedState.state == "won" ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 539| 539| 			translate("Scores at the end of the game.") :
| 540| 540| 		g_GameData.gui.disconnected ?
| 541| 541| 			translate("You have been disconnected.") :
| 542|    |-		!assignedState ?
|    | 542|+					!assignedState ?
| 543| 543| 			translate("You have left the game.") :
| 544| 544| 		assignedState.state == "won" ?
| 545| 545| 			translate("You have won the battle!") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 540| 540| 		g_GameData.gui.disconnected ?
| 541| 541| 			translate("You have been disconnected.") :
| 542| 542| 		!assignedState ?
| 543|    |-			translate("You have left the game.") :
|    | 543|+						translate("You have left the game.") :
| 544| 544| 		assignedState.state == "won" ?
| 545| 545| 			translate("You have won the battle!") :
| 546| 546| 		assignedState.state == "defeated" ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 541| 541| 			translate("You have been disconnected.") :
| 542| 542| 		!assignedState ?
| 543| 543| 			translate("You have left the game.") :
| 544|    |-		assignedState.state == "won" ?
|    | 544|+						assignedState.state == "won" ?
| 545| 545| 			translate("You have won the battle!") :
| 546| 546| 		assignedState.state == "defeated" ?
| 547| 547| 			translate("You have been defeated…") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 542| 542| 		!assignedState ?
| 543| 543| 			translate("You have left the game.") :
| 544| 544| 		assignedState.state == "won" ?
| 545|    |-			translate("You have won the battle!") :
|    | 545|+							translate("You have won the battle!") :
| 546| 546| 		assignedState.state == "defeated" ?
| 547| 547| 			translate("You have been defeated…") :
| 548| 548| 			translate("You have abandoned the game.");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 543| 543| 			translate("You have left the game.") :
| 544| 544| 		assignedState.state == "won" ?
| 545| 545| 			translate("You have won the battle!") :
| 546|    |-		assignedState.state == "defeated" ?
|    | 546|+							assignedState.state == "defeated" ?
| 547| 547| 			translate("You have been defeated…") :
| 548| 548| 			translate("You have abandoned the game.");
| 549| 549| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 544| 544| 		assignedState.state == "won" ?
| 545| 545| 			translate("You have won the battle!") :
| 546| 546| 		assignedState.state == "defeated" ?
| 547|    |-			translate("You have been defeated…") :
|    | 547|+								translate("You have been defeated…") :
| 548| 548| 			translate("You have abandoned the game.");
| 549| 549| 
| 550| 550| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 545| 545| 			translate("You have won the battle!") :
| 546| 546| 		assignedState.state == "defeated" ?
| 547| 547| 			translate("You have been defeated…") :
| 548|    |-			translate("You have abandoned the game.");
|    | 548|+								translate("You have abandoned the game.");
| 549| 549| 
| 550| 550| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
| 551| 551| 		translate("Game time elapsed: %(time)s"), {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 550| 550| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
| 551| 551| 		translate("Game time elapsed: %(time)s"), {
| 552| 552| 			"time": timeToString(g_GameData.sim.timeElapsed)
| 553|    |-	});
|    | 553|+		});
| 554| 554| 
| 555| 555| 	let mapType = g_Settings.MapTypes.find(type => type.Name == g_GameData.sim.mapSettings.mapType);
| 556| 556| 	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/differential/1371/display/redirect

Imarok updated this revision to Diff 7979.May 12 2019, 1:17 AM

Tiny style fix

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 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 250| 250| 	chartLegend.caption = g_ShowTeamCharts ?
| 251| 251| 		g_Teams.filter(el => el !== null).map(
| 252| 252| 			players => coloredText("■", playerColors[players[0] - 1]) + " " + players.map(player =>
| 253|    |-					g_GameData.sim.playerStates[player].name
|    | 253|+				g_GameData.sim.playerStates[player].name
| 254| 254| 				).join(translateWithContext("Player listing", ", "))
| 255| 255| 		).join("   ") :
| 256| 256| 		g_GameData.sim.playerStates.slice(1).map(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 251| 251| 		g_Teams.filter(el => el !== null).map(
| 252| 252| 			players => coloredText("■", playerColors[players[0] - 1]) + " " + players.map(player =>
| 253| 253| 					g_GameData.sim.playerStates[player].name
| 254|    |-				).join(translateWithContext("Player listing", ", "))
|    | 254|+			).join(translateWithContext("Player listing", ", "))
| 255| 255| 		).join("   ") :
| 256| 256| 		g_GameData.sim.playerStates.slice(1).map(
| 257| 257| 			(state, index) => coloredText("■", playerColors[index]) + " " + state.name
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 531| 531| 	Engine.GetGUIObjectByName("summaryText").caption =
| 532| 532| 		g_GameData.gui.isInGame ?
| 533| 533| 			translate("Current Scores") :
| 534|    |-		g_GameData.gui.isReplay ?
|    | 534|+			g_GameData.gui.isReplay ?
| 535| 535| 			translate("Scores at the end of the game.") :
| 536| 536| 		g_GameData.gui.disconnected ?
| 537| 537| 			translate("You have been disconnected.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 532| 532| 		g_GameData.gui.isInGame ?
| 533| 533| 			translate("Current Scores") :
| 534| 534| 		g_GameData.gui.isReplay ?
| 535|    |-			translate("Scores at the end of the game.") :
|    | 535|+				translate("Scores at the end of the game.") :
| 536| 536| 		g_GameData.gui.disconnected ?
| 537| 537| 			translate("You have been disconnected.") :
| 538| 538| 		!assignedState ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 533| 533| 			translate("Current Scores") :
| 534| 534| 		g_GameData.gui.isReplay ?
| 535| 535| 			translate("Scores at the end of the game.") :
| 536|    |-		g_GameData.gui.disconnected ?
|    | 536|+				g_GameData.gui.disconnected ?
| 537| 537| 			translate("You have been disconnected.") :
| 538| 538| 		!assignedState ?
| 539| 539| 			translate("You have left the game.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 534| 534| 		g_GameData.gui.isReplay ?
| 535| 535| 			translate("Scores at the end of the game.") :
| 536| 536| 		g_GameData.gui.disconnected ?
| 537|    |-			translate("You have been disconnected.") :
|    | 537|+					translate("You have been disconnected.") :
| 538| 538| 		!assignedState ?
| 539| 539| 			translate("You have left the game.") :
| 540| 540| 		assignedState.state == "won" ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 535| 535| 			translate("Scores at the end of the game.") :
| 536| 536| 		g_GameData.gui.disconnected ?
| 537| 537| 			translate("You have been disconnected.") :
| 538|    |-		!assignedState ?
|    | 538|+					!assignedState ?
| 539| 539| 			translate("You have left the game.") :
| 540| 540| 		assignedState.state == "won" ?
| 541| 541| 			translate("You have won the battle!") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 536| 536| 		g_GameData.gui.disconnected ?
| 537| 537| 			translate("You have been disconnected.") :
| 538| 538| 		!assignedState ?
| 539|    |-			translate("You have left the game.") :
|    | 539|+						translate("You have left the game.") :
| 540| 540| 		assignedState.state == "won" ?
| 541| 541| 			translate("You have won the battle!") :
| 542| 542| 		assignedState.state == "defeated" ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 537| 537| 			translate("You have been disconnected.") :
| 538| 538| 		!assignedState ?
| 539| 539| 			translate("You have left the game.") :
| 540|    |-		assignedState.state == "won" ?
|    | 540|+						assignedState.state == "won" ?
| 541| 541| 			translate("You have won the battle!") :
| 542| 542| 		assignedState.state == "defeated" ?
| 543| 543| 			translate("You have been defeated…") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 538| 538| 		!assignedState ?
| 539| 539| 			translate("You have left the game.") :
| 540| 540| 		assignedState.state == "won" ?
| 541|    |-			translate("You have won the battle!") :
|    | 541|+							translate("You have won the battle!") :
| 542| 542| 		assignedState.state == "defeated" ?
| 543| 543| 			translate("You have been defeated…") :
| 544| 544| 			translate("You have abandoned the game.");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 539| 539| 			translate("You have left the game.") :
| 540| 540| 		assignedState.state == "won" ?
| 541| 541| 			translate("You have won the battle!") :
| 542|    |-		assignedState.state == "defeated" ?
|    | 542|+							assignedState.state == "defeated" ?
| 543| 543| 			translate("You have been defeated…") :
| 544| 544| 			translate("You have abandoned the game.");
| 545| 545| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 540| 540| 		assignedState.state == "won" ?
| 541| 541| 			translate("You have won the battle!") :
| 542| 542| 		assignedState.state == "defeated" ?
| 543|    |-			translate("You have been defeated…") :
|    | 543|+								translate("You have been defeated…") :
| 544| 544| 			translate("You have abandoned the game.");
| 545| 545| 
| 546| 546| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 541| 541| 			translate("You have won the battle!") :
| 542| 542| 		assignedState.state == "defeated" ?
| 543| 543| 			translate("You have been defeated…") :
| 544|    |-			translate("You have abandoned the game.");
|    | 544|+								translate("You have abandoned the game.");
| 545| 545| 
| 546| 546| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
| 547| 547| 		translate("Game time elapsed: %(time)s"), {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 546| 546| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
| 547| 547| 		translate("Game time elapsed: %(time)s"), {
| 548| 548| 			"time": timeToString(g_GameData.sim.timeElapsed)
| 549|    |-	});
|    | 549|+		});
| 550| 550| 
| 551| 551| 	let mapType = g_Settings.MapTypes.find(type => type.Name == g_GameData.sim.mapSettings.mapType);
| 552| 552| 	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/differential/1372/display/redirect

Stan added a subscriber: Stan.May 12 2019, 1:30 AM

How does it handle changing teams during the game ?

In D1877#77655, @Stan wrote:

How does it handle changing teams during the game ?

In the summary we only show anything regarding teams when teams are locked.
(And there is at least one team with more than one player)

player graphs:

team graphs:


(The team color is just the color of the first player of that team.)

Imarok updated this revision to Diff 8043.May 16 2019, 12:46 PM

Remember the state of g_ShowTeamCharts when summary is closed.

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 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 259| 259| 	chartLegend.caption = g_ShowTeamCharts ?
| 260| 260| 		g_Teams.filter(el => el !== null).map(
| 261| 261| 			players => coloredText("■", playerColors[players[0] - 1]) + " " + players.map(player =>
| 262|    |-					g_GameData.sim.playerStates[player].name
|    | 262|+				g_GameData.sim.playerStates[player].name
| 263| 263| 				).join(translateWithContext("Player listing", ", "))
| 264| 264| 		).join("   ") :
| 265| 265| 		g_GameData.sim.playerStates.slice(1).map(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 260| 260| 		g_Teams.filter(el => el !== null).map(
| 261| 261| 			players => coloredText("■", playerColors[players[0] - 1]) + " " + players.map(player =>
| 262| 262| 					g_GameData.sim.playerStates[player].name
| 263|    |-				).join(translateWithContext("Player listing", ", "))
|    | 263|+			).join(translateWithContext("Player listing", ", "))
| 264| 264| 		).join("   ") :
| 265| 265| 		g_GameData.sim.playerStates.slice(1).map(
| 266| 266| 			(state, index) => coloredText("■", playerColors[index]) + " " + state.name
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 541| 541| 	Engine.GetGUIObjectByName("summaryText").caption =
| 542| 542| 		g_GameData.gui.isInGame ?
| 543| 543| 			translate("Current Scores") :
| 544|    |-		g_GameData.gui.isReplay ?
|    | 544|+			g_GameData.gui.isReplay ?
| 545| 545| 			translate("Scores at the end of the game.") :
| 546| 546| 		g_GameData.gui.disconnected ?
| 547| 547| 			translate("You have been disconnected.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 542| 542| 		g_GameData.gui.isInGame ?
| 543| 543| 			translate("Current Scores") :
| 544| 544| 		g_GameData.gui.isReplay ?
| 545|    |-			translate("Scores at the end of the game.") :
|    | 545|+				translate("Scores at the end of the game.") :
| 546| 546| 		g_GameData.gui.disconnected ?
| 547| 547| 			translate("You have been disconnected.") :
| 548| 548| 		!assignedState ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 543| 543| 			translate("Current Scores") :
| 544| 544| 		g_GameData.gui.isReplay ?
| 545| 545| 			translate("Scores at the end of the game.") :
| 546|    |-		g_GameData.gui.disconnected ?
|    | 546|+				g_GameData.gui.disconnected ?
| 547| 547| 			translate("You have been disconnected.") :
| 548| 548| 		!assignedState ?
| 549| 549| 			translate("You have left the game.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 544| 544| 		g_GameData.gui.isReplay ?
| 545| 545| 			translate("Scores at the end of the game.") :
| 546| 546| 		g_GameData.gui.disconnected ?
| 547|    |-			translate("You have been disconnected.") :
|    | 547|+					translate("You have been disconnected.") :
| 548| 548| 		!assignedState ?
| 549| 549| 			translate("You have left the game.") :
| 550| 550| 		assignedState.state == "won" ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 545| 545| 			translate("Scores at the end of the game.") :
| 546| 546| 		g_GameData.gui.disconnected ?
| 547| 547| 			translate("You have been disconnected.") :
| 548|    |-		!assignedState ?
|    | 548|+					!assignedState ?
| 549| 549| 			translate("You have left the game.") :
| 550| 550| 		assignedState.state == "won" ?
| 551| 551| 			translate("You have won the battle!") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 546| 546| 		g_GameData.gui.disconnected ?
| 547| 547| 			translate("You have been disconnected.") :
| 548| 548| 		!assignedState ?
| 549|    |-			translate("You have left the game.") :
|    | 549|+						translate("You have left the game.") :
| 550| 550| 		assignedState.state == "won" ?
| 551| 551| 			translate("You have won the battle!") :
| 552| 552| 		assignedState.state == "defeated" ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 547| 547| 			translate("You have been disconnected.") :
| 548| 548| 		!assignedState ?
| 549| 549| 			translate("You have left the game.") :
| 550|    |-		assignedState.state == "won" ?
|    | 550|+						assignedState.state == "won" ?
| 551| 551| 			translate("You have won the battle!") :
| 552| 552| 		assignedState.state == "defeated" ?
| 553| 553| 			translate("You have been defeated…") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 548| 548| 		!assignedState ?
| 549| 549| 			translate("You have left the game.") :
| 550| 550| 		assignedState.state == "won" ?
| 551|    |-			translate("You have won the battle!") :
|    | 551|+							translate("You have won the battle!") :
| 552| 552| 		assignedState.state == "defeated" ?
| 553| 553| 			translate("You have been defeated…") :
| 554| 554| 			translate("You have abandoned the game.");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 549| 549| 			translate("You have left the game.") :
| 550| 550| 		assignedState.state == "won" ?
| 551| 551| 			translate("You have won the battle!") :
| 552|    |-		assignedState.state == "defeated" ?
|    | 552|+							assignedState.state == "defeated" ?
| 553| 553| 			translate("You have been defeated…") :
| 554| 554| 			translate("You have abandoned the game.");
| 555| 555| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 550| 550| 		assignedState.state == "won" ?
| 551| 551| 			translate("You have won the battle!") :
| 552| 552| 		assignedState.state == "defeated" ?
| 553|    |-			translate("You have been defeated…") :
|    | 553|+								translate("You have been defeated…") :
| 554| 554| 			translate("You have abandoned the game.");
| 555| 555| 
| 556| 556| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 551| 551| 			translate("You have won the battle!") :
| 552| 552| 		assignedState.state == "defeated" ?
| 553| 553| 			translate("You have been defeated…") :
| 554|    |-			translate("You have abandoned the game.");
|    | 554|+								translate("You have abandoned the game.");
| 555| 555| 
| 556| 556| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
| 557| 557| 		translate("Game time elapsed: %(time)s"), {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 556| 556| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
| 557| 557| 		translate("Game time elapsed: %(time)s"), {
| 558| 558| 			"time": timeToString(g_GameData.sim.timeElapsed)
| 559|    |-	});
|    | 559|+		});
| 560| 560| 
| 561| 561| 	let mapType = g_Settings.MapTypes.find(type => type.Name == g_GameData.sim.mapSettings.mapType);
| 562| 562| 	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/differential/1422/display/redirect

elexis added a subscriber: elexis.May 16 2019, 2:42 PM

It's a multiple choice, either it shows the stats grouped per team, or it shows the stats grouped per player.

So naturally the options are:

  • A checkbox
  • A dropdown
  • Radio buttons (in HTML, we don't have it in Pyrogenesis GUI)

The purpose of a button to perform an action, not to trigger an option.

So a checkbox [x] Group per team seems more nearby to the purposes of GUI object types me.

(The team color is just the color of the first player of that team.)

One reason for that being a good choice is that this is consistent with diplomacy colors (it is that way, isn't it?)

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

If I'm not mistaken the duplication should be reducible. (There are some differences, but it should be possible to pass them as arguments)

In D1877#78328, @elexis wrote:

It's a multiple choice, either it shows the stats grouped per team, or it shows the stats grouped per player.
So naturally the options are:

  • A checkbox
  • A dropdown
  • Radio buttons (in HTML, we don't have it in Pyrogenesis GUI)

The purpose of a button to perform an action, not to trigger an option.
So a checkbox [x] Group per team seems more nearby to the purposes of GUI object types me.

Yeah, that seems like a better alternative. (One argument for the button is that it looks more streamlined.)

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

I thought about that when writing the code, but came to the conclusion that it's too different to make a deduplication produce a straight-forward result:

  • different for-loop type
  • different calling of the counter function
  • using individual playerStates vs. not using individual playerStates
Imarok updated this revision to Diff 8044.May 16 2019, 3:49 PM

Use a checkbox instead of a toggle button

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 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 242| 242| 	chartLegend.caption = Engine.GetGUIObjectByName("toggleTeamBox").checked ?
| 243| 243| 		g_Teams.filter(el => el !== null).map(
| 244| 244| 			players => coloredText("■", playerColors[players[0] - 1]) + " " + players.map(player =>
| 245|    |-					g_GameData.sim.playerStates[player].name
|    | 245|+				g_GameData.sim.playerStates[player].name
| 246| 246| 				).join(translateWithContext("Player listing", ", "))
| 247| 247| 		).join("   ") :
| 248| 248| 		g_GameData.sim.playerStates.slice(1).map(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 243| 243| 		g_Teams.filter(el => el !== null).map(
| 244| 244| 			players => coloredText("■", playerColors[players[0] - 1]) + " " + players.map(player =>
| 245| 245| 					g_GameData.sim.playerStates[player].name
| 246|    |-				).join(translateWithContext("Player listing", ", "))
|    | 246|+			).join(translateWithContext("Player listing", ", "))
| 247| 247| 		).join("   ") :
| 248| 248| 		g_GameData.sim.playerStates.slice(1).map(
| 249| 249| 			(state, index) => coloredText("■", playerColors[index]) + " " + state.name
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 524| 524| 	Engine.GetGUIObjectByName("summaryText").caption =
| 525| 525| 		g_GameData.gui.isInGame ?
| 526| 526| 			translate("Current Scores") :
| 527|    |-		g_GameData.gui.isReplay ?
|    | 527|+			g_GameData.gui.isReplay ?
| 528| 528| 			translate("Scores at the end of the game.") :
| 529| 529| 		g_GameData.gui.disconnected ?
| 530| 530| 			translate("You have been disconnected.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 525| 525| 		g_GameData.gui.isInGame ?
| 526| 526| 			translate("Current Scores") :
| 527| 527| 		g_GameData.gui.isReplay ?
| 528|    |-			translate("Scores at the end of the game.") :
|    | 528|+				translate("Scores at the end of the game.") :
| 529| 529| 		g_GameData.gui.disconnected ?
| 530| 530| 			translate("You have been disconnected.") :
| 531| 531| 		!assignedState ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 526| 526| 			translate("Current Scores") :
| 527| 527| 		g_GameData.gui.isReplay ?
| 528| 528| 			translate("Scores at the end of the game.") :
| 529|    |-		g_GameData.gui.disconnected ?
|    | 529|+				g_GameData.gui.disconnected ?
| 530| 530| 			translate("You have been disconnected.") :
| 531| 531| 		!assignedState ?
| 532| 532| 			translate("You have left the game.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 527| 527| 		g_GameData.gui.isReplay ?
| 528| 528| 			translate("Scores at the end of the game.") :
| 529| 529| 		g_GameData.gui.disconnected ?
| 530|    |-			translate("You have been disconnected.") :
|    | 530|+					translate("You have been disconnected.") :
| 531| 531| 		!assignedState ?
| 532| 532| 			translate("You have left the game.") :
| 533| 533| 		assignedState.state == "won" ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 528| 528| 			translate("Scores at the end of the game.") :
| 529| 529| 		g_GameData.gui.disconnected ?
| 530| 530| 			translate("You have been disconnected.") :
| 531|    |-		!assignedState ?
|    | 531|+					!assignedState ?
| 532| 532| 			translate("You have left the game.") :
| 533| 533| 		assignedState.state == "won" ?
| 534| 534| 			translate("You have won the battle!") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 529| 529| 		g_GameData.gui.disconnected ?
| 530| 530| 			translate("You have been disconnected.") :
| 531| 531| 		!assignedState ?
| 532|    |-			translate("You have left the game.") :
|    | 532|+						translate("You have left the game.") :
| 533| 533| 		assignedState.state == "won" ?
| 534| 534| 			translate("You have won the battle!") :
| 535| 535| 		assignedState.state == "defeated" ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 530| 530| 			translate("You have been disconnected.") :
| 531| 531| 		!assignedState ?
| 532| 532| 			translate("You have left the game.") :
| 533|    |-		assignedState.state == "won" ?
|    | 533|+						assignedState.state == "won" ?
| 534| 534| 			translate("You have won the battle!") :
| 535| 535| 		assignedState.state == "defeated" ?
| 536| 536| 			translate("You have been defeated…") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 531| 531| 		!assignedState ?
| 532| 532| 			translate("You have left the game.") :
| 533| 533| 		assignedState.state == "won" ?
| 534|    |-			translate("You have won the battle!") :
|    | 534|+							translate("You have won the battle!") :
| 535| 535| 		assignedState.state == "defeated" ?
| 536| 536| 			translate("You have been defeated…") :
| 537| 537| 			translate("You have abandoned the game.");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 532| 532| 			translate("You have left the game.") :
| 533| 533| 		assignedState.state == "won" ?
| 534| 534| 			translate("You have won the battle!") :
| 535|    |-		assignedState.state == "defeated" ?
|    | 535|+							assignedState.state == "defeated" ?
| 536| 536| 			translate("You have been defeated…") :
| 537| 537| 			translate("You have abandoned the game.");
| 538| 538| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 533| 533| 		assignedState.state == "won" ?
| 534| 534| 			translate("You have won the battle!") :
| 535| 535| 		assignedState.state == "defeated" ?
| 536|    |-			translate("You have been defeated…") :
|    | 536|+								translate("You have been defeated…") :
| 537| 537| 			translate("You have abandoned the game.");
| 538| 538| 
| 539| 539| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 534| 534| 			translate("You have won the battle!") :
| 535| 535| 		assignedState.state == "defeated" ?
| 536| 536| 			translate("You have been defeated…") :
| 537|    |-			translate("You have abandoned the game.");
|    | 537|+								translate("You have abandoned the game.");
| 538| 538| 
| 539| 539| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
| 540| 540| 		translate("Game time elapsed: %(time)s"), {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 539| 539| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
| 540| 540| 		translate("Game time elapsed: %(time)s"), {
| 541| 541| 			"time": timeToString(g_GameData.sim.timeElapsed)
| 542|    |-	});
|    | 542|+		});
| 543| 543| 
| 544| 544| 	let mapType = g_Settings.MapTypes.find(type => type.Name == g_GameData.sim.mapSettings.mapType);
| 545| 545| 	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/differential/1423/display/redirect

Imarok updated this revision to Diff 8045.May 16 2019, 6:27 PM

Fix indent

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 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 524| 524| 	Engine.GetGUIObjectByName("summaryText").caption =
| 525| 525| 		g_GameData.gui.isInGame ?
| 526| 526| 			translate("Current Scores") :
| 527|    |-		g_GameData.gui.isReplay ?
|    | 527|+			g_GameData.gui.isReplay ?
| 528| 528| 			translate("Scores at the end of the game.") :
| 529| 529| 		g_GameData.gui.disconnected ?
| 530| 530| 			translate("You have been disconnected.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 525| 525| 		g_GameData.gui.isInGame ?
| 526| 526| 			translate("Current Scores") :
| 527| 527| 		g_GameData.gui.isReplay ?
| 528|    |-			translate("Scores at the end of the game.") :
|    | 528|+				translate("Scores at the end of the game.") :
| 529| 529| 		g_GameData.gui.disconnected ?
| 530| 530| 			translate("You have been disconnected.") :
| 531| 531| 		!assignedState ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 526| 526| 			translate("Current Scores") :
| 527| 527| 		g_GameData.gui.isReplay ?
| 528| 528| 			translate("Scores at the end of the game.") :
| 529|    |-		g_GameData.gui.disconnected ?
|    | 529|+				g_GameData.gui.disconnected ?
| 530| 530| 			translate("You have been disconnected.") :
| 531| 531| 		!assignedState ?
| 532| 532| 			translate("You have left the game.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 527| 527| 		g_GameData.gui.isReplay ?
| 528| 528| 			translate("Scores at the end of the game.") :
| 529| 529| 		g_GameData.gui.disconnected ?
| 530|    |-			translate("You have been disconnected.") :
|    | 530|+					translate("You have been disconnected.") :
| 531| 531| 		!assignedState ?
| 532| 532| 			translate("You have left the game.") :
| 533| 533| 		assignedState.state == "won" ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 528| 528| 			translate("Scores at the end of the game.") :
| 529| 529| 		g_GameData.gui.disconnected ?
| 530| 530| 			translate("You have been disconnected.") :
| 531|    |-		!assignedState ?
|    | 531|+					!assignedState ?
| 532| 532| 			translate("You have left the game.") :
| 533| 533| 		assignedState.state == "won" ?
| 534| 534| 			translate("You have won the battle!") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 529| 529| 		g_GameData.gui.disconnected ?
| 530| 530| 			translate("You have been disconnected.") :
| 531| 531| 		!assignedState ?
| 532|    |-			translate("You have left the game.") :
|    | 532|+						translate("You have left the game.") :
| 533| 533| 		assignedState.state == "won" ?
| 534| 534| 			translate("You have won the battle!") :
| 535| 535| 		assignedState.state == "defeated" ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 530| 530| 			translate("You have been disconnected.") :
| 531| 531| 		!assignedState ?
| 532| 532| 			translate("You have left the game.") :
| 533|    |-		assignedState.state == "won" ?
|    | 533|+						assignedState.state == "won" ?
| 534| 534| 			translate("You have won the battle!") :
| 535| 535| 		assignedState.state == "defeated" ?
| 536| 536| 			translate("You have been defeated…") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 531| 531| 		!assignedState ?
| 532| 532| 			translate("You have left the game.") :
| 533| 533| 		assignedState.state == "won" ?
| 534|    |-			translate("You have won the battle!") :
|    | 534|+							translate("You have won the battle!") :
| 535| 535| 		assignedState.state == "defeated" ?
| 536| 536| 			translate("You have been defeated…") :
| 537| 537| 			translate("You have abandoned the game.");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 532| 532| 			translate("You have left the game.") :
| 533| 533| 		assignedState.state == "won" ?
| 534| 534| 			translate("You have won the battle!") :
| 535|    |-		assignedState.state == "defeated" ?
|    | 535|+							assignedState.state == "defeated" ?
| 536| 536| 			translate("You have been defeated…") :
| 537| 537| 			translate("You have abandoned the game.");
| 538| 538| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 533| 533| 		assignedState.state == "won" ?
| 534| 534| 			translate("You have won the battle!") :
| 535| 535| 		assignedState.state == "defeated" ?
| 536|    |-			translate("You have been defeated…") :
|    | 536|+								translate("You have been defeated…") :
| 537| 537| 			translate("You have abandoned the game.");
| 538| 538| 
| 539| 539| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 534| 534| 			translate("You have won the battle!") :
| 535| 535| 		assignedState.state == "defeated" ?
| 536| 536| 			translate("You have been defeated…") :
| 537|    |-			translate("You have abandoned the game.");
|    | 537|+								translate("You have abandoned the game.");
| 538| 538| 
| 539| 539| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
| 540| 540| 		translate("Game time elapsed: %(time)s"), {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/summary/summary.js
| 539| 539| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
| 540| 540| 		translate("Game time elapsed: %(time)s"), {
| 541| 541| 			"time": timeToString(g_GameData.sim.timeElapsed)
| 542|    |-	});
|    | 542|+		});
| 543| 543| 
| 544| 544| 	let mapType = g_Settings.MapTypes.find(type => type.Name == g_GameData.sim.mapSettings.mapType);
| 545| 545| 	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/differential/1424/display/redirect

One argument for the button is that it looks more streamlined

Yes, I understood your reasoning and it's not inherently wrong to use a button, especially depending on which graphics represent the control elements. I just wanted to point out that that typically checkboxes are used for binary settings and buttons for actions. If I don't use red color, it's not a contractual obligation to perform changes.

binaries/data/mods/public/gui/summary/summary.js
400
	if (Engine.GetGUIObjectByName("toggleTeamBox").checked)
		for (let team in g_Teams)
		{
			let playerState = g_GameData.sim.playerStates[1];

			let valueFunction = (...) => g_ScorePanelsData[category].teamCounterFn(team, index, item,
				g_ScorePanelsData[category].counters, g_ScorePanelsData[category].headings);

			for (let index in playerState.sequences.time)
			constructValueThingSwearword(playerState, valueFunction);
		}
	else
		for (let j = 1; j <= g_PlayerCount; ++j)
		{
			let playerState = g_GameData.sim.playerStates[j];
			let valueFunction = (...) => g_ScorePanelsData[category].counters[itemNumber].fn(playerState, index, item);
			constructValueThingSwearword(playerState, valueFunction);
		}


function constructValueThingSwearword(playerState, valueFunction)
{
	let data = [];
	for (let index in playerState.sequences.time)
	{
		let value = valueFunction(...);
		if (type)
			value = value[type];
		data.push([playerState.sequences.time[index], value]);
	}
	series.push(data);
}

I don't mind if this is rejected with prejudice or used and credited (or anything else anyone could care about)

In D1877#78342, @elexis wrote:

One argument for the button is that it looks more streamlined

Yes, I understood your reasoning and it's not inherently wrong to use a button, especially depending on which graphics represent the control elements. I just wanted to point out that that typically checkboxes are used for binary settings and buttons for actions. If I don't use red color, it's not a contractual obligation to perform changes.

Yes, I also understood your reasoning and found the arguments for a checkbox better than the arguments for a button, so I used a checkbox instead. (It appears that also is a reduction in LOC ;) )

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

And that won't work because teamCounterFn and fn are called with different arguments.
And if we also add a distinction for that we'll produce more code and it will get messy.

elexis added inline comments.May 16 2019, 8:36 PM
binaries/data/mods/public/gui/summary/summary.js
400

Not if you pass a function instead of a number/string/object as argument and have the swearword function call that function with all arguments the two callers use, afaics.

elexis added inline comments.May 16 2019, 8:38 PM
binaries/data/mods/public/gui/summary/summary.js
400

Basically resolve (...) and we can say for sure if its good or not, but it looks good to me since exactly the duplicate part is abstracted, which means it's not only less lines to read but also less complex, less nesting.

elexis added inline comments.May 16 2019, 10:09 PM
binaries/data/mods/public/gui/summary/summary.js
400

and less fragmentation (since the shared code and unique code are on alternating lines, with the function, they are separated into one group per logic layer), if successful