Page MenuHomeWildfire Games

Hint the location for "You have been attacked" notifications
Needs ReviewPublic

Authored by Imarok on Apr 20 2018, 6:46 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Trac Tickets
#5132
Summary

Split the chat overlay in single lines. Make "You have been attacked" notifications clickable. If clicked the camera follows the attacked entity. If the entity is already dead or had ranked up, go to the place where the attack happened.
We could think about adding a icon (maybe a crosshair?) in front of the text to better communicate that the text is clickable.

Test Plan

Test it.

Diff Detail

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

Event Timeline

Imarok created this revision.Apr 20 2018, 6:46 PM
Imarok edited the summary of this revision. (Show Details)Apr 20 2018, 6:47 PM
Vulcan added a subscriber: Vulcan.Apr 20 2018, 6:54 PM

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

Linter detected issues:
Executing section Default...
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 100| 100| 
| 101| 101| var g_FormatChatMessage = {
| 102| 102| 	"system": msg => {
| 103|    |-		return {"text": msg.text };
|    | 103|+		return { "text": msg.text };
| 104| 104| 	},
| 105| 105| 	"connect": msg => {
| 106| 106| 		return { "text": sprintf(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 104| 104| 	},
| 105| 105| 	"connect": msg => {
| 106| 106| 		return { "text": sprintf(
| 107|    |-				g_PlayerAssignments[msg.guid].player != -1 ?
|    | 107|+			g_PlayerAssignments[msg.guid].player != -1 ?
| 108| 108| 					// Translation: A player that left the game joins again
| 109| 109| 					translate("%(player)s is starting to rejoin the game.") :
| 110| 110| 					// Translation: A player joins the game for the first time
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 105| 105| 	"connect": msg => {
| 106| 106| 		return { "text": sprintf(
| 107| 107| 				g_PlayerAssignments[msg.guid].player != -1 ?
| 108|    |-					// Translation: A player that left the game joins again
|    | 108|+				// Translation: A player that left the game joins again
| 109| 109| 					translate("%(player)s is starting to rejoin the game.") :
| 110| 110| 					// Translation: A player joins the game for the first time
| 111| 111| 					translate("%(player)s is starting to join the game."),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 106| 106| 		return { "text": sprintf(
| 107| 107| 				g_PlayerAssignments[msg.guid].player != -1 ?
| 108| 108| 					// Translation: A player that left the game joins again
| 109|    |-					translate("%(player)s is starting to rejoin the game.") :
|    | 109|+				translate("%(player)s is starting to rejoin the game.") :
| 110| 110| 					// Translation: A player joins the game for the first time
| 111| 111| 					translate("%(player)s is starting to join the game."),
| 112| 112| 				{ "player": colorizePlayernameByGUID(msg.guid) }
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 107| 107| 				g_PlayerAssignments[msg.guid].player != -1 ?
| 108| 108| 					// Translation: A player that left the game joins again
| 109| 109| 					translate("%(player)s is starting to rejoin the game.") :
| 110|    |-					// Translation: A player joins the game for the first time
|    | 110|+				// Translation: A player joins the game for the first time
| 111| 111| 					translate("%(player)s is starting to join the game."),
| 112| 112| 				{ "player": colorizePlayernameByGUID(msg.guid) }
| 113| 113| 		)};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 108| 108| 					// Translation: A player that left the game joins again
| 109| 109| 					translate("%(player)s is starting to rejoin the game.") :
| 110| 110| 					// Translation: A player joins the game for the first time
| 111|    |-					translate("%(player)s is starting to join the game."),
|    | 111|+				translate("%(player)s is starting to join the game."),
| 112| 112| 				{ "player": colorizePlayernameByGUID(msg.guid) }
| 113| 113| 		)};
| 114| 114| 	},
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 109| 109| 					translate("%(player)s is starting to rejoin the game.") :
| 110| 110| 					// Translation: A player joins the game for the first time
| 111| 111| 					translate("%(player)s is starting to join the game."),
| 112|    |-				{ "player": colorizePlayernameByGUID(msg.guid) }
|    | 112|+			{ "player": colorizePlayernameByGUID(msg.guid) }
| 113| 113| 		)};
| 114| 114| 	},
| 115| 115| 	"disconnect": msg => {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 110| 110| 					// Translation: A player joins the game for the first time
| 111| 111| 					translate("%(player)s is starting to join the game."),
| 112| 112| 				{ "player": colorizePlayernameByGUID(msg.guid) }
| 113|    |-		)};
|    | 113|+		) };
| 114| 114| 	},
| 115| 115| 	"disconnect": msg => {
| 116| 116| 		return { "text": sprintf(translate("%(player)s has left the game."), {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 114| 114| 	},
| 115| 115| 	"disconnect": msg => {
| 116| 116| 		return { "text": sprintf(translate("%(player)s has left the game."), {
| 117|    |-				"player": colorizePlayernameByGUID(msg.guid)
|    | 117|+			"player": colorizePlayernameByGUID(msg.guid)
| 118| 118| 		})};
| 119| 119| 	},
| 120| 120| 	"rejoined": msg => {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 115| 115| 	"disconnect": msg => {
| 116| 116| 		return { "text": sprintf(translate("%(player)s has left the game."), {
| 117| 117| 				"player": colorizePlayernameByGUID(msg.guid)
| 118|    |-		})};
|    | 118|+		}) };
| 119| 119| 	},
| 120| 120| 	"rejoined": msg => {
| 121| 121| 		return { "text": sprintf(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 119| 119| 	},
| 120| 120| 	"rejoined": msg => {
| 121| 121| 		return { "text": sprintf(
| 122|    |-				g_PlayerAssignments[msg.guid].player != -1 ?
|    | 122|+			g_PlayerAssignments[msg.guid].player != -1 ?
| 123| 123| 					// Translation: A player that left the game joins again
| 124| 124| 					translate("%(player)s has rejoined the game.") :
| 125| 125| 					// Translation: A player joins the game for the first time
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 120| 120| 	"rejoined": msg => {
| 121| 121| 		return { "text": sprintf(
| 122| 122| 				g_PlayerAssignments[msg.guid].player != -1 ?
| 123|    |-					// Translation: A player that left the game joins again
|    | 123|+				// Translation: A player that left the game joins again
| 124| 124| 					translate("%(player)s has rejoined the game.") :
| 125| 125| 					// Translation: A player joins the game for the first time
| 126| 126| 					translate("%(player)s has joined the game."),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 121| 121| 		return { "text": sprintf(
| 122| 122| 				g_PlayerAssignments[msg.guid].player != -1 ?
| 123| 123| 					// Translation: A player that left the game joins again
| 124|    |-					translate("%(player)s has rejoined the game.") :
|    | 124|+				translate("%(player)s has rejoined the game.") :
| 125| 125| 					// Translation: A player joins the game for the first time
| 126| 126| 					translate("%(player)s has joined the game."),
| 127| 127| 				{ "player": colorizePlayernameByGUID(msg.guid) }
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 122| 122| 				g_PlayerAssignments[msg.guid].player != -1 ?
| 123| 123| 					// Translation: A player that left the game joins again
| 124| 124| 					translate("%(player)s has rejoined the game.") :
| 125|    |-					// Translation: A player joins the game for the first time
|    | 125|+				// Translation: A player joins the game for the first time
| 126| 126| 					translate("%(player)s has joined the game."),
| 127| 127| 				{ "player": colorizePlayernameByGUID(msg.guid) }
| 128| 128| 		)};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 123| 123| 					// Translation: A player that left the game joins again
| 124| 124| 					translate("%(player)s has rejoined the game.") :
| 125| 125| 					// Translation: A player joins the game for the first time
| 126|    |-					translate("%(player)s has joined the game."),
|    | 126|+				translate("%(player)s has joined the game."),
| 127| 127| 				{ "player": colorizePlayernameByGUID(msg.guid) }
| 128| 128| 		)};
| 129| 129| 	},
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 124| 124| 					translate("%(player)s has rejoined the game.") :
| 125| 125| 					// Translation: A player joins the game for the first time
| 126| 126| 					translate("%(player)s has joined the game."),
| 127|    |-				{ "player": colorizePlayernameByGUID(msg.guid) }
|    | 127|+			{ "player": colorizePlayernameByGUID(msg.guid) }
| 128| 128| 		)};
| 129| 129| 	},
| 130| 130| 	"kicked": msg => {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 125| 125| 					// Translation: A player joins the game for the first time
| 126| 126| 					translate("%(player)s has joined the game."),
| 127| 127| 				{ "player": colorizePlayernameByGUID(msg.guid) }
| 128|    |-		)};
|    | 128|+		) };
| 129| 129| 	},
| 130| 130| 	"kicked": msg => {
| 131| 131| 		return { "text": sprintf(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 129| 129| 	},
| 130| 130| 	"kicked": msg => {
| 131| 131| 		return { "text": sprintf(
| 132|    |-				msg.banned ?
|    | 132|+			msg.banned ?
| 133| 133| 					translate("%(username)s has been banned") :
| 134| 134| 					translate("%(username)s has been kicked"),
| 135| 135| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 130| 130| 	"kicked": msg => {
| 131| 131| 		return { "text": sprintf(
| 132| 132| 				msg.banned ?
| 133|    |-					translate("%(username)s has been banned") :
|    | 133|+				translate("%(username)s has been banned") :
| 134| 134| 					translate("%(username)s has been kicked"),
| 135| 135| 				{
| 136| 136| 					"username": colorizePlayernameHelper(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 131| 131| 		return { "text": sprintf(
| 132| 132| 				msg.banned ?
| 133| 133| 					translate("%(username)s has been banned") :
| 134|    |-					translate("%(username)s has been kicked"),
|    | 134|+				translate("%(username)s has been kicked"),
| 135| 135| 				{
| 136| 136| 					"username": colorizePlayernameHelper(
| 137| 137| 						msg.username,
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 132| 132| 				msg.banned ?
| 133| 133| 					translate("%(username)s has been banned") :
| 134| 134| 					translate("%(username)s has been kicked"),
| 135|    |-				{
|    | 135|+			{
| 136| 136| 					"username": colorizePlayernameHelper(
| 137| 137| 						msg.username,
| 138| 138| 						g_Players.findIndex(p => p.name == msg.username)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 133| 133| 					translate("%(username)s has been banned") :
| 134| 134| 					translate("%(username)s has been kicked"),
| 135| 135| 				{
| 136|    |-					"username": colorizePlayernameHelper(
|    | 136|+				"username": colorizePlayernameHelper(
| 137| 137| 						msg.username,
| 138| 138| 						g_Players.findIndex(p => p.name == msg.username)
| 139| 139| 					)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 134| 134| 					translate("%(username)s has been kicked"),
| 135| 135| 				{
| 136| 136| 					"username": colorizePlayernameHelper(
| 137|    |-						msg.username,
|    | 137|+					msg.username,
| 138| 138| 						g_Players.findIndex(p => p.name == msg.username)
| 139| 139| 					)
| 140| 140| 				}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 135| 135| 				{
| 136| 136| 					"username": colorizePlayernameHelper(
| 137| 137| 						msg.username,
| 138|    |-						g_Players.findIndex(p => p.name == msg.username)
|    | 138|+					g_Players.findIndex(p => p.name == msg.username)
| 139| 139| 					)
| 140| 140| 				}
| 141| 141| 			)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 136| 136| 					"username": colorizePlayernameHelper(
| 137| 137| 						msg.username,
| 138| 138| 						g_Players.findIndex(p => p.name == msg.username)
| 139|    |-					)
|    | 139|+				)
| 140| 140| 				}
| 141| 141| 			)
| 142| 142| 		};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 137| 137| 						msg.username,
| 138| 138| 						g_Players.findIndex(p => p.name == msg.username)
| 139| 139| 					)
| 140|    |-				}
|    | 140|+			}
| 141| 141| 			)
| 142| 142| 		};
| 143| 143| 	},
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 138| 138| 						g_Players.findIndex(p => p.name == msg.username)
| 139| 139| 					)
| 140| 140| 				}
| 141|    |-			)
|    | 141|+		)
| 142| 142| 		};
| 143| 143| 	},
| 144| 144| 	"clientlist": msg => {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 481| 481| 		g_Selection.reset();
| 482| 482| 		g_Selection.addList(selection, false, cmd.type == "gather");
| 483| 483| 	},
| 484|    |-	"play-tracks": function (notification, player)
|    | 484|+	"play-tracks": function(notification, player)
| 485| 485| 	{
| 486| 486| 		if (notification.lock)
| 487| 487| 		{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 588| 588| 	let notificationText =
| 589| 589| 		notification.instructions.reduce((instructions, item) =>
| 590| 590| 			instructions + (typeof item == "string" ? translate(item) : colorizeHotkey(translate(item.text), item.hotkey)),
| 591|    |-			"");
|    | 591|+		"");
| 592| 592| 
| 593| 593| 	Engine.GetGUIObjectByName("tutorialText").caption = g_TutorialMessages.concat(setStringTags(notificationText, g_TutorialNewMessageTags)).join("\n");
| 594| 594| 	g_TutorialMessages.push(notificationText);
|    | [NORMAL] ESLintBear (semi-spacing):
|    | Unexpected whitespace before semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 916| 916| {
| 917| 917| 	const leftMargin = 3;
| 918| 918| 	const buttonMargin = 2;
| 919|    |-	for (let i = 0 ; i < g_ChatLines; ++i)
|    | 919|+	for (let i = 0; i < g_ChatLines; ++i)
| 920| 920| 	{
| 921| 921| 		let chatLine = Engine.GetGUIObjectByName("chatLine[" + i + "]");
| 922| 922| 		let chatLineButton = Engine.GetGUIObjectByName("chatLineButton[" + i + "]");
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1038|1038| 	if (!message.pluralMessage)
|1039|1039| 		return { "text": sprintf(translate(message), {
|1040|1040| 			"player": colorizePlayernameByID(players[0])
|1041|    |-		})};
|    |1041|+		}) };
|1042|1042| 
|1043|1043| 	let mPlayers = players.map(playerID => colorizePlayernameByID(playerID));
|1044|1044| 	let lastPlayer = mPlayers.pop();
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1047|1047| 		// Translation: This comma is used for separating first to penultimate elements in an enumeration.
|1048|1048| 		"players": mPlayers.join(translate(", ")),
|1049|1049| 		"lastPlayer": lastPlayer
|1050|    |-	})};
|    |1050|+	}) };
|1051|1051| }
|1052|1052| 
|1053|1053| function formatDiplomacyMessage(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1066|1066| 	return { "text": sprintf(g_DiplomacyMessages[messageType][msg.status], {
|1067|1067| 		"player": colorizePlayernameByID(messageType == "active" ? msg.targetPlayer : msg.sourcePlayer),
|1068|1068| 		"player2": colorizePlayernameByID(messageType == "active" ? msg.sourcePlayer : msg.targetPlayer)
|1069|    |-	})};
|    |1069|+	}) };
|1070|1070| }
|1071|1071| 
|1072|1072| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1090|1090| 		"player": colorizePlayernameByID(msg.sourcePlayer),
|1091|1091| 		"player2": colorizePlayernameByID(msg.targetPlayer),
|1092|1092| 		"amounts": getLocalizedResourceAmounts(msg.amounts)
|1093|    |-	})};
|    |1093|+	}) };
|1094|1094| }
|1095|1095| 
|1096|1096| function formatBarterMessage(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1108|1108| 		"player": colorizePlayernameByID(msg.player),
|1109|1109| 		"amountsBought": getLocalizedResourceAmounts(amountsBought),
|1110|1110| 		"amountsSold": getLocalizedResourceAmounts(amountsSold)
|1111|    |-	})};
|    |1111|+	}) };
|1112|1112| }
|1113|1113| 
|1114|1114| function formatAttackMessage(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1122|1122| 
|1123|1123| 	return { "target": msg.target, "text": sprintf(message, {
|1124|1124| 		"attacker": colorizePlayernameByID(msg.attacker)
|1125|    |-	})};
|    |1125|+	}) };
|1126|1126| }
|1127|1127| 
|1128|1128| function formatPhaseMessage(msg)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1133|1133| 
|1134|1134| 	let message = "";
|1135|1135| 	if (notifyPhase == "all")
|1136|    |-	{
|    |1136|+	
|1137|1137| 		if (msg.phaseState == "started")
|1138|1138| 			message = translate("%(player)s is advancing to the %(phaseName)s.");
|1139|1139| 		else if (msg.phaseState == "aborted")
|1140|1140| 			message = translate("The %(phaseName)s of %(player)s has been aborted.");
|1141|    |-	}
|    |1141|+	
|1142|1142| 	if (msg.phaseState == "completed")
|1143|1143| 		message = translate("%(player)s has reached the %(phaseName)s.");
|1144|1144| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1145|1145| 	return { "text": sprintf(message, {
|1146|1146| 		"player": colorizePlayernameByID(msg.player),
|1147|1147| 		"phaseName": getEntityNames(GetTechnologyData(msg.phaseName, g_Players[msg.player].civ))
|1148|    |-	})};
|    |1148|+	}) };
|1149|1149| }
|1150|1150| 
|1151|1151| function formatChatCommand(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1193|1193| 		"context": msg.context || undefined,
|1194|1194| 		"user": coloredUsername,
|1195|1195| 		"userTag": sprintf(translate("<%(user)s>"), { "user": coloredUsername })
|1196|    |-	})};
|    |1196|+	}) };
|1197|1197| }
|1198|1198| 
|1199|1199| /**

binaries/data/mods/public/gui/session/messages.js
| 647| »   while·(true)
|    | [NORMAL] ESLintBear (no-constant-condition):
|    | Unexpected constant condition.

Link to build: https://jenkins.wildfiregames.com/job/differential/417/display/redirect

elexis added a subscriber: elexis.Apr 20 2018, 7:00 PM

Why not have the text itself being clickable? If it changes the cursor, it should be noticeable.

In D1461#59829, @elexis wrote:

Why not have the text itself being clickable? If it changes the cursor, it should be noticeable.

Then you couldn't click on the ingame things behind.

Only "You have been attacked" should be the button, maybe that timestamp prefix too. The rest has no reason to not remain clickable.

Imarok added a comment.May 3 2018, 2:57 PM
In D1461#59849, @elexis wrote:

Only "You have been attacked" should be the button, maybe that timestamp prefix too. The rest has no reason to not remain clickable.

Then I would need to adjust the width of the text button to the width of the text, which is currently not possible afaik.

mimo added a subscriber: mimo.May 3 2018, 7:23 PM

The button looks fine to me, but i'd rather put it after the "you've been attacked" message, possibly with some help text, for example "click to go there" as new players may not guess what is its use. Other alternatives would be to add an explicit icon (but looks really small) or at the very least a tooltip to that button.

binaries/data/mods/public/gui/session/messages.js
942

leftover

943

If the unit die before we react, nothing happen. Wouldn't it be better to also add the position of the target, and if died when we press the button, simply move the camera to that position.

elexis added a comment.May 3 2018, 8:44 PM

afaik

Complaint and Engine.GetTextWidth

elexis added a comment.May 3 2018, 9:00 PM

Didn't test, but a transparent button should be possible by just not rendering the sprite if it's not given:

Index: source/gui/CButton.cpp
===================================================================
--- source/gui/CButton.cpp	(revision 21815)
+++ source/gui/CButton.cpp	(working copy)
@@ -107,6 +107,7 @@
 	GUI<CGUISpriteInstance>::GetSettingPointer(this, strSpriteDisabled, sprite_disabled);
 	GUI<int>::GetSetting(this, strCellId, cell_id);
 
+	if (sprite)
 	DrawButton(m_CachedActualSize,
 			   bz,
 			   *sprite,
In D1461#60571, @elexis wrote:

afaik

Complaint and Engine.GetTextWidth

Ok, now everything works, besides that Engine.GetTextWidth does not ignore tags, so Engine.GetTextWidth('<[color="21 55 149"]foo[/color]>') returns a way higher value than Engine.GetTextWidth("foo").

Ok, now everything works

The argument for implementing the button separately was not that it's claimed the better alternative, only the code problem?
There is one advantage that this separate button has, that is that it is directly visible to the user that there is something to interact with, whereas the text as is only reveals its additional function when using a tooltip.
However the current button sprite IMO does look ugly, so I'd prefer the transparent text if those are the two choices, unless someone comes up with a trumping icon.
But if we have a good icon, it could just be part of the text and the entire text could still be clickable.

besides that Engine.GetTextWidth does not ignore tags, so Engine.GetTextWidth('<[color="21 55 149"]foo[/color]>') returns a way higher value than Engine.GetTextWidth("foo").

There is a C++ function for getting the text ignoring tags, check rP19545.
That function is probably inaccessible currently, but it should be easily possible to expose it to JS via the JS Interface cpp files.
It probably has to be a static function, because GUI objects only support properties currently, but we want it to be a read-only function.
So sounds like it should be something like Engine.GetTextWidth(Engine.RemoveGUITags("foo")).
Recursively parsing tags in JS may be possible, but probably not few complexity and possibly error prone (and when someone changes cpp code the JS code would have to be updated).

As mentioned line breaks won't occur here as far as I see, but if we ever want to support them, D844 would be a place to visit.

We can equally convert the lagwarnings to buttons that ask you to kick the guy.

In D1461#60588, @elexis wrote:

As mentioned line breaks won't occur here as far as I see, but if we ever want to support them, D844 would be a place to visit.

So this function probably does everything, what I want, so I don't think reinventing another one makes sense...

In D1461#60834, @elexis wrote:

We can equally convert the lagwarnings to buttons that ask you to kick the guy.

Or just implement the network window...

Imarok added inline comments.May 14 2018, 6:41 PM
binaries/data/mods/public/gui/session/messages.js
942

thx

943

I already wrote that in the summary of the revision ;)

Imarok updated this revision to Diff 6544.May 14 2018, 7:28 PM
Imarok marked 4 inline comments as done.

Also add the location if entity has vanished. Still containing a button texture and not using the correct textWidth. Both will be fixed as soon as D844 is done.

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

Linter detected issues:
Executing section Default...
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 100| 100| 
| 101| 101| var g_FormatChatMessage = {
| 102| 102| 	"system": msg => {
| 103|    |-		return {"text": msg.text };
|    | 103|+		return { "text": msg.text };
| 104| 104| 	},
| 105| 105| 	"connect": msg => {
| 106| 106| 		return { "text": sprintf(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 104| 104| 	},
| 105| 105| 	"connect": msg => {
| 106| 106| 		return { "text": sprintf(
| 107|    |-				g_PlayerAssignments[msg.guid].player != -1 ?
|    | 107|+			g_PlayerAssignments[msg.guid].player != -1 ?
| 108| 108| 					// Translation: A player that left the game joins again
| 109| 109| 					translate("%(player)s is starting to rejoin the game.") :
| 110| 110| 					// Translation: A player joins the game for the first time
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 105| 105| 	"connect": msg => {
| 106| 106| 		return { "text": sprintf(
| 107| 107| 				g_PlayerAssignments[msg.guid].player != -1 ?
| 108|    |-					// Translation: A player that left the game joins again
|    | 108|+				// Translation: A player that left the game joins again
| 109| 109| 					translate("%(player)s is starting to rejoin the game.") :
| 110| 110| 					// Translation: A player joins the game for the first time
| 111| 111| 					translate("%(player)s is starting to join the game."),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 106| 106| 		return { "text": sprintf(
| 107| 107| 				g_PlayerAssignments[msg.guid].player != -1 ?
| 108| 108| 					// Translation: A player that left the game joins again
| 109|    |-					translate("%(player)s is starting to rejoin the game.") :
|    | 109|+				translate("%(player)s is starting to rejoin the game.") :
| 110| 110| 					// Translation: A player joins the game for the first time
| 111| 111| 					translate("%(player)s is starting to join the game."),
| 112| 112| 				{ "player": colorizePlayernameByGUID(msg.guid) }
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 107| 107| 				g_PlayerAssignments[msg.guid].player != -1 ?
| 108| 108| 					// Translation: A player that left the game joins again
| 109| 109| 					translate("%(player)s is starting to rejoin the game.") :
| 110|    |-					// Translation: A player joins the game for the first time
|    | 110|+				// Translation: A player joins the game for the first time
| 111| 111| 					translate("%(player)s is starting to join the game."),
| 112| 112| 				{ "player": colorizePlayernameByGUID(msg.guid) }
| 113| 113| 		)};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 108| 108| 					// Translation: A player that left the game joins again
| 109| 109| 					translate("%(player)s is starting to rejoin the game.") :
| 110| 110| 					// Translation: A player joins the game for the first time
| 111|    |-					translate("%(player)s is starting to join the game."),
|    | 111|+				translate("%(player)s is starting to join the game."),
| 112| 112| 				{ "player": colorizePlayernameByGUID(msg.guid) }
| 113| 113| 		)};
| 114| 114| 	},
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 109| 109| 					translate("%(player)s is starting to rejoin the game.") :
| 110| 110| 					// Translation: A player joins the game for the first time
| 111| 111| 					translate("%(player)s is starting to join the game."),
| 112|    |-				{ "player": colorizePlayernameByGUID(msg.guid) }
|    | 112|+			{ "player": colorizePlayernameByGUID(msg.guid) }
| 113| 113| 		)};
| 114| 114| 	},
| 115| 115| 	"disconnect": msg => {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 110| 110| 					// Translation: A player joins the game for the first time
| 111| 111| 					translate("%(player)s is starting to join the game."),
| 112| 112| 				{ "player": colorizePlayernameByGUID(msg.guid) }
| 113|    |-		)};
|    | 113|+		) };
| 114| 114| 	},
| 115| 115| 	"disconnect": msg => {
| 116| 116| 		return { "text": sprintf(translate("%(player)s has left the game."), {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 114| 114| 	},
| 115| 115| 	"disconnect": msg => {
| 116| 116| 		return { "text": sprintf(translate("%(player)s has left the game."), {
| 117|    |-				"player": colorizePlayernameByGUID(msg.guid)
|    | 117|+			"player": colorizePlayernameByGUID(msg.guid)
| 118| 118| 		})};
| 119| 119| 	},
| 120| 120| 	"rejoined": msg => {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 115| 115| 	"disconnect": msg => {
| 116| 116| 		return { "text": sprintf(translate("%(player)s has left the game."), {
| 117| 117| 				"player": colorizePlayernameByGUID(msg.guid)
| 118|    |-		})};
|    | 118|+		}) };
| 119| 119| 	},
| 120| 120| 	"rejoined": msg => {
| 121| 121| 		return { "text": sprintf(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 119| 119| 	},
| 120| 120| 	"rejoined": msg => {
| 121| 121| 		return { "text": sprintf(
| 122|    |-				g_PlayerAssignments[msg.guid].player != -1 ?
|    | 122|+			g_PlayerAssignments[msg.guid].player != -1 ?
| 123| 123| 					// Translation: A player that left the game joins again
| 124| 124| 					translate("%(player)s has rejoined the game.") :
| 125| 125| 					// Translation: A player joins the game for the first time
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 120| 120| 	"rejoined": msg => {
| 121| 121| 		return { "text": sprintf(
| 122| 122| 				g_PlayerAssignments[msg.guid].player != -1 ?
| 123|    |-					// Translation: A player that left the game joins again
|    | 123|+				// Translation: A player that left the game joins again
| 124| 124| 					translate("%(player)s has rejoined the game.") :
| 125| 125| 					// Translation: A player joins the game for the first time
| 126| 126| 					translate("%(player)s has joined the game."),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 121| 121| 		return { "text": sprintf(
| 122| 122| 				g_PlayerAssignments[msg.guid].player != -1 ?
| 123| 123| 					// Translation: A player that left the game joins again
| 124|    |-					translate("%(player)s has rejoined the game.") :
|    | 124|+				translate("%(player)s has rejoined the game.") :
| 125| 125| 					// Translation: A player joins the game for the first time
| 126| 126| 					translate("%(player)s has joined the game."),
| 127| 127| 				{ "player": colorizePlayernameByGUID(msg.guid) }
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 122| 122| 				g_PlayerAssignments[msg.guid].player != -1 ?
| 123| 123| 					// Translation: A player that left the game joins again
| 124| 124| 					translate("%(player)s has rejoined the game.") :
| 125|    |-					// Translation: A player joins the game for the first time
|    | 125|+				// Translation: A player joins the game for the first time
| 126| 126| 					translate("%(player)s has joined the game."),
| 127| 127| 				{ "player": colorizePlayernameByGUID(msg.guid) }
| 128| 128| 		)};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 123| 123| 					// Translation: A player that left the game joins again
| 124| 124| 					translate("%(player)s has rejoined the game.") :
| 125| 125| 					// Translation: A player joins the game for the first time
| 126|    |-					translate("%(player)s has joined the game."),
|    | 126|+				translate("%(player)s has joined the game."),
| 127| 127| 				{ "player": colorizePlayernameByGUID(msg.guid) }
| 128| 128| 		)};
| 129| 129| 	},
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 124| 124| 					translate("%(player)s has rejoined the game.") :
| 125| 125| 					// Translation: A player joins the game for the first time
| 126| 126| 					translate("%(player)s has joined the game."),
| 127|    |-				{ "player": colorizePlayernameByGUID(msg.guid) }
|    | 127|+			{ "player": colorizePlayernameByGUID(msg.guid) }
| 128| 128| 		)};
| 129| 129| 	},
| 130| 130| 	"kicked": msg => {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 125| 125| 					// Translation: A player joins the game for the first time
| 126| 126| 					translate("%(player)s has joined the game."),
| 127| 127| 				{ "player": colorizePlayernameByGUID(msg.guid) }
| 128|    |-		)};
|    | 128|+		) };
| 129| 129| 	},
| 130| 130| 	"kicked": msg => {
| 131| 131| 		return { "text": sprintf(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 129| 129| 	},
| 130| 130| 	"kicked": msg => {
| 131| 131| 		return { "text": sprintf(
| 132|    |-				msg.banned ?
|    | 132|+			msg.banned ?
| 133| 133| 					translate("%(username)s has been banned") :
| 134| 134| 					translate("%(username)s has been kicked"),
| 135| 135| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 130| 130| 	"kicked": msg => {
| 131| 131| 		return { "text": sprintf(
| 132| 132| 				msg.banned ?
| 133|    |-					translate("%(username)s has been banned") :
|    | 133|+				translate("%(username)s has been banned") :
| 134| 134| 					translate("%(username)s has been kicked"),
| 135| 135| 				{
| 136| 136| 					"username": colorizePlayernameHelper(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 131| 131| 		return { "text": sprintf(
| 132| 132| 				msg.banned ?
| 133| 133| 					translate("%(username)s has been banned") :
| 134|    |-					translate("%(username)s has been kicked"),
|    | 134|+				translate("%(username)s has been kicked"),
| 135| 135| 				{
| 136| 136| 					"username": colorizePlayernameHelper(
| 137| 137| 						msg.username,
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 132| 132| 				msg.banned ?
| 133| 133| 					translate("%(username)s has been banned") :
| 134| 134| 					translate("%(username)s has been kicked"),
| 135|    |-				{
|    | 135|+			{
| 136| 136| 					"username": colorizePlayernameHelper(
| 137| 137| 						msg.username,
| 138| 138| 						g_Players.findIndex(p => p.name == msg.username)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 133| 133| 					translate("%(username)s has been banned") :
| 134| 134| 					translate("%(username)s has been kicked"),
| 135| 135| 				{
| 136|    |-					"username": colorizePlayernameHelper(
|    | 136|+				"username": colorizePlayernameHelper(
| 137| 137| 						msg.username,
| 138| 138| 						g_Players.findIndex(p => p.name == msg.username)
| 139| 139| 					)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 134| 134| 					translate("%(username)s has been kicked"),
| 135| 135| 				{
| 136| 136| 					"username": colorizePlayernameHelper(
| 137|    |-						msg.username,
|    | 137|+					msg.username,
| 138| 138| 						g_Players.findIndex(p => p.name == msg.username)
| 139| 139| 					)
| 140| 140| 				}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 135| 135| 				{
| 136| 136| 					"username": colorizePlayernameHelper(
| 137| 137| 						msg.username,
| 138|    |-						g_Players.findIndex(p => p.name == msg.username)
|    | 138|+					g_Players.findIndex(p => p.name == msg.username)
| 139| 139| 					)
| 140| 140| 				}
| 141| 141| 			)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 136| 136| 					"username": colorizePlayernameHelper(
| 137| 137| 						msg.username,
| 138| 138| 						g_Players.findIndex(p => p.name == msg.username)
| 139|    |-					)
|    | 139|+				)
| 140| 140| 				}
| 141| 141| 			)
| 142| 142| 		};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 137| 137| 						msg.username,
| 138| 138| 						g_Players.findIndex(p => p.name == msg.username)
| 139| 139| 					)
| 140|    |-				}
|    | 140|+			}
| 141| 141| 			)
| 142| 142| 		};
| 143| 143| 	},
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 138| 138| 						g_Players.findIndex(p => p.name == msg.username)
| 139| 139| 					)
| 140| 140| 				}
| 141|    |-			)
|    | 141|+		)
| 142| 142| 		};
| 143| 143| 	},
| 144| 144| 	"clientlist": msg => {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 483| 483| 		g_Selection.reset();
| 484| 484| 		g_Selection.addList(selection, false, cmd.type == "gather");
| 485| 485| 	},
| 486|    |-	"play-tracks": function (notification, player)
|    | 486|+	"play-tracks": function(notification, player)
| 487| 487| 	{
| 488| 488| 		if (notification.lock)
| 489| 489| 		{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 590| 590| 	let notificationText =
| 591| 591| 		notification.instructions.reduce((instructions, item) =>
| 592| 592| 			instructions + (typeof item == "string" ? translate(item) : colorizeHotkey(translate(item.text), item.hotkey)),
| 593|    |-			"");
|    | 593|+		"");
| 594| 594| 
| 595| 595| 	Engine.GetGUIObjectByName("tutorialText").caption = g_TutorialMessages.concat(setStringTags(notificationText, g_TutorialNewMessageTags)).join("\n");
| 596| 596| 	g_TutorialMessages.push(notificationText);
|    | [NORMAL] ESLintBear (semi-spacing):
|    | Unexpected whitespace before semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 917| 917| function showChatMessages()
| 918| 918| {
| 919| 919| 	const leftMargin = 3;
| 920|    |-	for (let i = 0 ; i < g_ChatLines; ++i)
|    | 920|+	for (let i = 0; i < g_ChatLines; ++i)
| 921| 921| 	{
| 922| 922| 		let chatLine = Engine.GetGUIObjectByName("chatLine[" + i + "]");
| 923| 923| 		if (g_ChatMessages[i] && g_ChatMessages[i].text)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1034|1034| 	if (!message.pluralMessage)
|1035|1035| 		return { "text": sprintf(translate(message), {
|1036|1036| 			"player": colorizePlayernameByID(players[0])
|1037|    |-		})};
|    |1037|+		}) };
|1038|1038| 
|1039|1039| 	let mPlayers = players.map(playerID => colorizePlayernameByID(playerID));
|1040|1040| 	let lastPlayer = mPlayers.pop();
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1043|1043| 		// Translation: This comma is used for separating first to penultimate elements in an enumeration.
|1044|1044| 		"players": mPlayers.join(translate(", ")),
|1045|1045| 		"lastPlayer": lastPlayer
|1046|    |-	})};
|    |1046|+	}) };
|1047|1047| }
|1048|1048| 
|1049|1049| function formatDiplomacyMessage(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1062|1062| 	return { "text": sprintf(g_DiplomacyMessages[messageType][msg.status], {
|1063|1063| 		"player": colorizePlayernameByID(messageType == "active" ? msg.targetPlayer : msg.sourcePlayer),
|1064|1064| 		"player2": colorizePlayernameByID(messageType == "active" ? msg.sourcePlayer : msg.targetPlayer)
|1065|    |-	})};
|    |1065|+	}) };
|1066|1066| }
|1067|1067| 
|1068|1068| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1086|1086| 		"player": colorizePlayernameByID(msg.sourcePlayer),
|1087|1087| 		"player2": colorizePlayernameByID(msg.targetPlayer),
|1088|1088| 		"amounts": getLocalizedResourceAmounts(msg.amounts)
|1089|    |-	})};
|    |1089|+	}) };
|1090|1090| }
|1091|1091| 
|1092|1092| function formatBarterMessage(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1104|1104| 		"player": colorizePlayernameByID(msg.player),
|1105|1105| 		"amountsBought": getLocalizedResourceAmounts(amountsBought),
|1106|1106| 		"amountsSold": getLocalizedResourceAmounts(amountsSold)
|1107|    |-	})};
|    |1107|+	}) };
|1108|1108| }
|1109|1109| 
|1110|1110| function formatAttackMessage(msg)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1131|1131| 
|1132|1132| 	let message = "";
|1133|1133| 	if (notifyPhase == "all")
|1134|    |-	{
|    |1134|+	
|1135|1135| 		if (msg.phaseState == "started")
|1136|1136| 			message = translate("%(player)s is advancing to the %(phaseName)s.");
|1137|1137| 		else if (msg.phaseState == "aborted")
|1138|1138| 			message = translate("The %(phaseName)s of %(player)s has been aborted.");
|1139|    |-	}
|    |1139|+	
|1140|1140| 	if (msg.phaseState == "completed")
|1141|1141| 		message = translate("%(player)s has reached the %(phaseName)s.");
|1142|1142| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1143|1143| 	return { "text": sprintf(message, {
|1144|1144| 		"player": colorizePlayernameByID(msg.player),
|1145|1145| 		"phaseName": getEntityNames(GetTechnologyData(msg.phaseName, g_Players[msg.player].civ))
|1146|    |-	})};
|    |1146|+	}) };
|1147|1147| }
|1148|1148| 
|1149|1149| function formatChatCommand(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1191|1191| 		"context": msg.context || undefined,
|1192|1192| 		"user": coloredUsername,
|1193|1193| 		"userTag": sprintf(translate("<%(user)s>"), { "user": coloredUsername })
|1194|    |-	})};
|    |1194|+	}) };
|1195|1195| }
|1196|1196| 
|1197|1197| /**

binaries/data/mods/public/gui/session/messages.js
| 649| »   while·(true)
|    | [NORMAL] ESLintBear (no-constant-condition):
|    | Unexpected constant condition.

Link to build: https://jenkins.wildfiregames.com/job/differential/489/display/redirect

In D1461#60834, @elexis wrote:

We can equally convert the lagwarnings to buttons that ask you to kick the guy.

Also if the lagwarnings become buttons, we can add a line if someone wanted to join as observer but observers are not enabled.
A click on that button could then send a message to the NetServer that this client is allowed to join.
Until then, the client that attempts to rejoin as observer would wait.

Imarok updated this revision to Diff 7600.Mar 20 2019, 12:27 PM

Use D844. Fix minor style issues. Use correct style.

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 104| 104| 	},
| 105| 105| 	"connect": msg => {
| 106| 106| 		return { "text": sprintf(
| 107|    |-				g_PlayerAssignments[msg.guid].player != -1 ?
|    | 107|+			g_PlayerAssignments[msg.guid].player != -1 ?
| 108| 108| 					// Translation: A player that left the game joins again
| 109| 109| 					translate("%(player)s is starting to rejoin the game.") :
| 110| 110| 					// Translation: A player joins the game for the first time
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 105| 105| 	"connect": msg => {
| 106| 106| 		return { "text": sprintf(
| 107| 107| 				g_PlayerAssignments[msg.guid].player != -1 ?
| 108|    |-					// Translation: A player that left the game joins again
|    | 108|+				// Translation: A player that left the game joins again
| 109| 109| 					translate("%(player)s is starting to rejoin the game.") :
| 110| 110| 					// Translation: A player joins the game for the first time
| 111| 111| 					translate("%(player)s is starting to join the game."),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 106| 106| 		return { "text": sprintf(
| 107| 107| 				g_PlayerAssignments[msg.guid].player != -1 ?
| 108| 108| 					// Translation: A player that left the game joins again
| 109|    |-					translate("%(player)s is starting to rejoin the game.") :
|    | 109|+				translate("%(player)s is starting to rejoin the game.") :
| 110| 110| 					// Translation: A player joins the game for the first time
| 111| 111| 					translate("%(player)s is starting to join the game."),
| 112| 112| 				{ "player": colorizePlayernameByGUID(msg.guid) }
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 107| 107| 				g_PlayerAssignments[msg.guid].player != -1 ?
| 108| 108| 					// Translation: A player that left the game joins again
| 109| 109| 					translate("%(player)s is starting to rejoin the game.") :
| 110|    |-					// Translation: A player joins the game for the first time
|    | 110|+				// Translation: A player joins the game for the first time
| 111| 111| 					translate("%(player)s is starting to join the game."),
| 112| 112| 				{ "player": colorizePlayernameByGUID(msg.guid) }
| 113| 113| 		)};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 108| 108| 					// Translation: A player that left the game joins again
| 109| 109| 					translate("%(player)s is starting to rejoin the game.") :
| 110| 110| 					// Translation: A player joins the game for the first time
| 111|    |-					translate("%(player)s is starting to join the game."),
|    | 111|+				translate("%(player)s is starting to join the game."),
| 112| 112| 				{ "player": colorizePlayernameByGUID(msg.guid) }
| 113| 113| 		)};
| 114| 114| 	},
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 109| 109| 					translate("%(player)s is starting to rejoin the game.") :
| 110| 110| 					// Translation: A player joins the game for the first time
| 111| 111| 					translate("%(player)s is starting to join the game."),
| 112|    |-				{ "player": colorizePlayernameByGUID(msg.guid) }
|    | 112|+			{ "player": colorizePlayernameByGUID(msg.guid) }
| 113| 113| 		)};
| 114| 114| 	},
| 115| 115| 	"disconnect": msg => {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 110| 110| 					// Translation: A player joins the game for the first time
| 111| 111| 					translate("%(player)s is starting to join the game."),
| 112| 112| 				{ "player": colorizePlayernameByGUID(msg.guid) }
| 113|    |-		)};
|    | 113|+		) };
| 114| 114| 	},
| 115| 115| 	"disconnect": msg => {
| 116| 116| 		return { "text": sprintf(translate("%(player)s has left the game."), {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 114| 114| 	},
| 115| 115| 	"disconnect": msg => {
| 116| 116| 		return { "text": sprintf(translate("%(player)s has left the game."), {
| 117|    |-				"player": colorizePlayernameByGUID(msg.guid)
|    | 117|+			"player": colorizePlayernameByGUID(msg.guid)
| 118| 118| 		})};
| 119| 119| 	},
| 120| 120| 	"rejoined": msg => {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 115| 115| 	"disconnect": msg => {
| 116| 116| 		return { "text": sprintf(translate("%(player)s has left the game."), {
| 117| 117| 				"player": colorizePlayernameByGUID(msg.guid)
| 118|    |-		})};
|    | 118|+		}) };
| 119| 119| 	},
| 120| 120| 	"rejoined": msg => {
| 121| 121| 		return { "text": sprintf(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 119| 119| 	},
| 120| 120| 	"rejoined": msg => {
| 121| 121| 		return { "text": sprintf(
| 122|    |-				g_PlayerAssignments[msg.guid].player != -1 ?
|    | 122|+			g_PlayerAssignments[msg.guid].player != -1 ?
| 123| 123| 					// Translation: A player that left the game joins again
| 124| 124| 					translate("%(player)s has rejoined the game.") :
| 125| 125| 					// Translation: A player joins the game for the first time
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 120| 120| 	"rejoined": msg => {
| 121| 121| 		return { "text": sprintf(
| 122| 122| 				g_PlayerAssignments[msg.guid].player != -1 ?
| 123|    |-					// Translation: A player that left the game joins again
|    | 123|+				// Translation: A player that left the game joins again
| 124| 124| 					translate("%(player)s has rejoined the game.") :
| 125| 125| 					// Translation: A player joins the game for the first time
| 126| 126| 					translate("%(player)s has joined the game."),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 121| 121| 		return { "text": sprintf(
| 122| 122| 				g_PlayerAssignments[msg.guid].player != -1 ?
| 123| 123| 					// Translation: A player that left the game joins again
| 124|    |-					translate("%(player)s has rejoined the game.") :
|    | 124|+				translate("%(player)s has rejoined the game.") :
| 125| 125| 					// Translation: A player joins the game for the first time
| 126| 126| 					translate("%(player)s has joined the game."),
| 127| 127| 				{ "player": colorizePlayernameByGUID(msg.guid) }
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 122| 122| 				g_PlayerAssignments[msg.guid].player != -1 ?
| 123| 123| 					// Translation: A player that left the game joins again
| 124| 124| 					translate("%(player)s has rejoined the game.") :
| 125|    |-					// Translation: A player joins the game for the first time
|    | 125|+				// Translation: A player joins the game for the first time
| 126| 126| 					translate("%(player)s has joined the game."),
| 127| 127| 				{ "player": colorizePlayernameByGUID(msg.guid) }
| 128| 128| 		)};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 123| 123| 					// Translation: A player that left the game joins again
| 124| 124| 					translate("%(player)s has rejoined the game.") :
| 125| 125| 					// Translation: A player joins the game for the first time
| 126|    |-					translate("%(player)s has joined the game."),
|    | 126|+				translate("%(player)s has joined the game."),
| 127| 127| 				{ "player": colorizePlayernameByGUID(msg.guid) }
| 128| 128| 		)};
| 129| 129| 	},
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 124| 124| 					translate("%(player)s has rejoined the game.") :
| 125| 125| 					// Translation: A player joins the game for the first time
| 126| 126| 					translate("%(player)s has joined the game."),
| 127|    |-				{ "player": colorizePlayernameByGUID(msg.guid) }
|    | 127|+			{ "player": colorizePlayernameByGUID(msg.guid) }
| 128| 128| 		)};
| 129| 129| 	},
| 130| 130| 	"kicked": msg => {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 125| 125| 					// Translation: A player joins the game for the first time
| 126| 126| 					translate("%(player)s has joined the game."),
| 127| 127| 				{ "player": colorizePlayernameByGUID(msg.guid) }
| 128|    |-		)};
|    | 128|+		) };
| 129| 129| 	},
| 130| 130| 	"kicked": msg => {
| 131| 131| 		return { "text": sprintf(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 129| 129| 	},
| 130| 130| 	"kicked": msg => {
| 131| 131| 		return { "text": sprintf(
| 132|    |-				msg.banned ?
|    | 132|+			msg.banned ?
| 133| 133| 					translate("%(username)s has been banned") :
| 134| 134| 					translate("%(username)s has been kicked"),
| 135| 135| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 130| 130| 	"kicked": msg => {
| 131| 131| 		return { "text": sprintf(
| 132| 132| 				msg.banned ?
| 133|    |-					translate("%(username)s has been banned") :
|    | 133|+				translate("%(username)s has been banned") :
| 134| 134| 					translate("%(username)s has been kicked"),
| 135| 135| 				{
| 136| 136| 					"username": colorizePlayernameHelper(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 131| 131| 		return { "text": sprintf(
| 132| 132| 				msg.banned ?
| 133| 133| 					translate("%(username)s has been banned") :
| 134|    |-					translate("%(username)s has been kicked"),
|    | 134|+				translate("%(username)s has been kicked"),
| 135| 135| 				{
| 136| 136| 					"username": colorizePlayernameHelper(
| 137| 137| 						msg.username,
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 132| 132| 				msg.banned ?
| 133| 133| 					translate("%(username)s has been banned") :
| 134| 134| 					translate("%(username)s has been kicked"),
| 135|    |-				{
|    | 135|+			{
| 136| 136| 					"username": colorizePlayernameHelper(
| 137| 137| 						msg.username,
| 138| 138| 						g_Players.findIndex(p => p.name == msg.username)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 133| 133| 					translate("%(username)s has been banned") :
| 134| 134| 					translate("%(username)s has been kicked"),
| 135| 135| 				{
| 136|    |-					"username": colorizePlayernameHelper(
|    | 136|+				"username": colorizePlayernameHelper(
| 137| 137| 						msg.username,
| 138| 138| 						g_Players.findIndex(p => p.name == msg.username)
| 139| 139| 					)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 134| 134| 					translate("%(username)s has been kicked"),
| 135| 135| 				{
| 136| 136| 					"username": colorizePlayernameHelper(
| 137|    |-						msg.username,
|    | 137|+					msg.username,
| 138| 138| 						g_Players.findIndex(p => p.name == msg.username)
| 139| 139| 					)
| 140| 140| 				}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 135| 135| 				{
| 136| 136| 					"username": colorizePlayernameHelper(
| 137| 137| 						msg.username,
| 138|    |-						g_Players.findIndex(p => p.name == msg.username)
|    | 138|+					g_Players.findIndex(p => p.name == msg.username)
| 139| 139| 					)
| 140| 140| 				}
| 141| 141| 			)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 136| 136| 					"username": colorizePlayernameHelper(
| 137| 137| 						msg.username,
| 138| 138| 						g_Players.findIndex(p => p.name == msg.username)
| 139|    |-					)
|    | 139|+				)
| 140| 140| 				}
| 141| 141| 			)
| 142| 142| 		};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 137| 137| 						msg.username,
| 138| 138| 						g_Players.findIndex(p => p.name == msg.username)
| 139| 139| 					)
| 140|    |-				}
|    | 140|+			}
| 141| 141| 			)
| 142| 142| 		};
| 143| 143| 	},
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 138| 138| 						g_Players.findIndex(p => p.name == msg.username)
| 139| 139| 					)
| 140| 140| 				}
| 141|    |-			)
|    | 141|+		)
| 142| 142| 		};
| 143| 143| 	},
| 144| 144| 	"clientlist": msg => {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 483| 483| 		g_Selection.reset();
| 484| 484| 		g_Selection.addList(selection, false, cmd.type == "gather");
| 485| 485| 	},
| 486|    |-	"play-tracks": function (notification, player)
|    | 486|+	"play-tracks": function(notification, player)
| 487| 487| 	{
| 488| 488| 		if (notification.lock)
| 489| 489| 		{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 590| 590| 	let notificationText =
| 591| 591| 		notification.instructions.reduce((instructions, item) =>
| 592| 592| 			instructions + (typeof item == "string" ? translate(item) : colorizeHotkey(translate(item.text), item.hotkey)),
| 593|    |-			"");
|    | 593|+		"");
| 594| 594| 
| 595| 595| 	Engine.GetGUIObjectByName("tutorialText").caption = g_TutorialMessages.concat(setStringTags(notificationText, g_TutorialNewMessageTags)).join("\n");
| 596| 596| 	g_TutorialMessages.push(notificationText);
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1040|1040| 	if (!message.pluralMessage)
|1041|1041| 		return { "text": sprintf(translate(message), {
|1042|1042| 			"player": colorizePlayernameByID(players[0])
|1043|    |-		})};
|    |1043|+		}) };
|1044|1044| 
|1045|1045| 	let mPlayers = players.map(playerID => colorizePlayernameByID(playerID));
|1046|1046| 	let lastPlayer = mPlayers.pop();
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1049|1049| 		// Translation: This comma is used for separating first to penultimate elements in an enumeration.
|1050|1050| 		"players": mPlayers.join(translate(", ")),
|1051|1051| 		"lastPlayer": lastPlayer
|1052|    |-	})};
|    |1052|+	}) };
|1053|1053| }
|1054|1054| 
|1055|1055| function formatDiplomacyMessage(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1068|1068| 	return { "text": sprintf(g_DiplomacyMessages[messageType][msg.status], {
|1069|1069| 		"player": colorizePlayernameByID(messageType == "active" ? msg.targetPlayer : msg.sourcePlayer),
|1070|1070| 		"player2": colorizePlayernameByID(messageType == "active" ? msg.sourcePlayer : msg.targetPlayer)
|1071|    |-	})};
|    |1071|+	}) };
|1072|1072| }
|1073|1073| 
|1074|1074| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1092|1092| 		"player": colorizePlayernameByID(msg.sourcePlayer),
|1093|1093| 		"player2": colorizePlayernameByID(msg.targetPlayer),
|1094|1094| 		"amounts": getLocalizedResourceAmounts(msg.amounts)
|1095|    |-	})};
|    |1095|+	}) };
|1096|1096| }
|1097|1097| 
|1098|1098| function formatBarterMessage(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1110|1110| 		"player": colorizePlayernameByID(msg.player),
|1111|1111| 		"amountsBought": getLocalizedResourceAmounts(amountsBought),
|1112|1112| 		"amountsSold": getLocalizedResourceAmounts(amountsSold)
|1113|    |-	})};
|    |1113|+	}) };
|1114|1114| }
|1115|1115| 
|1116|1116| function formatAttackMessage(msg)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1137|1137| 
|1138|1138| 	let message = "";
|1139|1139| 	if (notifyPhase == "all")
|1140|    |-	{
|    |1140|+	
|1141|1141| 		if (msg.phaseState == "started")
|1142|1142| 			message = translate("%(player)s is advancing to the %(phaseName)s.");
|1143|1143| 		else if (msg.phaseState == "aborted")
|1144|1144| 			message = translate("The %(phaseName)s of %(player)s has been aborted.");
|1145|    |-	}
|    |1145|+	
|1146|1146| 	if (msg.phaseState == "completed")
|1147|1147| 		message = translate("%(player)s has reached the %(phaseName)s.");
|1148|1148| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1149|1149| 	return { "text": sprintf(message, {
|1150|1150| 		"player": colorizePlayernameByID(msg.player),
|1151|1151| 		"phaseName": getEntityNames(GetTechnologyData(msg.phaseName, g_Players[msg.player].civ))
|1152|    |-	})};
|    |1152|+	}) };
|1153|1153| }
|1154|1154| 
|1155|1155| function formatChatCommand(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1197|1197| 		"context": msg.context || undefined,
|1198|1198| 		"user": coloredUsername,
|1199|1199| 		"userTag": sprintf(translate("<%(user)s>"), { "user": coloredUsername })
|1200|    |-	})};
|    |1200|+	}) };
|1201|1201| }
|1202|1202| 
|1203|1203| /**
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1125/display/redirect

Imarok retitled this revision from [RFC] Hint the location for "You have been attacked" notifications to Hint the location for "You have been attacked" notifications.Mar 20 2019, 12:30 PM
Imarok edited the summary of this revision. (Show Details)

Good.

Now the question remains how we make it visible to the players that this click-feature exists.
Usually the mouse cursor changes when one hovers a link. Underlining won't be supported by our small font base, but adding a sprite should be easily possible (resource icons in tooltips.js / setup_resources.xml as an example).

binaries/data/mods/public/gui/session/messages.js
9

milliseconds, and 10x?

11–12

...in the on-screen chat display

12

Instead of instructing the developer to do this task, we can just as well change the code to make this task unnecessary.
Unless one plans for making this a user-config setting and the XML number an upper limit.
In that case one could consider making this
var g_ChatLines = Math.min(configValue, Engine.GetGUIObjectByName("chatlines").children.length); and prevent possible error messages and imply the comment.
Or leaving as is.

140

msg => ({\n"text":...

418

(can consder creating an own object for the entity, but not for only two properties)
(targetEntity, targetPosition?)

917

leftMargin unnecessary, because the assignment to .left is unnecessary, because it never changes from the default, so the other reference to leftMargin can use .left

918

(Possibly Engine.GetGUIObjectByName("chatLines").children.forEach((chatLine, i) => {...}), saves (only) one line and one variable reference).)

927

(maybe top + height, also where is that 1 coming from)

937

(Looks like avoiding the two rright modifications would mean adding more complexity)

944

This was to distinguish alive from dead entities, right? I guess the entity can die after the message was added but before the user clicked. So I guess it has to be that way.

946

t -> entityID
p -> position

Does it actually need the closure? Actually I guess using the forEach would avoid that need.
(Also if using the closuer, might be possible to only pass g_ChatMessages[i] (or i?))

948

If ghost=false is necessary for this item to be clickable, but they are true by default, then I wonder why they are true by default, whether they can be false by default (thus making this line unnecessary), or whether the clickable items are affected by some graphics issue that the ghost property avoided.

962

Sure that !text should early-return in any case? IIRC there were some random / status messages here that might not have that property, I might be wrong. (If Im not further mistaken, I broke this once)

1037–1040

(If I may propose {\n"text": , then the indentation difference between parent and child is exactly 1 tab, and it's nicely consistent if property names are at the beginning of a line, all properties on a separate line)

Imarok marked 12 inline comments as done.Apr 25 2019, 12:11 AM
In D1461#73338, @elexis wrote:

Good.
Now the question remains how we make it visible to the players that this click-feature exists.
Usually the mouse cursor changes when one hovers a link. Underlining won't be supported by our small font base, but adding a sprite should be easily possible (resource icons in tooltips.js / setup_resources.xml as an example).

Having any sprite in mind?
Else I'd just add a tooltip that says "Click to focus on attacked unit."

binaries/data/mods/public/gui/session/messages.js
9

Uh, good you noticed. That was just test code ^^

12

Wow, didn't knew about that function...

418

Nah, I think it's clearer that way.

927

The 1 was an adjustment to look the same way as the old gui.
Now just moved that 1 to xml where it makes more sense.

944

line 943 distinguishes between dead and alive.

946

Iirc it needs the closure, but I'm currently too sleepy to think about. I'll try to do that in the upcoming days ;)

Don't see where a forEach could be used.

948

They are true by default so you can click on the things behind the messages.

962

As I added the text property in this patch: Yes I am sure all useful messages return a text and I am sure you didn't broke that in the past, cause this patch will introduces the property. (Unless you are a timetraveller, but then the definition of past and future heavily depends on perspective and philosophy)

1037–1040

Yeah that looks nicer.

Imarok updated this revision to Diff 7840.Apr 25 2019, 12:11 AM
Imarok marked 7 inline comments as done.
Imarok edited the summary of this revision. (Show Details)

Do changes according to inlines

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/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 105| 105| 					// Translation: A player joins the game for the first time
| 106| 106| 					translate("%(player)s is starting to join the game."),
| 107| 107| 				{ "player": colorizePlayernameByGUID(msg.guid) }
| 108|    |-		)};
|    | 108|+			)};
| 109| 109| 	},
| 110| 110| 	"disconnect": msg => {
| 111| 111| 		return {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 105| 105| 					// Translation: A player joins the game for the first time
| 106| 106| 					translate("%(player)s is starting to join the game."),
| 107| 107| 				{ "player": colorizePlayernameByGUID(msg.guid) }
| 108|    |-		)};
|    | 108|+		) };
| 109| 109| 	},
| 110| 110| 	"disconnect": msg => {
| 111| 111| 		return {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 111| 111| 		return {
| 112| 112| 			"text": sprintf(translate("%(player)s has left the game."), {
| 113| 113| 				"player": colorizePlayernameByGUID(msg.guid)
| 114|    |-		})};
|    | 114|+			})};
| 115| 115| 	},
| 116| 116| 	"rejoined": msg => {
| 117| 117| 		return {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 111| 111| 		return {
| 112| 112| 			"text": sprintf(translate("%(player)s has left the game."), {
| 113| 113| 				"player": colorizePlayernameByGUID(msg.guid)
| 114|    |-		})};
|    | 114|+		}) };
| 115| 115| 	},
| 116| 116| 	"rejoined": msg => {
| 117| 117| 		return {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 122| 122| 					// Translation: A player joins the game for the first time
| 123| 123| 					translate("%(player)s has joined the game."),
| 124| 124| 				{ "player": colorizePlayernameByGUID(msg.guid) }
| 125|    |-		)};
|    | 125|+			)};
| 126| 126| 	},
| 127| 127| 	"kicked": msg => {
| 128| 128| 		return {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 122| 122| 					// Translation: A player joins the game for the first time
| 123| 123| 					translate("%(player)s has joined the game."),
| 124| 124| 				{ "player": colorizePlayernameByGUID(msg.guid) }
| 125|    |-		)};
|    | 125|+		) };
| 126| 126| 	},
| 127| 127| 	"kicked": msg => {
| 128| 128| 		return {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 481| 481| 		g_Selection.reset();
| 482| 482| 		g_Selection.addList(selection, false, cmd.type == "gather");
| 483| 483| 	},
| 484|    |-	"play-tracks": function (notification, player)
|    | 484|+	"play-tracks": function(notification, player)
| 485| 485| 	{
| 486| 486| 		if (notification.lock)
| 487| 487| 		{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
| 588| 588| 	let notificationText =
| 589| 589| 		notification.instructions.reduce((instructions, item) =>
| 590| 590| 			instructions + (typeof item == "string" ? translate(item) : colorizeHotkey(translate(item.text), item.hotkey)),
| 591|    |-			"");
|    | 591|+		"");
| 592| 592| 
| 593| 593| 	Engine.GetGUIObjectByName("tutorialText").caption = g_TutorialMessages.concat(setStringTags(notificationText, g_TutorialNewMessageTags)).join("\n");
| 594| 594| 	g_TutorialMessages.push(notificationText);
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1037|1037| 		return {
|1038|1038| 			"text": sprintf(translate(message), {
|1039|1039| 				"player": colorizePlayernameByID(players[0])
|1040|    |-		})};
|    |1040|+			})};
|1041|1041| 
|1042|1042| 	let mPlayers = players.map(playerID => colorizePlayernameByID(playerID));
|1043|1043| 	let lastPlayer = mPlayers.pop();
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1037|1037| 		return {
|1038|1038| 			"text": sprintf(translate(message), {
|1039|1039| 				"player": colorizePlayernameByID(players[0])
|1040|    |-		})};
|    |1040|+		}) };
|1041|1041| 
|1042|1042| 	let mPlayers = players.map(playerID => colorizePlayernameByID(playerID));
|1043|1043| 	let lastPlayer = mPlayers.pop();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1047|1047| 			// Translation: This comma is used for separating first to penultimate elements in an enumeration.
|1048|1048| 			"players": mPlayers.join(translate(", ")),
|1049|1049| 			"lastPlayer": lastPlayer
|1050|    |-	})};
|    |1050|+		})};
|1051|1051| }
|1052|1052| 
|1053|1053| function formatDiplomacyMessage(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1047|1047| 			// Translation: This comma is used for separating first to penultimate elements in an enumeration.
|1048|1048| 			"players": mPlayers.join(translate(", ")),
|1049|1049| 			"lastPlayer": lastPlayer
|1050|    |-	})};
|    |1050|+	}) };
|1051|1051| }
|1052|1052| 
|1053|1053| function formatDiplomacyMessage(msg)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1067|1067| 		"text": sprintf(g_DiplomacyMessages[messageType][msg.status], {
|1068|1068| 			"player": colorizePlayernameByID(messageType == "active" ? msg.targetPlayer : msg.sourcePlayer),
|1069|1069| 			"player2": colorizePlayernameByID(messageType == "active" ? msg.sourcePlayer : msg.targetPlayer)
|1070|    |-	})};
|    |1070|+		})};
|1071|1071| }
|1072|1072| 
|1073|1073| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1067|1067| 		"text": sprintf(g_DiplomacyMessages[messageType][msg.status], {
|1068|1068| 			"player": colorizePlayernameByID(messageType == "active" ? msg.targetPlayer : msg.sourcePlayer),
|1069|1069| 			"player2": colorizePlayernameByID(messageType == "active" ? msg.sourcePlayer : msg.targetPlayer)
|1070|    |-	})};
|    |1070|+	}) };
|1071|1071| }
|1072|1072| 
|1073|1073| /**
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1092|1092| 			"player": colorizePlayernameByID(msg.sourcePlayer),
|1093|1093| 			"player2": colorizePlayernameByID(msg.targetPlayer),
|1094|1094| 			"amounts": getLocalizedResourceAmounts(msg.amounts)
|1095|    |-	})};
|    |1095|+		})};
|1096|1096| }
|1097|1097| 
|1098|1098| function formatBarterMessage(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1092|1092| 			"player": colorizePlayernameByID(msg.sourcePlayer),
|1093|1093| 			"player2": colorizePlayernameByID(msg.targetPlayer),
|1094|1094| 			"amounts": getLocalizedResourceAmounts(msg.amounts)
|1095|    |-	})};
|    |1095|+	}) };
|1096|1096| }
|1097|1097| 
|1098|1098| function formatBarterMessage(msg)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1111|1111| 			"player": colorizePlayernameByID(msg.player),
|1112|1112| 			"amountsBought": getLocalizedResourceAmounts(amountsBought),
|1113|1113| 			"amountsSold": getLocalizedResourceAmounts(amountsSold)
|1114|    |-	})};
|    |1114|+		})};
|1115|1115| }
|1116|1116| 
|1117|1117| function formatAttackMessage(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1111|1111| 			"player": colorizePlayernameByID(msg.player),
|1112|1112| 			"amountsBought": getLocalizedResourceAmounts(amountsBought),
|1113|1113| 			"amountsSold": getLocalizedResourceAmounts(amountsSold)
|1114|    |-	})};
|    |1114|+	}) };
|1115|1115| }
|1116|1116| 
|1117|1117| function formatAttackMessage(msg)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1138|1138| 
|1139|1139| 	let message = "";
|1140|1140| 	if (notifyPhase == "all")
|1141|    |-	{
|    |1141|+	
|1142|1142| 		if (msg.phaseState == "started")
|1143|1143| 			message = translate("%(player)s is advancing to the %(phaseName)s.");
|1144|1144| 		else if (msg.phaseState == "aborted")
|1145|1145| 			message = translate("The %(phaseName)s of %(player)s has been aborted.");
|1146|    |-	}
|    |1146|+	
|1147|1147| 	if (msg.phaseState == "completed")
|1148|1148| 		message = translate("%(player)s has reached the %(phaseName)s.");
|1149|1149| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1151|1151| 		"text": sprintf(message, {
|1152|1152| 			"player": colorizePlayernameByID(msg.player),
|1153|1153| 			"phaseName": getEntityNames(GetTechnologyData(msg.phaseName, g_Players[msg.player].civ))
|1154|    |-	})};
|    |1154|+		})};
|1155|1155| }
|1156|1156| 
|1157|1157| function formatChatCommand(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1151|1151| 		"text": sprintf(message, {
|1152|1152| 			"player": colorizePlayernameByID(msg.player),
|1153|1153| 			"phaseName": getEntityNames(GetTechnologyData(msg.phaseName, g_Players[msg.player].civ))
|1154|    |-	})};
|    |1154|+	}) };
|1155|1155| }
|1156|1156| 
|1157|1157| function formatChatCommand(msg)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1200|1200| 			"context": msg.context || undefined,
|1201|1201| 			"user": coloredUsername,
|1202|1202| 			"userTag": sprintf(translate("<%(user)s>"), { "user": coloredUsername })
|1203|    |-	})};
|    |1203|+		})};
|1204|1204| }
|1205|1205| 
|1206|1206| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/messages.js
|1200|1200| 			"context": msg.context || undefined,
|1201|1201| 			"user": coloredUsername,
|1202|1202| 			"userTag": sprintf(translate("<%(user)s>"), { "user": coloredUsername })
|1203|    |-	})};
|    |1203|+	}) };
|1204|1204| }
|1205|1205| 
|1206|1206| /**
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1272/display/redirect