Page MenuHomeWildfire Games

display all gamesetup setting in the gamedescription
ClosedPublic

Authored by bb on Mar 10 2018, 1:04 AM.

Details

Summary

Gamesetup used to only show the values of the settings in the more option window, but the ingame objectives window showed all settings, thus there was an extended parameter passed to the getter function. Now as we have tabs for the gamesetup values sortof all values got in the "more option" window (as in all can be hidden in a way), thus it would be good to show all values.
For this we drop the extended parameter and simply show everything

We need to be somewhat careful with the "random" random map. I here merged the name and description in one item.
Also I took the liberty to add the mapFilter (as it can be important for the "random" random map) in gamesetup.

Test Plan

Make sure the front doens't fall

Agree or propose a better order of the items, considering that the same order is used in the objectives window.

Diff Detail

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

Event Timeline

bb created this revision.Mar 10 2018, 1:04 AM
Owners added a subscriber: Restricted Owners Package.Mar 10 2018, 1:04 AM
bb updated this revision to Diff 6102.Mar 10 2018, 1:07 AM

failed argument

Vulcan added a subscriber: Vulcan.Mar 10 2018, 2:35 AM

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 (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|  93|  93| 
|  94|  94| 		let playerDescription;
|  95|  95| 		if (isAI)
|  96|    |-		{
|    |  96|+		
|  97|  97| 			if (playerData.Civ)
|  98|  98| 			{
|  99|  99| 				if (isActive)
| 112| 112| 					// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 113| 113| 					playerDescription = translate("%(playerName)s (%(AIdescription)s, %(state)s)");
| 114| 114| 			}
| 115|    |-		}
|    | 115|+		
| 116| 116| 		else
| 117| 117| 		{
| 118| 118| 			if (playerData.Offline)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|  95|  95| 		if (isAI)
|  96|  96| 		{
|  97|  97| 			if (playerData.Civ)
|  98|    |-			{
|    |  98|+			
|  99|  99| 				if (isActive)
| 100| 100| 					// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 101| 101| 					playerDescription = translate("%(playerName)s (%(civ)s, %(AIdescription)s)");
| 102| 102| 				else
| 103| 103| 					// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 104| 104| 					playerDescription = translate("%(playerName)s (%(civ)s, %(AIdescription)s, %(state)s)");
| 105|    |-			}
|    | 105|+			
| 106| 106| 			else
| 107| 107| 			{
| 108| 108| 				if (isActive)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 104| 104| 					playerDescription = translate("%(playerName)s (%(civ)s, %(AIdescription)s, %(state)s)");
| 105| 105| 			}
| 106| 106| 			else
| 107|    |-			{
|    | 107|+			
| 108| 108| 				if (isActive)
| 109| 109| 					// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 					playerDescription = translate("%(playerName)s (%(AIdescription)s)");
| 111| 111| 				else
| 112| 112| 					// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 113| 113| 					playerDescription = translate("%(playerName)s (%(AIdescription)s, %(state)s)");
| 114|    |-			}
|    | 114|+			
| 115| 115| 		}
| 116| 116| 		else
| 117| 117| 		{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 114| 114| 			}
| 115| 115| 		}
| 116| 116| 		else
| 117|    |-		{
|    | 117|+		
| 118| 118| 			if (playerData.Offline)
| 119| 119| 			{
| 120| 120| 				// Can only occur in the lobby for now, so no strings with civ needed
| 142| 142| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 143| 143| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 144| 144| 			}
| 145|    |-		}
|    | 145|+		
| 146| 146| 
| 147| 147| 		// Sort player descriptions by team
| 148| 148| 		if (!playerDescriptions[teamIdx])
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 116| 116| 		else
| 117| 117| 		{
| 118| 118| 			if (playerData.Offline)
| 119|    |-			{
|    | 119|+			
| 120| 120| 				// Can only occur in the lobby for now, so no strings with civ needed
| 121| 121| 				if (isActive)
| 122| 122| 					// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 124| 124| 				else
| 125| 125| 					// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 126| 126| 					playerDescription = translate("%(playerName)s (OFFLINE, %(state)s)");
| 127|    |-			}
|    | 127|+			
| 128| 128| 			else
| 129| 129| 			{
| 130| 130| 				if (playerData.Civ)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 126| 126| 					playerDescription = translate("%(playerName)s (OFFLINE, %(state)s)");
| 127| 127| 			}
| 128| 128| 			else
| 129|    |-			{
|    | 129|+			
| 130| 130| 				if (playerData.Civ)
| 131| 131| 					if (isActive)
| 132| 132| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 141| 141| 					else
| 142| 142| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 143| 143| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 144|    |-			}
|    | 144|+			
| 145| 145| 		}
| 146| 146| 
| 147| 147| 		// Sort player descriptions by team
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 135| 135| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 136| 136| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 137| 137| 				else
| 138|    |-					if (isActive)
|    | 138|+				if (isActive)
| 139| 139| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 140| 140| 						playerDescription = translate("%(playerName)s");
| 141| 141| 					else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 136| 136| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 137| 137| 				else
| 138| 138| 					if (isActive)
| 139|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 139|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 140| 140| 						playerDescription = translate("%(playerName)s");
| 141| 141| 					else
| 142| 142| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 137| 137| 				else
| 138| 138| 					if (isActive)
| 139| 139| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 140|    |-						playerDescription = translate("%(playerName)s");
|    | 140|+					playerDescription = translate("%(playerName)s");
| 141| 141| 					else
| 142| 142| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 143| 143| 						playerDescription = translate("%(playerName)s (%(state)s)");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 138| 138| 					if (isActive)
| 139| 139| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 140| 140| 						playerDescription = translate("%(playerName)s");
| 141|    |-					else
|    | 141|+				else
| 142| 142| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 143| 143| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 144| 144| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 139| 139| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 140| 140| 						playerDescription = translate("%(playerName)s");
| 141| 141| 					else
| 142|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 142|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 143| 143| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 144| 144| 			}
| 145| 145| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 140| 140| 						playerDescription = translate("%(playerName)s");
| 141| 141| 					else
| 142| 142| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 143|    |-						playerDescription = translate("%(playerName)s (%(state)s)");
|    | 143|+					playerDescription = translate("%(playerName)s (%(state)s)");
| 144| 144| 			}
| 145| 145| 		}
| 146| 146| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 354| 354| 		titles.push({
| 355| 355| 			"label": translate("Map Description"),
| 356| 356| 			"value": g_GameAttributes.settings.Description ?
| 357|    |-					translate(g_GameAttributes.settings.Description) :
|    | 357|+				translate(g_GameAttributes.settings.Description) :
| 358| 358| 					translate("Sorry, no description available.")
| 359| 359| 		});
| 360| 360| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 355| 355| 			"label": translate("Map Description"),
| 356| 356| 			"value": g_GameAttributes.settings.Description ?
| 357| 357| 					translate(g_GameAttributes.settings.Description) :
| 358|    |-					translate("Sorry, no description available.")
|    | 358|+				translate("Sorry, no description available.")
| 359| 359| 		});
| 360| 360| 
| 361| 361| 	titles.push({

binaries/data/mods/public/gui/session/menu.js
| 477| »   »   button.onPress·=·(function(player,·stance)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'stance' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 509| »   »   button.onPress·=·(function(i,·resCode,·button)·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 509| »   »   button.onPress·=·(function(i,·resCode,·button)·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'resCode' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 509| »   »   button.onPress·=·(function(i,·resCode,·button)·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'button' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 552| »   button.onPress·=·(function(i)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 618| »   button.onPress·=·(function(i,·button)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 618| »   button.onPress·=·(function(i,·button)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'button' is already declared in the upper scope.

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

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 (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|  93|  93| 
|  94|  94| 		let playerDescription;
|  95|  95| 		if (isAI)
|  96|    |-		{
|    |  96|+		
|  97|  97| 			if (playerData.Civ)
|  98|  98| 			{
|  99|  99| 				if (isActive)
| 112| 112| 					// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 113| 113| 					playerDescription = translate("%(playerName)s (%(AIdescription)s, %(state)s)");
| 114| 114| 			}
| 115|    |-		}
|    | 115|+		
| 116| 116| 		else
| 117| 117| 		{
| 118| 118| 			if (playerData.Offline)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|  95|  95| 		if (isAI)
|  96|  96| 		{
|  97|  97| 			if (playerData.Civ)
|  98|    |-			{
|    |  98|+			
|  99|  99| 				if (isActive)
| 100| 100| 					// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 101| 101| 					playerDescription = translate("%(playerName)s (%(civ)s, %(AIdescription)s)");
| 102| 102| 				else
| 103| 103| 					// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 104| 104| 					playerDescription = translate("%(playerName)s (%(civ)s, %(AIdescription)s, %(state)s)");
| 105|    |-			}
|    | 105|+			
| 106| 106| 			else
| 107| 107| 			{
| 108| 108| 				if (isActive)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 104| 104| 					playerDescription = translate("%(playerName)s (%(civ)s, %(AIdescription)s, %(state)s)");
| 105| 105| 			}
| 106| 106| 			else
| 107|    |-			{
|    | 107|+			
| 108| 108| 				if (isActive)
| 109| 109| 					// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 					playerDescription = translate("%(playerName)s (%(AIdescription)s)");
| 111| 111| 				else
| 112| 112| 					// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 113| 113| 					playerDescription = translate("%(playerName)s (%(AIdescription)s, %(state)s)");
| 114|    |-			}
|    | 114|+			
| 115| 115| 		}
| 116| 116| 		else
| 117| 117| 		{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 114| 114| 			}
| 115| 115| 		}
| 116| 116| 		else
| 117|    |-		{
|    | 117|+		
| 118| 118| 			if (playerData.Offline)
| 119| 119| 			{
| 120| 120| 				// Can only occur in the lobby for now, so no strings with civ needed
| 142| 142| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 143| 143| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 144| 144| 			}
| 145|    |-		}
|    | 145|+		
| 146| 146| 
| 147| 147| 		// Sort player descriptions by team
| 148| 148| 		if (!playerDescriptions[teamIdx])
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 116| 116| 		else
| 117| 117| 		{
| 118| 118| 			if (playerData.Offline)
| 119|    |-			{
|    | 119|+			
| 120| 120| 				// Can only occur in the lobby for now, so no strings with civ needed
| 121| 121| 				if (isActive)
| 122| 122| 					// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 124| 124| 				else
| 125| 125| 					// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 126| 126| 					playerDescription = translate("%(playerName)s (OFFLINE, %(state)s)");
| 127|    |-			}
|    | 127|+			
| 128| 128| 			else
| 129| 129| 			{
| 130| 130| 				if (playerData.Civ)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 126| 126| 					playerDescription = translate("%(playerName)s (OFFLINE, %(state)s)");
| 127| 127| 			}
| 128| 128| 			else
| 129|    |-			{
|    | 129|+			
| 130| 130| 				if (playerData.Civ)
| 131| 131| 					if (isActive)
| 132| 132| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 141| 141| 					else
| 142| 142| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 143| 143| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 144|    |-			}
|    | 144|+			
| 145| 145| 		}
| 146| 146| 
| 147| 147| 		// Sort player descriptions by team
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 135| 135| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 136| 136| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 137| 137| 				else
| 138|    |-					if (isActive)
|    | 138|+				if (isActive)
| 139| 139| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 140| 140| 						playerDescription = translate("%(playerName)s");
| 141| 141| 					else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 136| 136| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 137| 137| 				else
| 138| 138| 					if (isActive)
| 139|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 139|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 140| 140| 						playerDescription = translate("%(playerName)s");
| 141| 141| 					else
| 142| 142| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 137| 137| 				else
| 138| 138| 					if (isActive)
| 139| 139| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 140|    |-						playerDescription = translate("%(playerName)s");
|    | 140|+					playerDescription = translate("%(playerName)s");
| 141| 141| 					else
| 142| 142| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 143| 143| 						playerDescription = translate("%(playerName)s (%(state)s)");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 138| 138| 					if (isActive)
| 139| 139| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 140| 140| 						playerDescription = translate("%(playerName)s");
| 141|    |-					else
|    | 141|+				else
| 142| 142| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 143| 143| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 144| 144| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 139| 139| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 140| 140| 						playerDescription = translate("%(playerName)s");
| 141| 141| 					else
| 142|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 142|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 143| 143| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 144| 144| 			}
| 145| 145| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 140| 140| 						playerDescription = translate("%(playerName)s");
| 141| 141| 					else
| 142| 142| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 143|    |-						playerDescription = translate("%(playerName)s (%(state)s)");
|    | 143|+					playerDescription = translate("%(playerName)s (%(state)s)");
| 144| 144| 			}
| 145| 145| 		}
| 146| 146| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 354| 354| 		titles.push({
| 355| 355| 			"label": translate("Map Description"),
| 356| 356| 			"value": g_GameAttributes.settings.Description ?
| 357|    |-					translate(g_GameAttributes.settings.Description) :
|    | 357|+				translate(g_GameAttributes.settings.Description) :
| 358| 358| 					translate("Sorry, no description available.")
| 359| 359| 		});
| 360| 360| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 355| 355| 			"label": translate("Map Description"),
| 356| 356| 			"value": g_GameAttributes.settings.Description ?
| 357| 357| 					translate(g_GameAttributes.settings.Description) :
| 358|    |-					translate("Sorry, no description available.")
|    | 358|+				translate("Sorry, no description available.")
| 359| 359| 		});
| 360| 360| 
| 361| 361| 	titles.push({

binaries/data/mods/public/gui/session/menu.js
| 477| »   »   button.onPress·=·(function(player,·stance)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'stance' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 509| »   »   button.onPress·=·(function(i,·resCode,·button)·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 509| »   »   button.onPress·=·(function(i,·resCode,·button)·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'resCode' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 509| »   »   button.onPress·=·(function(i,·resCode,·button)·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'button' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 552| »   button.onPress·=·(function(i)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 618| »   button.onPress·=·(function(i,·button)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 618| »   button.onPress·=·(function(i,·button)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'button' is already declared in the upper scope.

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

bb updated this revision to Diff 6145.Mar 11 2018, 8:18 PM

changes to biome

elexis accepted this revision.Mar 11 2018, 11:53 PM
elexis added a subscriber: elexis.

map biome should be listed above nomad, since its a more map specific option.

This feature is actually very good for multiplayer I believe.

We can later colorize the things that changed in the last 5 seconds to solve the "something has changed" problem!

Tested in gamesetup and session = all places it's used and they always have complete knowledge of the gamesettings.

binaries/data/mods/public/gui/common/gamedescription.js
287 ↗(On Diff #6145)

(Meh, we didn'T fix this)

330 ↗(On Diff #6145)

IMO cleaner to either use an if-else statement or push g_GameAttributes.map == "random" ? {...} : {...}

Unify it with the other g_GameAttributes.map == "random" condition, not possible, but maybe an a bool isRandomMap to reuse

337 ↗(On Diff #6145)

if (!g_MapFilterList)?

387 ↗(On Diff #6145)

refs ticket about starting resources depending property on maptype

This revision is now accepted and ready to land.Mar 11 2018, 11:53 PM
bb marked an inline comment as done.Mar 12 2018, 1:08 AM
bb added inline comments.
binaries/data/mods/public/gui/common/gamedescription.js
337 ↗(On Diff #6145)

nope is not "undefined", but when in session it is undeclared to checking if (g_MapFilterList) crashes

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 (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|  93|  93| 
|  94|  94| 		let playerDescription;
|  95|  95| 		if (isAI)
|  96|    |-		{
|    |  96|+		
|  97|  97| 			if (playerData.Civ)
|  98|  98| 			{
|  99|  99| 				if (isActive)
| 112| 112| 					// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 113| 113| 					playerDescription = translate("%(playerName)s (%(AIdescription)s, %(state)s)");
| 114| 114| 			}
| 115|    |-		}
|    | 115|+		
| 116| 116| 		else
| 117| 117| 		{
| 118| 118| 			if (playerData.Offline)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|  95|  95| 		if (isAI)
|  96|  96| 		{
|  97|  97| 			if (playerData.Civ)
|  98|    |-			{
|    |  98|+			
|  99|  99| 				if (isActive)
| 100| 100| 					// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 101| 101| 					playerDescription = translate("%(playerName)s (%(civ)s, %(AIdescription)s)");
| 102| 102| 				else
| 103| 103| 					// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 104| 104| 					playerDescription = translate("%(playerName)s (%(civ)s, %(AIdescription)s, %(state)s)");
| 105|    |-			}
|    | 105|+			
| 106| 106| 			else
| 107| 107| 			{
| 108| 108| 				if (isActive)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 104| 104| 					playerDescription = translate("%(playerName)s (%(civ)s, %(AIdescription)s, %(state)s)");
| 105| 105| 			}
| 106| 106| 			else
| 107|    |-			{
|    | 107|+			
| 108| 108| 				if (isActive)
| 109| 109| 					// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 					playerDescription = translate("%(playerName)s (%(AIdescription)s)");
| 111| 111| 				else
| 112| 112| 					// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 113| 113| 					playerDescription = translate("%(playerName)s (%(AIdescription)s, %(state)s)");
| 114|    |-			}
|    | 114|+			
| 115| 115| 		}
| 116| 116| 		else
| 117| 117| 		{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 114| 114| 			}
| 115| 115| 		}
| 116| 116| 		else
| 117|    |-		{
|    | 117|+		
| 118| 118| 			if (playerData.Offline)
| 119| 119| 			{
| 120| 120| 				// Can only occur in the lobby for now, so no strings with civ needed
| 142| 142| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 143| 143| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 144| 144| 			}
| 145|    |-		}
|    | 145|+		
| 146| 146| 
| 147| 147| 		// Sort player descriptions by team
| 148| 148| 		if (!playerDescriptions[teamIdx])
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 116| 116| 		else
| 117| 117| 		{
| 118| 118| 			if (playerData.Offline)
| 119|    |-			{
|    | 119|+			
| 120| 120| 				// Can only occur in the lobby for now, so no strings with civ needed
| 121| 121| 				if (isActive)
| 122| 122| 					// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 124| 124| 				else
| 125| 125| 					// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 126| 126| 					playerDescription = translate("%(playerName)s (OFFLINE, %(state)s)");
| 127|    |-			}
|    | 127|+			
| 128| 128| 			else
| 129| 129| 			{
| 130| 130| 				if (playerData.Civ)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 126| 126| 					playerDescription = translate("%(playerName)s (OFFLINE, %(state)s)");
| 127| 127| 			}
| 128| 128| 			else
| 129|    |-			{
|    | 129|+			
| 130| 130| 				if (playerData.Civ)
| 131| 131| 					if (isActive)
| 132| 132| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 141| 141| 					else
| 142| 142| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 143| 143| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 144|    |-			}
|    | 144|+			
| 145| 145| 		}
| 146| 146| 
| 147| 147| 		// Sort player descriptions by team
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 135| 135| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 136| 136| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 137| 137| 				else
| 138|    |-					if (isActive)
|    | 138|+				if (isActive)
| 139| 139| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 140| 140| 						playerDescription = translate("%(playerName)s");
| 141| 141| 					else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 136| 136| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 137| 137| 				else
| 138| 138| 					if (isActive)
| 139|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 139|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 140| 140| 						playerDescription = translate("%(playerName)s");
| 141| 141| 					else
| 142| 142| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 137| 137| 				else
| 138| 138| 					if (isActive)
| 139| 139| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 140|    |-						playerDescription = translate("%(playerName)s");
|    | 140|+					playerDescription = translate("%(playerName)s");
| 141| 141| 					else
| 142| 142| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 143| 143| 						playerDescription = translate("%(playerName)s (%(state)s)");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 138| 138| 					if (isActive)
| 139| 139| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 140| 140| 						playerDescription = translate("%(playerName)s");
| 141|    |-					else
|    | 141|+				else
| 142| 142| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 143| 143| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 144| 144| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 139| 139| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 140| 140| 						playerDescription = translate("%(playerName)s");
| 141| 141| 					else
| 142|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 142|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 143| 143| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 144| 144| 			}
| 145| 145| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 140| 140| 						playerDescription = translate("%(playerName)s");
| 141| 141| 					else
| 142| 142| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 143|    |-						playerDescription = translate("%(playerName)s (%(state)s)");
|    | 143|+					playerDescription = translate("%(playerName)s (%(state)s)");
| 144| 144| 			}
| 145| 145| 		}
| 146| 146| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 354| 354| 		titles.push({
| 355| 355| 			"label": translate("Map Description"),
| 356| 356| 			"value": g_GameAttributes.settings.Description ?
| 357|    |-					translate(g_GameAttributes.settings.Description) :
|    | 357|+				translate(g_GameAttributes.settings.Description) :
| 358| 358| 					translate("Sorry, no description available.")
| 359| 359| 		});
| 360| 360| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/gamedescription.js
| 355| 355| 			"label": translate("Map Description"),
| 356| 356| 			"value": g_GameAttributes.settings.Description ?
| 357| 357| 					translate(g_GameAttributes.settings.Description) :
| 358|    |-					translate("Sorry, no description available.")
|    | 358|+				translate("Sorry, no description available.")
| 359| 359| 		});
| 360| 360| 
| 361| 361| 	titles.push({

binaries/data/mods/public/gui/session/menu.js
| 477| »   »   button.onPress·=·(function(player,·stance)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'stance' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 509| »   »   button.onPress·=·(function(i,·resCode,·button)·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 509| »   »   button.onPress·=·(function(i,·resCode,·button)·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'resCode' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 509| »   »   button.onPress·=·(function(i,·resCode,·button)·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'button' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 552| »   button.onPress·=·(function(i)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 618| »   button.onPress·=·(function(i,·button)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 618| »   button.onPress·=·(function(i,·button)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'button' is already declared in the upper scope.

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

This revision was automatically updated to reflect the committed changes.