Page MenuHomeWildfire Games

Support player assigning idle villagers with a command button.
Needs ReviewPublic

Authored by Freagarach on Oct 28 2019, 9:28 AM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

This adds a command button which, once clicked, assigns an idle villager to the entity. A foundation or repairable entity: "repair", a resource: gather.
Pressing the "assignall"-hotkey sends all idle villagers to the task at hand.

Depends on D2343 for resources.

Test Plan

Current (expected) behaviour:

  • When clicked with a single foundation an idle villager gets to work.
  • When clicked with multiple foundations selected, each foundation gets its own assigned villager. (But they should all keep the other foundations in queue because it may be that there are more foundations than idlers.)
  • When clicked with a single foundation with hotkey all idle villagers get to work.
  • When clicked with multiple foundations selected and with the hotkey all idle villagers get to work on the first foundation. (This should probably split the idlers over the foundations, but they should all keep the other foundations in queue because it may be that there are more foundations than idlers.)

Foundation could be replaced with other actions in the list above.

Event Timeline

Freagarach created this revision.Oct 28 2019, 9:28 AM
Owners added a subscriber: Restricted Owners Package.Oct 28 2019, 9:28 AM

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

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

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels.js
| 762| 762| 				addResearchToQueue(data.item.researchFacilityId, t);
| 763| 763| 			})(tech);
| 764| 764| 
| 765|    |-			button.onPressRight = (t => function () {
|    | 765|+			button.onPressRight = (t => function() {
| 766| 766| 				showTemplateDetails(
| 767| 767| 					t,
| 768| 768| 					GetTemplateData(data.unitEntStates.find(state => state.id == data.item.researchFacilityId).template).nativeCiv);

binaries/data/mods/public/gui/session/selection_panels.js
|  50| »   »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
|  61| »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
| 730| »   »   »   »   »   »   switch·(entity.check)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1024|1024| 			// This should return a tooltip explaining that one does not have any
|1025|1025| 			// idle villies, with a disabled button. Like "delete".
|1026|1026| 			if (!Engine.GuiInterfaceCall("HasIdleUnits", {
|1027|    |-					"viewedPlayer": g_ViewedPlayer,
|    |1027|+				"viewedPlayer": g_ViewedPlayer,
|1028|1028| 					"idleClasses": g_WorkerTypes,
|1029|1029| 					"excludeUnits": []
|1030|1030| 				}))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1025|1025| 			// idle villies, with a disabled button. Like "delete".
|1026|1026| 			if (!Engine.GuiInterfaceCall("HasIdleUnits", {
|1027|1027| 					"viewedPlayer": g_ViewedPlayer,
|1028|    |-					"idleClasses": g_WorkerTypes,
|    |1028|+				"idleClasses": g_WorkerTypes,
|1029|1029| 					"excludeUnits": []
|1030|1030| 				}))
|1031|1031| 				return {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1026|1026| 			if (!Engine.GuiInterfaceCall("HasIdleUnits", {
|1027|1027| 					"viewedPlayer": g_ViewedPlayer,
|1028|1028| 					"idleClasses": g_WorkerTypes,
|1029|    |-					"excludeUnits": []
|    |1029|+				"excludeUnits": []
|1030|1030| 				}))
|1031|1031| 				return {
|1032|1032| 					"tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.assignidlevillager") +
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1027|1027| 					"viewedPlayer": g_ViewedPlayer,
|1028|1028| 					"idleClasses": g_WorkerTypes,
|1029|1029| 					"excludeUnits": []
|1030|    |-				}))
|    |1030|+			}))
|1031|1031| 				return {
|1032|1032| 					"tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.assignidlevillager") +
|1033|1033| 					           translate("There are no idle villagers to assign.."),
|    | [NORMAL] ESLintBear (no-extra-semi):
|    | Unnecessary semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1130|1130| 							resumeGame();
|1131|1131| 						}
|1132|1132| 					]);
|1133|    |-			};
|    |1133|+			}
|1134|1134| 		},
|1135|1135| 	},
|1136|1136| 

binaries/data/mods/public/gui/session/unit_actions.js
| 557| »   »   »   switch·(tradingDetails.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/unit_actions.js
|1133| »   »   »   };
|    | [NORMAL] JSHintBear:
|    | Unnecessary semicolon.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 282| 282| 			if (cmpFoundation || cmpRepairable)
| 283| 283| 			{
| 284| 284| 				filteredWorkers = workers.filter(worker => {
| 285|    |-						let cmpUnitAI = Engine.QueryInterface(worker, IID_UnitAI);
|    | 285|+					let cmpUnitAI = Engine.QueryInterface(worker, IID_UnitAI);
| 286| 286| 						return cmpUnitAI && cmpUnitAI.CanRepair(entity);
| 287| 287| 					})
| 288| 288| 				action = "repair";
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 283| 283| 			{
| 284| 284| 				filteredWorkers = workers.filter(worker => {
| 285| 285| 						let cmpUnitAI = Engine.QueryInterface(worker, IID_UnitAI);
| 286|    |-						return cmpUnitAI && cmpUnitAI.CanRepair(entity);
|    | 286|+					return cmpUnitAI && cmpUnitAI.CanRepair(entity);
| 287| 287| 					})
| 288| 288| 				action = "repair";
| 289| 289| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 284| 284| 				filteredWorkers = workers.filter(worker => {
| 285| 285| 						let cmpUnitAI = Engine.QueryInterface(worker, IID_UnitAI);
| 286| 286| 						return cmpUnitAI && cmpUnitAI.CanRepair(entity);
| 287|    |-					})
|    | 287|+				})
| 288| 288| 				action = "repair";
| 289| 289| 			}
| 290| 290| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 284| 284| 				filteredWorkers = workers.filter(worker => {
| 285| 285| 						let cmpUnitAI = Engine.QueryInterface(worker, IID_UnitAI);
| 286| 286| 						return cmpUnitAI && cmpUnitAI.CanRepair(entity);
| 287|    |-					})
|    | 287|+					});
| 288| 288| 				action = "repair";
| 289| 289| 			}
| 290| 290| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 292| 292| 			if (cmpResourceSupply && cmpResourceSupply.GetCurrentAmount() > 0 && cmpResourceSupply.GetFreeSpots() > 0)
| 293| 293| 			{
| 294| 294| 				filteredWorkers = workers.filter(worker => {
| 295|    |-						let cmpUnitAI = Engine.QueryInterface(worker, IID_UnitAI);
|    | 295|+					let cmpUnitAI = Engine.QueryInterface(worker, IID_UnitAI);
| 296| 296| 						return cmpUnitAI && cmpUnitAI.CanGather(entity);
| 297| 297| 					}).slice(0, cmpResourceSupply.GetFreeSpots());
| 298| 298| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 293| 293| 			{
| 294| 294| 				filteredWorkers = workers.filter(worker => {
| 295| 295| 						let cmpUnitAI = Engine.QueryInterface(worker, IID_UnitAI);
| 296|    |-						return cmpUnitAI && cmpUnitAI.CanGather(entity);
|    | 296|+					return cmpUnitAI && cmpUnitAI.CanGather(entity);
| 297| 297| 					}).slice(0, cmpResourceSupply.GetFreeSpots());
| 298| 298| 
| 299| 299| 				action = "gather";
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 294| 294| 				filteredWorkers = workers.filter(worker => {
| 295| 295| 						let cmpUnitAI = Engine.QueryInterface(worker, IID_UnitAI);
| 296| 296| 						return cmpUnitAI && cmpUnitAI.CanGather(entity);
| 297|    |-					}).slice(0, cmpResourceSupply.GetFreeSpots());
|    | 297|+				}).slice(0, cmpResourceSupply.GetFreeSpots());
| 298| 298| 
| 299| 299| 				action = "gather";
| 300| 300| 			}
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 593| 593| 			if (cmpGarrisonHolder)
| 594| 594| 			{
| 595| 595| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 596|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 597|    |-				    && player != +cmd.owner)
|    | 596|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 597|+				    player != +cmd.owner)
| 598| 598| 						continue;
| 599| 599| 
| 600| 600| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 595| 595| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 596| 596| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 597| 597| 				    && player != +cmd.owner)
| 598|    |-						continue;
|    | 598|+					continue;
| 599| 599| 
| 600| 600| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 601| 601| 					notifyUnloadFailure(player, garrisonHolder);
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'metadata'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1213|1213| 
|1214|1214| 	// send Metadata info if any
|1215|1215| 	if (cmd.metadata)
|1216|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1216|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1217|1217| 
|1218|1218| 	// Tell the units to start building this new entity
|1219|1219| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'owner'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1213|1213| 
|1214|1214| 	// send Metadata info if any
|1215|1215| 	if (cmd.metadata)
|1216|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1216|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1217|1217| 
|1218|1218| 	// Tell the units to start building this new entity
|1219|1219| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (space-in-parens):
|    | There should be no spaces inside this paren.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1213|1213| 
|1214|1214| 	// send Metadata info if any
|1215|1215| 	if (cmd.metadata)
|1216|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1216|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1217|1217| 
|1218|1218| 	// Tell the units to start building this new entity
|1219|1219| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1321|1321| 		}
|1322|1322| 
|1323|1323| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1324|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1324|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1325|1325| 	}
|1326|1326| 
|1327|1327| 	var i = 0;
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1385|1385| 
|1386|1386| 				if (i > 0)
|1387|1387| 				{
|1388|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1388|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1389|1389| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1390|1390| 					// TODO: ensure that cmpPreviousObstruction exists
|1391|1391| 					// TODO: ensure that the previous obstruction does not yet have a secondary control group set
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1548|1548| 		// Check that all its members are selected
|1549|1549| 		var fid = formationIds[0];
|1550|1550| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1551|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1552|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1551|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1552|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1553|1553| 		{
|1554|1554| 			cmpFormation.DeleteTwinFormations();
|1555|1555| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1656|1656| 		for (var i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1657|1657| 			for (var j = i - 1; j >= 0 && !closeClusters; --j)
|1658|1658| 				if (matrix[i][j] < distSq)
|1659|    |-					closeClusters = [i,j];
|    |1659|+					closeClusters = [i, j];
|1660|1660| 
|1661|1661| 		// if no more close clusters found, just return all found clusters so far
|1662|1662| 		if (!closeClusters)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1678|1678| 		}
|1679|1679| 		// remove the rows and columns in the matrix for the merged clusters,
|1680|1680| 		// and the clusters themselves from the cluster list
|1681|    |-		clusters.splice(closeClusters[0],1);
|    |1681|+		clusters.splice(closeClusters[0], 1);
|1682|1682| 		clusters.splice(closeClusters[1],1);
|1683|1683| 		matrix.splice(closeClusters[0],1);
|1684|1684| 		matrix.splice(closeClusters[1],1);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1679|1679| 		// remove the rows and columns in the matrix for the merged clusters,
|1680|1680| 		// and the clusters themselves from the cluster list
|1681|1681| 		clusters.splice(closeClusters[0],1);
|1682|    |-		clusters.splice(closeClusters[1],1);
|    |1682|+		clusters.splice(closeClusters[1], 1);
|1683|1683| 		matrix.splice(closeClusters[0],1);
|1684|1684| 		matrix.splice(closeClusters[1],1);
|1685|1685| 		for (let i = 0; i < matrix.length; ++i)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1680|1680| 		// and the clusters themselves from the cluster list
|1681|1681| 		clusters.splice(closeClusters[0],1);
|1682|1682| 		clusters.splice(closeClusters[1],1);
|1683|    |-		matrix.splice(closeClusters[0],1);
|    |1683|+		matrix.splice(closeClusters[0], 1);
|1684|1684| 		matrix.splice(closeClusters[1],1);
|1685|1685| 		for (let i = 0; i < matrix.length; ++i)
|1686|1686| 		{
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1681|1681| 		clusters.splice(closeClusters[0],1);
|1682|1682| 		clusters.splice(closeClusters[1],1);
|1683|1683| 		matrix.splice(closeClusters[0],1);
|1684|    |-		matrix.splice(closeClusters[1],1);
|    |1684|+		matrix.splice(closeClusters[1], 1);
|1685|1685| 		for (let i = 0; i < matrix.length; ++i)
|1686|1686| 		{
|1687|1687| 			if (matrix[i].length > closeClusters[0])
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1685|1685| 		for (let i = 0; i < matrix.length; ++i)
|1686|1686| 		{
|1687|1687| 			if (matrix[i].length > closeClusters[0])
|1688|    |-				matrix[i].splice(closeClusters[0],1);
|    |1688|+				matrix[i].splice(closeClusters[0], 1);
|1689|1689| 			if (matrix[i].length > closeClusters[1])
|1690|1690| 				matrix[i].splice(closeClusters[1],1);
|1691|1691| 		}
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1687|1687| 			if (matrix[i].length > closeClusters[0])
|1688|1688| 				matrix[i].splice(closeClusters[0],1);
|1689|1689| 			if (matrix[i].length > closeClusters[1])
|1690|    |-				matrix[i].splice(closeClusters[1],1);
|    |1690|+				matrix[i].splice(closeClusters[1], 1);
|1691|1691| 		}
|1692|1692| 		// add a new row of distances to the matrix and the new cluster
|1693|1693| 		clusters.push(newCluster);

binaries/data/mods/public/simulation/helpers/Commands.js
|  43| »   if·(g_Commands[cmd.type])
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|  47| »   »   g_Commands[cmd.type](player,·cmd,·data);
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 845| »   »   let·ent·=·pickRandom(cmpRangeManager.GetEntitiesByPlayer(cmd.player).filter(ent·=>·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Commands.js
|1344| ····»   »   »   error("[TryConstructWall]·Expected·last·tower·control·group·to·be·available,·none·found·(1st·pass,·iteration·"·+·i·+·")");
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1345| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1575| »   »   »   »   var·lastFormationTemplate·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'lastFormationTemplate' to undefined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1654| »   »   var·closeClusters·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'closeClusters' to undefined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1671| »   »   for·(let·i·=·0;·i·<·clusters.length;·++i)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Commands.js
|1685| »   »   for·(let·i·=·0;·i·<·matrix.length;·++i)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Commands.js
|  53| var·g_Commands·=·{
|    | [NORMAL] JSHintBear:
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 287| »   »   »   »   »   })
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/helpers/Commands.js
| 597| »   »   »   »   ····&&·player·!=·+cmd.owner)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
| 785| »   »   »   »   var·cmpGUIInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGUIInterface' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1018| »   »   for·(var·i·=·0;·i·<·length;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1031| »   »   var·count·=·0;
|    | [NORMAL] JSHintBear:
|    | 'count' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1178| »   »   var·cmpGuiInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGuiInterface' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1430| »   »   var·piece·=·pieces[j];
|    | [NORMAL] JSHintBear:
|    | 'piece' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1513| »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1552| »   »   »   &&·cmpFormation.GetMemberCount()·==·formation.entities.length)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
|1578| »   »   »   »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1611| »   »   »   var·cmpFormation·=·Engine.QueryInterface(formationEnt,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js
| 358| 358| function assignIdleVillager(entities, all)
| 359| 359| {
| 360| 360| 	let workers = Engine.GuiInterfaceCall("FindIdleUnits", {
| 361|    |-			"idleClasses": g_WorkerTypes,
|    | 361|+		"idleClasses": g_WorkerTypes,
| 362| 362| 			"excludeUnits": []
| 363| 363| 		});
| 364| 364| 	Engine.PostNetworkCommand({
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js
| 359| 359| {
| 360| 360| 	let workers = Engine.GuiInterfaceCall("FindIdleUnits", {
| 361| 361| 			"idleClasses": g_WorkerTypes,
| 362|    |-			"excludeUnits": []
|    | 362|+		"excludeUnits": []
| 363| 363| 		});
| 364| 364| 	Engine.PostNetworkCommand({
| 365| 365| 		"type": "assign-idle-villager",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js
| 360| 360| 	let workers = Engine.GuiInterfaceCall("FindIdleUnits", {
| 361| 361| 			"idleClasses": g_WorkerTypes,
| 362| 362| 			"excludeUnits": []
| 363|    |-		});
|    | 363|+	});
| 364| 364| 	Engine.PostNetworkCommand({
| 365| 365| 		"type": "assign-idle-villager",
| 366| 366| 		"entities": entities,
Executing section cli...

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

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js
| 358| 358| function assignIdleVillager(entities, all)
| 359| 359| {
| 360| 360| 	let workers = Engine.GuiInterfaceCall("FindIdleUnits", {
| 361|    |-			"idleClasses": g_WorkerTypes,
|    | 361|+		"idleClasses": g_WorkerTypes,
| 362| 362| 			"excludeUnits": []
| 363| 363| 		});
| 364| 364| 	Engine.PostNetworkCommand({
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js
| 359| 359| {
| 360| 360| 	let workers = Engine.GuiInterfaceCall("FindIdleUnits", {
| 361| 361| 			"idleClasses": g_WorkerTypes,
| 362|    |-			"excludeUnits": []
|    | 362|+		"excludeUnits": []
| 363| 363| 		});
| 364| 364| 	Engine.PostNetworkCommand({
| 365| 365| 		"type": "assign-idle-villager",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js
| 360| 360| 	let workers = Engine.GuiInterfaceCall("FindIdleUnits", {
| 361| 361| 			"idleClasses": g_WorkerTypes,
| 362| 362| 			"excludeUnits": []
| 363|    |-		});
|    | 363|+	});
| 364| 364| 	Engine.PostNetworkCommand({
| 365| 365| 		"type": "assign-idle-villager",
| 366| 366| 		"entities": entities,
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels.js
| 762| 762| 				addResearchToQueue(data.item.researchFacilityId, t);
| 763| 763| 			})(tech);
| 764| 764| 
| 765|    |-			button.onPressRight = (t => function () {
|    | 765|+			button.onPressRight = (t => function() {
| 766| 766| 				showTemplateDetails(
| 767| 767| 					t,
| 768| 768| 					GetTemplateData(data.unitEntStates.find(state => state.id == data.item.researchFacilityId).template).nativeCiv);

binaries/data/mods/public/gui/session/selection_panels.js
|  50| »   »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
|  61| »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
| 730| »   »   »   »   »   »   switch·(entity.check)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 282| 282| 			if (cmpFoundation || cmpRepairable)
| 283| 283| 			{
| 284| 284| 				filteredWorkers = workers.filter(worker => {
| 285|    |-						let cmpUnitAI = Engine.QueryInterface(worker, IID_UnitAI);
|    | 285|+					let cmpUnitAI = Engine.QueryInterface(worker, IID_UnitAI);
| 286| 286| 						return cmpUnitAI && cmpUnitAI.CanRepair(entity);
| 287| 287| 					})
| 288| 288| 				action = "repair";
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 283| 283| 			{
| 284| 284| 				filteredWorkers = workers.filter(worker => {
| 285| 285| 						let cmpUnitAI = Engine.QueryInterface(worker, IID_UnitAI);
| 286|    |-						return cmpUnitAI && cmpUnitAI.CanRepair(entity);
|    | 286|+					return cmpUnitAI && cmpUnitAI.CanRepair(entity);
| 287| 287| 					})
| 288| 288| 				action = "repair";
| 289| 289| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 284| 284| 				filteredWorkers = workers.filter(worker => {
| 285| 285| 						let cmpUnitAI = Engine.QueryInterface(worker, IID_UnitAI);
| 286| 286| 						return cmpUnitAI && cmpUnitAI.CanRepair(entity);
| 287|    |-					})
|    | 287|+				})
| 288| 288| 				action = "repair";
| 289| 289| 			}
| 290| 290| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 284| 284| 				filteredWorkers = workers.filter(worker => {
| 285| 285| 						let cmpUnitAI = Engine.QueryInterface(worker, IID_UnitAI);
| 286| 286| 						return cmpUnitAI && cmpUnitAI.CanRepair(entity);
| 287|    |-					})
|    | 287|+					});
| 288| 288| 				action = "repair";
| 289| 289| 			}
| 290| 290| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 292| 292| 			if (cmpResourceSupply && cmpResourceSupply.GetCurrentAmount() > 0 && cmpResourceSupply.GetFreeSpots() > 0)
| 293| 293| 			{
| 294| 294| 				filteredWorkers = workers.filter(worker => {
| 295|    |-						let cmpUnitAI = Engine.QueryInterface(worker, IID_UnitAI);
|    | 295|+					let cmpUnitAI = Engine.QueryInterface(worker, IID_UnitAI);
| 296| 296| 						return cmpUnitAI && cmpUnitAI.CanGather(entity);
| 297| 297| 					}).slice(0, cmpResourceSupply.GetFreeSpots());
| 298| 298| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 293| 293| 			{
| 294| 294| 				filteredWorkers = workers.filter(worker => {
| 295| 295| 						let cmpUnitAI = Engine.QueryInterface(worker, IID_UnitAI);
| 296|    |-						return cmpUnitAI && cmpUnitAI.CanGather(entity);
|    | 296|+					return cmpUnitAI && cmpUnitAI.CanGather(entity);
| 297| 297| 					}).slice(0, cmpResourceSupply.GetFreeSpots());
| 298| 298| 
| 299| 299| 				action = "gather";
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 294| 294| 				filteredWorkers = workers.filter(worker => {
| 295| 295| 						let cmpUnitAI = Engine.QueryInterface(worker, IID_UnitAI);
| 296| 296| 						return cmpUnitAI && cmpUnitAI.CanGather(entity);
| 297|    |-					}).slice(0, cmpResourceSupply.GetFreeSpots());
|    | 297|+				}).slice(0, cmpResourceSupply.GetFreeSpots());
| 298| 298| 
| 299| 299| 				action = "gather";
| 300| 300| 			}
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 593| 593| 			if (cmpGarrisonHolder)
| 594| 594| 			{
| 595| 595| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 596|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 597|    |-				    && player != +cmd.owner)
|    | 596|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 597|+				    player != +cmd.owner)
| 598| 598| 						continue;
| 599| 599| 
| 600| 600| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 595| 595| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 596| 596| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 597| 597| 				    && player != +cmd.owner)
| 598|    |-						continue;
|    | 598|+					continue;
| 599| 599| 
| 600| 600| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 601| 601| 					notifyUnloadFailure(player, garrisonHolder);
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'metadata'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1213|1213| 
|1214|1214| 	// send Metadata info if any
|1215|1215| 	if (cmd.metadata)
|1216|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1216|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1217|1217| 
|1218|1218| 	// Tell the units to start building this new entity
|1219|1219| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'owner'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1213|1213| 
|1214|1214| 	// send Metadata info if any
|1215|1215| 	if (cmd.metadata)
|1216|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1216|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1217|1217| 
|1218|1218| 	// Tell the units to start building this new entity
|1219|1219| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (space-in-parens):
|    | There should be no spaces inside this paren.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1213|1213| 
|1214|1214| 	// send Metadata info if any
|1215|1215| 	if (cmd.metadata)
|1216|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1216|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1217|1217| 
|1218|1218| 	// Tell the units to start building this new entity
|1219|1219| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1321|1321| 		}
|1322|1322| 
|1323|1323| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1324|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1324|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1325|1325| 	}
|1326|1326| 
|1327|1327| 	var i = 0;
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1385|1385| 
|1386|1386| 				if (i > 0)
|1387|1387| 				{
|1388|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1388|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1389|1389| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1390|1390| 					// TODO: ensure that cmpPreviousObstruction exists
|1391|1391| 					// TODO: ensure that the previous obstruction does not yet have a secondary control group set
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1548|1548| 		// Check that all its members are selected
|1549|1549| 		var fid = formationIds[0];
|1550|1550| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1551|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1552|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1551|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1552|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1553|1553| 		{
|1554|1554| 			cmpFormation.DeleteTwinFormations();
|1555|1555| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1656|1656| 		for (var i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1657|1657| 			for (var j = i - 1; j >= 0 && !closeClusters; --j)
|1658|1658| 				if (matrix[i][j] < distSq)
|1659|    |-					closeClusters = [i,j];
|    |1659|+					closeClusters = [i, j];
|1660|1660| 
|1661|1661| 		// if no more close clusters found, just return all found clusters so far
|1662|1662| 		if (!closeClusters)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1678|1678| 		}
|1679|1679| 		// remove the rows and columns in the matrix for the merged clusters,
|1680|1680| 		// and the clusters themselves from the cluster list
|1681|    |-		clusters.splice(closeClusters[0],1);
|    |1681|+		clusters.splice(closeClusters[0], 1);
|1682|1682| 		clusters.splice(closeClusters[1],1);
|1683|1683| 		matrix.splice(closeClusters[0],1);
|1684|1684| 		matrix.splice(closeClusters[1],1);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1679|1679| 		// remove the rows and columns in the matrix for the merged clusters,
|1680|1680| 		// and the clusters themselves from the cluster list
|1681|1681| 		clusters.splice(closeClusters[0],1);
|1682|    |-		clusters.splice(closeClusters[1],1);
|    |1682|+		clusters.splice(closeClusters[1], 1);
|1683|1683| 		matrix.splice(closeClusters[0],1);
|1684|1684| 		matrix.splice(closeClusters[1],1);
|1685|1685| 		for (let i = 0; i < matrix.length; ++i)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1680|1680| 		// and the clusters themselves from the cluster list
|1681|1681| 		clusters.splice(closeClusters[0],1);
|1682|1682| 		clusters.splice(closeClusters[1],1);
|1683|    |-		matrix.splice(closeClusters[0],1);
|    |1683|+		matrix.splice(closeClusters[0], 1);
|1684|1684| 		matrix.splice(closeClusters[1],1);
|1685|1685| 		for (let i = 0; i < matrix.length; ++i)
|1686|1686| 		{
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1681|1681| 		clusters.splice(closeClusters[0],1);
|1682|1682| 		clusters.splice(closeClusters[1],1);
|1683|1683| 		matrix.splice(closeClusters[0],1);
|1684|    |-		matrix.splice(closeClusters[1],1);
|    |1684|+		matrix.splice(closeClusters[1], 1);
|1685|1685| 		for (let i = 0; i < matrix.length; ++i)
|1686|1686| 		{
|1687|1687| 			if (matrix[i].length > closeClusters[0])
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1685|1685| 		for (let i = 0; i < matrix.length; ++i)
|1686|1686| 		{
|1687|1687| 			if (matrix[i].length > closeClusters[0])
|1688|    |-				matrix[i].splice(closeClusters[0],1);
|    |1688|+				matrix[i].splice(closeClusters[0], 1);
|1689|1689| 			if (matrix[i].length > closeClusters[1])
|1690|1690| 				matrix[i].splice(closeClusters[1],1);
|1691|1691| 		}
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1687|1687| 			if (matrix[i].length > closeClusters[0])
|1688|1688| 				matrix[i].splice(closeClusters[0],1);
|1689|1689| 			if (matrix[i].length > closeClusters[1])
|1690|    |-				matrix[i].splice(closeClusters[1],1);
|    |1690|+				matrix[i].splice(closeClusters[1], 1);
|1691|1691| 		}
|1692|1692| 		// add a new row of distances to the matrix and the new cluster
|1693|1693| 		clusters.push(newCluster);

binaries/data/mods/public/simulation/helpers/Commands.js
|  43| »   if·(g_Commands[cmd.type])
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|  47| »   »   g_Commands[cmd.type](player,·cmd,·data);
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 845| »   »   let·ent·=·pickRandom(cmpRangeManager.GetEntitiesByPlayer(cmd.player).filter(ent·=>·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Commands.js
|1344| ····»   »   »   error("[TryConstructWall]·Expected·last·tower·control·group·to·be·available,·none·found·(1st·pass,·iteration·"·+·i·+·")");
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1345| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1575| »   »   »   »   var·lastFormationTemplate·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'lastFormationTemplate' to undefined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1654| »   »   var·closeClusters·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'closeClusters' to undefined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1671| »   »   for·(let·i·=·0;·i·<·clusters.length;·++i)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Commands.js
|1685| »   »   for·(let·i·=·0;·i·<·matrix.length;·++i)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Commands.js
|  53| var·g_Commands·=·{
|    | [NORMAL] JSHintBear:
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 287| »   »   »   »   »   })
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/helpers/Commands.js
| 597| »   »   »   »   ····&&·player·!=·+cmd.owner)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
| 785| »   »   »   »   var·cmpGUIInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGUIInterface' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1018| »   »   for·(var·i·=·0;·i·<·length;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1031| »   »   var·count·=·0;
|    | [NORMAL] JSHintBear:
|    | 'count' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1178| »   »   var·cmpGuiInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGuiInterface' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1430| »   »   var·piece·=·pieces[j];
|    | [NORMAL] JSHintBear:
|    | 'piece' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1513| »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1552| »   »   »   &&·cmpFormation.GetMemberCount()·==·formation.entities.length)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
|1578| »   »   »   »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1611| »   »   »   var·cmpFormation·=·Engine.QueryInterface(formationEnt,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1024|1024| 			// This should return a tooltip explaining that one does not have any
|1025|1025| 			// idle villies, with a disabled button. Like "delete".
|1026|1026| 			if (!Engine.GuiInterfaceCall("HasIdleUnits", {
|1027|    |-					"viewedPlayer": g_ViewedPlayer,
|    |1027|+				"viewedPlayer": g_ViewedPlayer,
|1028|1028| 					"idleClasses": g_WorkerTypes,
|1029|1029| 					"excludeUnits": []
|1030|1030| 				}))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1025|1025| 			// idle villies, with a disabled button. Like "delete".
|1026|1026| 			if (!Engine.GuiInterfaceCall("HasIdleUnits", {
|1027|1027| 					"viewedPlayer": g_ViewedPlayer,
|1028|    |-					"idleClasses": g_WorkerTypes,
|    |1028|+				"idleClasses": g_WorkerTypes,
|1029|1029| 					"excludeUnits": []
|1030|1030| 				}))
|1031|1031| 				return {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1026|1026| 			if (!Engine.GuiInterfaceCall("HasIdleUnits", {
|1027|1027| 					"viewedPlayer": g_ViewedPlayer,
|1028|1028| 					"idleClasses": g_WorkerTypes,
|1029|    |-					"excludeUnits": []
|    |1029|+				"excludeUnits": []
|1030|1030| 				}))
|1031|1031| 				return {
|1032|1032| 					"tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.assignidlevillager") +
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1027|1027| 					"viewedPlayer": g_ViewedPlayer,
|1028|1028| 					"idleClasses": g_WorkerTypes,
|1029|1029| 					"excludeUnits": []
|1030|    |-				}))
|    |1030|+			}))
|1031|1031| 				return {
|1032|1032| 					"tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.assignidlevillager") +
|1033|1033| 					           translate("There are no idle villagers to assign.."),
|    | [NORMAL] ESLintBear (no-extra-semi):
|    | Unnecessary semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1130|1130| 							resumeGame();
|1131|1131| 						}
|1132|1132| 					]);
|1133|    |-			};
|    |1133|+			}
|1134|1134| 		},
|1135|1135| 	},
|1136|1136| 

binaries/data/mods/public/gui/session/unit_actions.js
| 557| »   »   »   switch·(tradingDetails.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/unit_actions.js
|1133| »   »   »   };
|    | [NORMAL] JSHintBear:
|    | Unnecessary semicolon.
Executing section cli...

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

Freagarach added inline comments.Oct 28 2019, 10:08 AM
binaries/data/config/default.cfg
317

Information could be improved.

binaries/data/mods/public/gui/session/selection_panels.js
141

Could also be used for "delete"?

binaries/data/mods/public/gui/session/selection_panels_helpers.js
360–363

Can be inlined below, is that desirable?

366

Should be filtered to only include gatherable/repairable entities.

binaries/data/mods/public/simulation/helpers/Commands.js
944 ↗(On Diff #10215)

This is wrong. More information is needed for proper translation.

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

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

elexis added a subscriber: elexis.Oct 28 2019, 12:16 PM

I wonder if this isn't a feature exclusive to the GUI. The GUI has enough information to decide what unit action the player would like to order and whether there are idlers around. So the GUI can construct the simulation command itself already without adding a new command type, no?

When clicked with a single foundation an idle villager gets to work.

Just any idle villager? Perhaps it should look for one in proximity, if its on another island I guess thats the problem of the one issuing that command as is currently. Or should it be one of the selection?

What's the objective and use case of the feature?
Use case is to fix idlers with a task focused (camera) view instead of an entity focused (camera) view?
In particular to solve that task more efficiently than with the current hotkeys?
Could this use case be addressed in a way that gives the player more control, or allows the player to use the feature in a generic way? I mean perhaps #1899 and a select all idlers, or select 10 idlers hotkey, or select the closest 10 idlers hotkey would do the same without having to add any command depending code? It'd be step 1 select some close by or next idlers, step 2 issue the command = 2 hotkey presses? What does this patch achieve that isn't covered yet? It does both in a single step, thus saves time and player effort (which is the purpose of hotkeys)?

binaries/data/mods/public/gui/session/selection_panels_helpers.js
367

It looks like one can pass non-idle workers too. If there was a command having idlers in the name, it sounds like that simulation command would have the task to look up one.

Notice also that an idle unit at turn N (command construction time) may be a unit processing a command at turn N+2 (command execution time).
In that case if such a command would exist, it might be renamed to not speak about idle units.

binaries/data/mods/public/simulation/helpers/Commands.js
307 ↗(On Diff #10215)

The problem with the pattern in this function is that it hardcodes (1) which order types exist (2) their logic. So it has similar effects like duplication, it's another place that needs to be kept in sync. If there are 10 command types supported, there would be 10 related checks here. The quantity of code insertion isn't so much the problem as the code structuring. The less places that have to be kept in sync, the easier it is to maintain, insert, keep in sync. Consider unit_actions.js, Commands.js and components/, they use objects with similar formats, so one can insert one new command without modifying surrounding code. I would assume it might be possible to add one property to the objects in unit_actions.js per Command. Then it can be scaled more too,

for example it could support traders, military units

If the function is to be kept in this place, it looks like this code within this function could just be a for-entity loop containing a for-action loop with the actions being defined in some object somewhere.

944 ↗(On Diff #10215)

variables in translated strings using %(name)s markForTranslation("There are no idle villagers that can %(action)s"), otherwise the python script wont extract the string.

If there should be a case distinction, I suppose there should be one string per action, defined by the action. (Just informing that the ordered task could not be performed could be performed might work too otherwise,)

In D2396#99854, @elexis wrote:

I wonder if this isn't a feature exclusive to the GUI. The GUI has enough information to decide what unit action the player would like to order and whether there are idlers around. So the GUI can construct the simulation command itself already without adding a new command type, no?

I was wondering that as well :) And already started trying to make it GUI-only ;)

In D2396#99854, @elexis wrote:

Just any idle villager? Perhaps it should look for one in proximity, if its on another island I guess thats the problem of the one issuing that command as is currently. Or should it be one of the selection?

Just any idle villager (actually the one with the lowest entityID), ideally one would like to use the closest (range-check, thus expensive) and on the same piece of land (not possible yet, I think?).

In D2396#99854, @elexis wrote:

What's the objective and use case of the feature?
Use case is to fix idlers with a task focused (camera) view instead of an entity focused (camera) view?
In particular to solve that task more efficiently than with the current hotkeys?
Could this use case be addressed in a way that gives the player more control, or allows the player to use the feature in a generic way? I mean perhaps #1899 and a select all idlers, or select 10 idlers hotkey, or select the closest 10 idlers hotkey would do the same without having to add any command depending code? It'd be step 1 select some close by or next idlers, step 2 issue the command = 2 hotkey presses? What does this patch achieve that isn't covered yet? It does both in a single step, thus saves time and player effort (which is the purpose of hotkeys)?

The idea would indeed be to save player effort: select a resource, click a hotkey and an (ideally the closest) idle villager goes to work. It could even be expanded to: click a resource on the top panel and an idle villager goes to the nearest resource of that type to gather (highly inefficient if it happens to be on the other side of the map). It could also allow for a more Stronghold-styled way of building: one selects a building from a list and places that on the map, subsequently some idle villagers get to work constructing the building.

Is it so that for every other UnitAI command being ordered through Commands.js that the player knows both the source and the target?
I wonder about the possibility of units getting ordered that the player didn't see before.
For example there might be an enemy city between the unit and the selected target.

So an ideal implementation would still give the player full knowledge of the entities to be ordered (or at least providing an optional chance at little extra cost than not checking them) without being much slower to the player.
How to achieve that is a different question.
The 2 step hotkey sequence (1. select idlers, 2. assign them to the thing the cursor hovers) already is implemented, so the players who prefer to keep full control over their units may chose that, and the ones who prefer to play "target entity" based can use your proposed mechanism.

So it should work like this: 1. select storehouse, 2. notice the idle units button that if pressed, orders (a batch of?) these units to perform a task on the target?
That button could also show the number of available idlers (care: might cost some microseconds and those are expensive).
(Also why doesn't the idleworker button display the number of idlers currently? Wasn't there a patch for that around?
Found these on trac #5360, #4519, #3777, #3748, #2357 amongst other closed ones with related information, gah.)

binaries/data/mods/public/gui/session/selection_panels_helpers.js
366

If Im not mistaken, it might be more consistent to use the name target (or perhaps there is a difference, I didnt check).

Freagarach updated this revision to Diff 10221.Oct 29 2019, 9:35 AM
Freagarach marked 2 inline comments as done.
Freagarach edited the summary of this revision. (Show Details)
  • GUI-only.
  • Less duplication.
In D2396#99893, @elexis wrote:

Is it so that for every other UnitAI command being ordered through Commands.js that the player knows both the source and the target?

Yes.

In D2396#99893, @elexis wrote:

So an ideal implementation would still give the player full knowledge of the entities to be ordered (or at least providing an optional chance at little extra cost than not checking them) without being much slower to the player.
How to achieve that is a different question.

Blink the unit(s) on the minimap?

In D2396#99893, @elexis wrote:

So it should work like this: 1. select storehouse, 2. notice the idle units button that if pressed, orders (a batch of?) these units to perform a task on the target?
That button could also show the number of available idlers (care: might cost some microseconds and those are expensive).

Preferably show the idle workers which can work on that particular entity, so it ought to be checked in unit_actions.js and passed on.

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

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

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js
| 379| 379| 		}
| 380| 380| 		filteredWorkers = workers.filter(worker =>
| 381| 381| 			["preSelectedActionCheck", "hotkeyActionCheck", "actionCheck"].some(method =>
| 382|    |-			g_UnitActions[action][method] &&
|    | 382|+				g_UnitActions[action][method] &&
| 383| 383| 			g_UnitActions[action][method](entity, [worker])
| 384| 384| 		));
| 385| 385| 		if (maxWorkers)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js
| 381| 381| 			["preSelectedActionCheck", "hotkeyActionCheck", "actionCheck"].some(method =>
| 382| 382| 			g_UnitActions[action][method] &&
| 383| 383| 			g_UnitActions[action][method](entity, [worker])
| 384|    |-		));
|    | 384|+			));
| 385| 385| 		if (maxWorkers)
| 386| 386| 			filteredWorkers.slice(0, maxWorkers);
| 387| 387| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels.js
| 762| 762| 				addResearchToQueue(data.item.researchFacilityId, t);
| 763| 763| 			})(tech);
| 764| 764| 
| 765|    |-			button.onPressRight = (t => function () {
|    | 765|+			button.onPressRight = (t => function() {
| 766| 766| 				showTemplateDetails(
| 767| 767| 					t,
| 768| 768| 					GetTemplateData(data.unitEntStates.find(state => state.id == data.item.researchFacilityId).template).nativeCiv);

binaries/data/mods/public/gui/session/selection_panels.js
|  50| »   »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
|  61| »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
| 730| »   »   »   »   »   »   switch·(entity.check)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1024|1024| 			// This should return a tooltip explaining that one does not have any
|1025|1025| 			// idle villies, with a disabled button. Like "delete".
|1026|1026| 			if (!Engine.GuiInterfaceCall("HasIdleUnits", {
|1027|    |-					"viewedPlayer": g_ViewedPlayer,
|    |1027|+				"viewedPlayer": g_ViewedPlayer,
|1028|1028| 					"idleClasses": g_WorkerTypes,
|1029|1029| 					"excludeUnits": []
|1030|1030| 				}))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1025|1025| 			// idle villies, with a disabled button. Like "delete".
|1026|1026| 			if (!Engine.GuiInterfaceCall("HasIdleUnits", {
|1027|1027| 					"viewedPlayer": g_ViewedPlayer,
|1028|    |-					"idleClasses": g_WorkerTypes,
|    |1028|+				"idleClasses": g_WorkerTypes,
|1029|1029| 					"excludeUnits": []
|1030|1030| 				}))
|1031|1031| 				return {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1026|1026| 			if (!Engine.GuiInterfaceCall("HasIdleUnits", {
|1027|1027| 					"viewedPlayer": g_ViewedPlayer,
|1028|1028| 					"idleClasses": g_WorkerTypes,
|1029|    |-					"excludeUnits": []
|    |1029|+				"excludeUnits": []
|1030|1030| 				}))
|1031|1031| 				return {
|1032|1032| 					"tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.assignidlevillager") +
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1027|1027| 					"viewedPlayer": g_ViewedPlayer,
|1028|1028| 					"idleClasses": g_WorkerTypes,
|1029|1029| 					"excludeUnits": []
|1030|    |-				}))
|    |1030|+			}))
|1031|1031| 				return {
|1032|1032| 					"tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.assignidlevillager") +
|1033|1033| 					           translate("There are no idle villagers to assign.."),
|    | [NORMAL] ESLintBear (no-extra-semi):
|    | Unnecessary semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1130|1130| 							resumeGame();
|1131|1131| 						}
|1132|1132| 					]);
|1133|    |-			};
|    |1133|+			}
|1134|1134| 		},
|1135|1135| 	},
|1136|1136| 

binaries/data/mods/public/gui/session/unit_actions.js
| 557| »   »   »   switch·(tradingDetails.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/unit_actions.js
|1133| »   »   »   };
|    | [NORMAL] JSHintBear:
|    | Unnecessary semicolon.
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 550| 550| 			if (cmpGarrisonHolder)
| 551| 551| 			{
| 552| 552| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 553|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 554|    |-				    && player != +cmd.owner)
|    | 553|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 554|+				    player != +cmd.owner)
| 555| 555| 						continue;
| 556| 556| 
| 557| 557| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 552| 552| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 553| 553| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 554| 554| 				    && player != +cmd.owner)
| 555|    |-						continue;
|    | 555|+					continue;
| 556| 556| 
| 557| 557| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 558| 558| 					notifyUnloadFailure(player, garrisonHolder);
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'metadata'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1156|1156| 
|1157|1157| 	// send Metadata info if any
|1158|1158| 	if (cmd.metadata)
|1159|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1159|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1160|1160| 
|1161|1161| 	// Tell the units to start building this new entity
|1162|1162| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'owner'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1156|1156| 
|1157|1157| 	// send Metadata info if any
|1158|1158| 	if (cmd.metadata)
|1159|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1159|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1160|1160| 
|1161|1161| 	// Tell the units to start building this new entity
|1162|1162| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (space-in-parens):
|    | There should be no spaces inside this paren.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1156|1156| 
|1157|1157| 	// send Metadata info if any
|1158|1158| 	if (cmd.metadata)
|1159|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1159|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1160|1160| 
|1161|1161| 	// Tell the units to start building this new entity
|1162|1162| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1264|1264| 		}
|1265|1265| 
|1266|1266| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1267|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1267|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1268|1268| 	}
|1269|1269| 
|1270|1270| 	var i = 0;
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1328|1328| 
|1329|1329| 				if (i > 0)
|1330|1330| 				{
|1331|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1331|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1332|1332| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1333|1333| 					// TODO: ensure that cmpPreviousObstruction exists
|1334|1334| 					// TODO: ensure that the previous obstruction does not yet have a secondary control group set
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1491|1491| 		// Check that all its members are selected
|1492|1492| 		var fid = formationIds[0];
|1493|1493| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1494|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1495|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1494|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1495|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1496|1496| 		{
|1497|1497| 			cmpFormation.DeleteTwinFormations();
|1498|1498| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1599|1599| 		for (var i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1600|1600| 			for (var j = i - 1; j >= 0 && !closeClusters; --j)
|1601|1601| 				if (matrix[i][j] < distSq)
|1602|    |-					closeClusters = [i,j];
|    |1602|+					closeClusters = [i, j];
|1603|1603| 
|1604|1604| 		// if no more close clusters found, just return all found clusters so far
|1605|1605| 		if (!closeClusters)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1621|1621| 		}
|1622|1622| 		// remove the rows and columns in the matrix for the merged clusters,
|1623|1623| 		// and the clusters themselves from the cluster list
|1624|    |-		clusters.splice(closeClusters[0],1);
|    |1624|+		clusters.splice(closeClusters[0], 1);
|1625|1625| 		clusters.splice(closeClusters[1],1);
|1626|1626| 		matrix.splice(closeClusters[0],1);
|1627|1627| 		matrix.splice(closeClusters[1],1);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1622|1622| 		// remove the rows and columns in the matrix for the merged clusters,
|1623|1623| 		// and the clusters themselves from the cluster list
|1624|1624| 		clusters.splice(closeClusters[0],1);
|1625|    |-		clusters.splice(closeClusters[1],1);
|    |1625|+		clusters.splice(closeClusters[1], 1);
|1626|1626| 		matrix.splice(closeClusters[0],1);
|1627|1627| 		matrix.splice(closeClusters[1],1);
|1628|1628| 		for (let i = 0; i < matrix.length; ++i)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1623|1623| 		// and the clusters themselves from the cluster list
|1624|1624| 		clusters.splice(closeClusters[0],1);
|1625|1625| 		clusters.splice(closeClusters[1],1);
|1626|    |-		matrix.splice(closeClusters[0],1);
|    |1626|+		matrix.splice(closeClusters[0], 1);
|1627|1627| 		matrix.splice(closeClusters[1],1);
|1628|1628| 		for (let i = 0; i < matrix.length; ++i)
|1629|1629| 		{
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1624|1624| 		clusters.splice(closeClusters[0],1);
|1625|1625| 		clusters.splice(closeClusters[1],1);
|1626|1626| 		matrix.splice(closeClusters[0],1);
|1627|    |-		matrix.splice(closeClusters[1],1);
|    |1627|+		matrix.splice(closeClusters[1], 1);
|1628|1628| 		for (let i = 0; i < matrix.length; ++i)
|1629|1629| 		{
|1630|1630| 			if (matrix[i].length > closeClusters[0])
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1628|1628| 		for (let i = 0; i < matrix.length; ++i)
|1629|1629| 		{
|1630|1630| 			if (matrix[i].length > closeClusters[0])
|1631|    |-				matrix[i].splice(closeClusters[0],1);
|    |1631|+				matrix[i].splice(closeClusters[0], 1);
|1632|1632| 			if (matrix[i].length > closeClusters[1])
|1633|1633| 				matrix[i].splice(closeClusters[1],1);
|1634|1634| 		}
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1630|1630| 			if (matrix[i].length > closeClusters[0])
|1631|1631| 				matrix[i].splice(closeClusters[0],1);
|1632|1632| 			if (matrix[i].length > closeClusters[1])
|1633|    |-				matrix[i].splice(closeClusters[1],1);
|    |1633|+				matrix[i].splice(closeClusters[1], 1);
|1634|1634| 		}
|1635|1635| 		// add a new row of distances to the matrix and the new cluster
|1636|1636| 		clusters.push(newCluster);

binaries/data/mods/public/simulation/helpers/Commands.js
|  43| »   if·(g_Commands[cmd.type])
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|  47| »   »   g_Commands[cmd.type](player,·cmd,·data);
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 802| »   »   let·ent·=·pickRandom(cmpRangeManager.GetEntitiesByPlayer(cmd.player).filter(ent·=>·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Commands.js
|1287| ····»   »   »   error("[TryConstructWall]·Expected·last·tower·control·group·to·be·available,·none·found·(1st·pass,·iteration·"·+·i·+·")");
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1288| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1518| »   »   »   »   var·lastFormationTemplate·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'lastFormationTemplate' to undefined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1597| »   »   var·closeClusters·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'closeClusters' to undefined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1614| »   »   for·(let·i·=·0;·i·<·clusters.length;·++i)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Commands.js
|1628| »   »   for·(let·i·=·0;·i·<·matrix.length;·++i)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Commands.js
|  53| var·g_Commands·=·{
|    | [NORMAL] JSHintBear:
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 554| »   »   »   »   ····&&·player·!=·+cmd.owner)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
| 742| »   »   »   »   var·cmpGUIInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGUIInterface' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 961| »   »   for·(var·i·=·0;·i·<·length;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 974| »   »   var·count·=·0;
|    | [NORMAL] JSHintBear:
|    | 'count' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1121| »   »   var·cmpGuiInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGuiInterface' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1373| »   »   var·piece·=·pieces[j];
|    | [NORMAL] JSHintBear:
|    | 'piece' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1456| »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1495| »   »   »   &&·cmpFormation.GetMemberCount()·==·formation.entities.length)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
|1521| »   »   »   »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1554| »   »   »   var·cmpFormation·=·Engine.QueryInterface(formationEnt,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.
Executing section cli...

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

elexis added inline comments.Oct 29 2019, 11:16 AM
binaries/data/config/default.cfg
317

The word "modifier" seems to be used very widely by these hotkeys, whatever. Perhaps insert after the other hotkeys that trigger entity simulation commands when performed.

binaries/data/mods/public/gui/session/selection_panels_helpers.js
365

perhaps entities -> targets in order to distinguish them from the other entities

379

This repair/gather hardcoding looks like it might be replaced with some loop or arguments provided for the currently selected entity, so that one could add support for traders, healers or whatever without having to modify the function.
I wonder if this part shouldn't become part of g_UnitActions.

391

One can access the GUIInterface from the GUI too (PushNotification), but thats still unconventional.

I suppose all the other commands already have a known and available source entity. The most comparable thing may be the idle worker button, which is just disabled if there are no available units.

binaries/data/mods/public/gui/session/unit_actions.js
1027

-\t

1033

..

binaries/data/mods/public/simulation/helpers/Commands.js
74 ↗(On Diff #10221)

It says "GUI-only" in the patch upload notes.
Should a player be able to send this command?
(hint: if there is a simulation command defined, the player can send it with arbitrary arguments, arbitrarily often)

Freagarach updated this revision to Diff 10325.Thu, Nov 14, 7:34 PM
Freagarach marked 6 inline comments as done.
  • Move most of the function to unit_actions.js.

Yet to do: use a input.js-like system for determining the action.

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels.js
| 762| 762| 				addResearchToQueue(data.item.researchFacilityId, t);
| 763| 763| 			})(tech);
| 764| 764| 
| 765|    |-			button.onPressRight = (t => function () {
|    | 765|+			button.onPressRight = (t => function() {
| 766| 766| 				showTemplateDetails(
| 767| 767| 					t,
| 768| 768| 					GetTemplateData(data.unitEntStates.find(state => state.id == data.item.researchFacilityId).template).nativeCiv);

binaries/data/mods/public/gui/session/selection_panels.js
|  50| »   »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
|  61| »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
| 730| »   »   »   »   »   »   switch·(entity.check)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1047|1047| 				}
|1048|1048| 				filteredWorkers = workers.filter(worker =>
|1049|1049| 					["preSelectedActionCheck", "hotkeyActionCheck", "actionCheck"].some(method =>
|1050|    |-					g_UnitActions[action] &&
|    |1050|+						g_UnitActions[action] &&
|1051|1051| 					g_UnitActions[action][method] &&
|1052|1052| 					g_UnitActions[action][method](entState.id, [worker])
|1053|1053| 				));
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1050|1050| 					g_UnitActions[action] &&
|1051|1051| 					g_UnitActions[action][method] &&
|1052|1052| 					g_UnitActions[action][method](entState.id, [worker])
|1053|    |-				));
|    |1053|+					));
|1054|1054| 				if (maxWorkers)
|1055|1055| 					filteredWorkers.slice(0, maxWorkers);
|1056|1056| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1072|1072| 			}
|1073|1073| 			if (!Object.keys(assignmentData).length)
|1074|1074| 				return {
|1075|    |-						"tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.assignidlevillager") +
|    |1075|+					"tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.assignidlevillager") +
|1076|1076| 						           translate("There are no appropriate idle villagers that can be assigned."),
|1077|1077| 						"icon": "production.png",
|1078|1078| 						"active": "false"
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1074|1074| 				return {
|1075|1075| 						"tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.assignidlevillager") +
|1076|1076| 						           translate("There are no appropriate idle villagers that can be assigned."),
|1077|    |-						"icon": "production.png",
|    |1077|+					"icon": "production.png",
|1078|1078| 						"active": "false"
|1079|1079| 					};
|1080|1080| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1075|1075| 						"tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.assignidlevillager") +
|1076|1076| 						           translate("There are no appropriate idle villagers that can be assigned."),
|1077|1077| 						"icon": "production.png",
|1078|    |-						"active": "false"
|    |1078|+					"active": "false"
|1079|1079| 					};
|1080|1080| 
|1081|1081| 			return {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1076|1076| 						           translate("There are no appropriate idle villagers that can be assigned."),
|1077|1077| 						"icon": "production.png",
|1078|1078| 						"active": "false"
|1079|    |-					};
|    |1079|+				};
|1080|1080| 
|1081|1081| 			return {
|1082|1082| 				"tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.assignidlevillager") +

binaries/data/mods/public/gui/session/unit_actions.js
| 557| »   »   »   switch·(tradingDetails.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
Executing section cli...

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

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

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

Freagarach updated this revision to Diff 10337.Sat, Nov 16, 8:57 AM
Freagarach edited the test plan for this revision. (Show Details)

Use action determining functionality from input.js.

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

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

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/selection_panels.js
| 762| 762| 				addResearchToQueue(data.item.researchFacilityId, t);
| 763| 763| 			})(tech);
| 764| 764| 
| 765|    |-			button.onPressRight = (t => function () {
|    | 765|+			button.onPressRight = (t => function() {
| 766| 766| 				showTemplateDetails(
| 767| 767| 					t,
| 768| 768| 					GetTemplateData(data.unitEntStates.find(state => state.id == data.item.researchFacilityId).template).nativeCiv);

binaries/data/mods/public/gui/session/selection_panels.js
|  50| »   »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
|  61| »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
| 730| »   »   »   »   »   »   switch·(entity.check)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1045|1045| 
|1046|1046| 				filteredWorkers = workers.filter(worker =>
|1047|1047| 					["preSelectedActionCheck", "hotkeyActionCheck", "actionCheck"].some(method =>
|1048|    |-					g_UnitActions[chosenAction] &&
|    |1048|+						g_UnitActions[chosenAction] &&
|1049|1049| 					g_UnitActions[chosenAction][method] &&
|1050|1050| 					g_UnitActions[chosenAction][method](entState.id, [worker])
|1051|1051| 				));
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1048|1048| 					g_UnitActions[chosenAction] &&
|1049|1049| 					g_UnitActions[chosenAction][method] &&
|1050|1050| 					g_UnitActions[chosenAction][method](entState.id, [worker])
|1051|    |-				));
|    |1051|+					));
|1052|1052| 				if (maxWorkers)
|1053|1053| 					filteredWorkers.slice(0, maxWorkers);
|1054|1054| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 17 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1072|1072| 				return {
|1073|1073| 					"tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.assignidlevillager") +
|1074|1074| 					           sprintf(translate("Assign an idle unit to %(action)s this entity."), {
|1075|    |-							"action": assignmentData[Object.keys(assignmentData)[0]].action
|    |1075|+					           	"action": assignmentData[Object.keys(assignmentData)[0]].action
|1076|1076| 						}),
|1077|1077| 					"icon": "production.png",
|1078|1078| 					"data": assignmentData
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 16 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1073|1073| 					"tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.assignidlevillager") +
|1074|1074| 					           sprintf(translate("Assign an idle unit to %(action)s this entity."), {
|1075|1075| 							"action": assignmentData[Object.keys(assignmentData)[0]].action
|1076|    |-						}),
|    |1076|+					           }),
|1077|1077| 					"icon": "production.png",
|1078|1078| 					"data": assignmentData
|1079|1079| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1087|1087| 				};
|1088|1088| 
|1089|1089| 			return {
|1090|    |-					"tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.assignidlevillager") +
|    |1090|+				"tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.assignidlevillager") +
|1091|1091| 					           translate("There are no appropriate idle units that can be assigned."),
|1092|1092| 					"icon": "production.png",
|1093|1093| 					"active": "false"
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1089|1089| 			return {
|1090|1090| 					"tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.assignidlevillager") +
|1091|1091| 					           translate("There are no appropriate idle units that can be assigned."),
|1092|    |-					"icon": "production.png",
|    |1092|+				"icon": "production.png",
|1093|1093| 					"active": "false"
|1094|1094| 				};
|1095|1095| 		},
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1090|1090| 					"tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.assignidlevillager") +
|1091|1091| 					           translate("There are no appropriate idle units that can be assigned."),
|1092|1092| 					"icon": "production.png",
|1093|    |-					"active": "false"
|    |1093|+				"active": "false"
|1094|1094| 				};
|1095|1095| 		},
|1096|1096| 		"execute": function(entStates, data)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1091|1091| 					           translate("There are no appropriate idle units that can be assigned."),
|1092|1092| 					"icon": "production.png",
|1093|1093| 					"active": "false"
|1094|    |-				};
|    |1094|+			};
|1095|1095| 		},
|1096|1096| 		"execute": function(entStates, data)
|1097|1097| 		{

binaries/data/mods/public/gui/session/unit_actions.js
| 557| »   »   »   switch·(tradingDetails.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
|    | [NORMAL] ESLintBear (space-unary-ops):
|    | Unary word operator 'typeof' must be followed by whitespace.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 333| 333| 	}
| 334| 334| 
| 335| 335| 	var wallPlacementInfo = updateBuildingPlacementPreview(); // entities making up the wall (wall segments, towers, ...)
| 336|    |-	if (!(wallPlacementInfo === false || typeof(wallPlacementInfo) === "object"))
|    | 336|+	if (!(wallPlacementInfo === false || typeof (wallPlacementInfo) === "object"))
| 337| 337| 	{
| 338| 338| 		error("Invalid updateBuildingPlacementPreview return value: " + uneval(wallPlacementInfo));
| 339| 339| 		return false;
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 483| 483| 	mouseIsOverObject = (hoveredObject != null);
| 484| 484| 
| 485| 485| 	// Close the menu when interacting with the game world
| 486|    |-	if (!mouseIsOverObject && (ev.type =="mousebuttonup" || ev.type == "mousebuttondown")
| 487|    |-		&& (ev.button == SDL_BUTTON_LEFT || ev.button == SDL_BUTTON_RIGHT))
|    | 486|+	if (!mouseIsOverObject && (ev.type =="mousebuttonup" || ev.type == "mousebuttondown") &&
|    | 487|+		(ev.button == SDL_BUTTON_LEFT || ev.button == SDL_BUTTON_RIGHT))
| 488| 488| 		g_Menu.close();
| 489| 489| 
| 490| 490| 	// State-machine processing:
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 644| 644| 		// user to continue building walls.
| 645| 645| 		switch (ev.type)
| 646| 646| 		{
| 647|    |-			case "mousemotion":
|    | 647|+		case "mousemotion":
| 648| 648| 				placementSupport.wallEndPosition = Engine.GetTerrainAtScreenPoint(ev.x, ev.y);
| 649| 649| 
| 650| 650| 				// Update the building placement preview, and by extension, the list of snapping candidate entities for both (!)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 645| 645| 		switch (ev.type)
| 646| 646| 		{
| 647| 647| 			case "mousemotion":
| 648|    |-				placementSupport.wallEndPosition = Engine.GetTerrainAtScreenPoint(ev.x, ev.y);
|    | 648|+			placementSupport.wallEndPosition = Engine.GetTerrainAtScreenPoint(ev.x, ev.y);
| 649| 649| 
| 650| 650| 				// Update the building placement preview, and by extension, the list of snapping candidate entities for both (!)
| 651| 651| 				// the ending point and the starting point to snap to.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 647| 647| 			case "mousemotion":
| 648| 648| 				placementSupport.wallEndPosition = Engine.GetTerrainAtScreenPoint(ev.x, ev.y);
| 649| 649| 
| 650|    |-				// Update the building placement preview, and by extension, the list of snapping candidate entities for both (!)
|    | 650|+			// Update the building placement preview, and by extension, the list of snapping candidate entities for both (!)
| 651| 651| 				// the ending point and the starting point to snap to.
| 652| 652| 				//
| 653| 653| 				// TODO: Note that here, we need to fetch all similar entities, including any offscreen ones, to support the case
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 648| 648| 				placementSupport.wallEndPosition = Engine.GetTerrainAtScreenPoint(ev.x, ev.y);
| 649| 649| 
| 650| 650| 				// Update the building placement preview, and by extension, the list of snapping candidate entities for both (!)
| 651|    |-				// the ending point and the starting point to snap to.
|    | 651|+			// the ending point and the starting point to snap to.
| 652| 652| 				//
| 653| 653| 				// TODO: Note that here, we need to fetch all similar entities, including any offscreen ones, to support the case
| 654| 654| 				// where the snap entity for the starting point has moved offscreen, or has been deleted/destroyed, or was a
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 649| 649| 
| 650| 650| 				// Update the building placement preview, and by extension, the list of snapping candidate entities for both (!)
| 651| 651| 				// the ending point and the starting point to snap to.
| 652|    |-				//
|    | 652|+			//
| 653| 653| 				// TODO: Note that here, we need to fetch all similar entities, including any offscreen ones, to support the case
| 654| 654| 				// where the snap entity for the starting point has moved offscreen, or has been deleted/destroyed, or was a
| 655| 655| 				// foundation and has been replaced with a completed entity since the user first chose it. Fetching all towers on
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 650| 650| 				// Update the building placement preview, and by extension, the list of snapping candidate entities for both (!)
| 651| 651| 				// the ending point and the starting point to snap to.
| 652| 652| 				//
| 653|    |-				// TODO: Note that here, we need to fetch all similar entities, including any offscreen ones, to support the case
|    | 653|+			// TODO: Note that here, we need to fetch all similar entities, including any offscreen ones, to support the case
| 654| 654| 				// where the snap entity for the starting point has moved offscreen, or has been deleted/destroyed, or was a
| 655| 655| 				// foundation and has been replaced with a completed entity since the user first chose it. Fetching all towers on
| 656| 656| 				// the entire map instead of only the current screen might get expensive fast since walls all have a ton of towers
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 651| 651| 				// the ending point and the starting point to snap to.
| 652| 652| 				//
| 653| 653| 				// TODO: Note that here, we need to fetch all similar entities, including any offscreen ones, to support the case
| 654|    |-				// where the snap entity for the starting point has moved offscreen, or has been deleted/destroyed, or was a
|    | 654|+			// where the snap entity for the starting point has moved offscreen, or has been deleted/destroyed, or was a
| 655| 655| 				// foundation and has been replaced with a completed entity since the user first chose it. Fetching all towers on
| 656| 656| 				// the entire map instead of only the current screen might get expensive fast since walls all have a ton of towers
| 657| 657| 				// in them. Might be useful to query only for entities within a certain range around the starting point and ending
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 652| 652| 				//
| 653| 653| 				// TODO: Note that here, we need to fetch all similar entities, including any offscreen ones, to support the case
| 654| 654| 				// where the snap entity for the starting point has moved offscreen, or has been deleted/destroyed, or was a
| 655|    |-				// foundation and has been replaced with a completed entity since the user first chose it. Fetching all towers on
|    | 655|+			// foundation and has been replaced with a completed entity since the user first chose it. Fetching all towers on
| 656| 656| 				// the entire map instead of only the current screen might get expensive fast since walls all have a ton of towers
| 657| 657| 				// in them. Might be useful to query only for entities within a certain range around the starting point and ending
| 658| 658| 				// points.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 653| 653| 				// TODO: Note that here, we need to fetch all similar entities, including any offscreen ones, to support the case
| 654| 654| 				// where the snap entity for the starting point has moved offscreen, or has been deleted/destroyed, or was a
| 655| 655| 				// foundation and has been replaced with a completed entity since the user first chose it. Fetching all towers on
| 656|    |-				// the entire map instead of only the current screen might get expensive fast since walls all have a ton of towers
|    | 656|+			// the entire map instead of only the current screen might get expensive fast since walls all have a ton of towers
| 657| 657| 				// in them. Might be useful to query only for entities within a certain range around the starting point and ending
| 658| 658| 				// points.
| 659| 659| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 654| 654| 				// where the snap entity for the starting point has moved offscreen, or has been deleted/destroyed, or was a
| 655| 655| 				// foundation and has been replaced with a completed entity since the user first chose it. Fetching all towers on
| 656| 656| 				// the entire map instead of only the current screen might get expensive fast since walls all have a ton of towers
| 657|    |-				// in them. Might be useful to query only for entities within a certain range around the starting point and ending
|    | 657|+			// in them. Might be useful to query only for entities within a certain range around the starting point and ending
| 658| 658| 				// points.
| 659| 659| 
| 660| 660| 				placementSupport.wallSnapEntitiesIncludeOffscreen = true;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 655| 655| 				// foundation and has been replaced with a completed entity since the user first chose it. Fetching all towers on
| 656| 656| 				// the entire map instead of only the current screen might get expensive fast since walls all have a ton of towers
| 657| 657| 				// in them. Might be useful to query only for entities within a certain range around the starting point and ending
| 658|    |-				// points.
|    | 658|+			// points.
| 659| 659| 
| 660| 660| 				placementSupport.wallSnapEntitiesIncludeOffscreen = true;
| 661| 661| 				var result = updateBuildingPlacementPreview(); // includes an update of the snap entity candidates
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 657| 657| 				// in them. Might be useful to query only for entities within a certain range around the starting point and ending
| 658| 658| 				// points.
| 659| 659| 
| 660|    |-				placementSupport.wallSnapEntitiesIncludeOffscreen = true;
|    | 660|+			placementSupport.wallSnapEntitiesIncludeOffscreen = true;
| 661| 661| 				var result = updateBuildingPlacementPreview(); // includes an update of the snap entity candidates
| 662| 662| 
| 663| 663| 				if (result && result.cost)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 658| 658| 				// points.
| 659| 659| 
| 660| 660| 				placementSupport.wallSnapEntitiesIncludeOffscreen = true;
| 661|    |-				var result = updateBuildingPlacementPreview(); // includes an update of the snap entity candidates
|    | 661|+			var result = updateBuildingPlacementPreview(); // includes an update of the snap entity candidates
| 662| 662| 
| 663| 663| 				if (result && result.cost)
| 664| 664| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 660| 660| 				placementSupport.wallSnapEntitiesIncludeOffscreen = true;
| 661| 661| 				var result = updateBuildingPlacementPreview(); // includes an update of the snap entity candidates
| 662| 662| 
| 663|    |-				if (result && result.cost)
|    | 663|+			if (result && result.cost)
| 664| 664| 				{
| 665| 665| 					var neededResources = Engine.GuiInterfaceCall("GetNeededResources", { "cost": result.cost });
| 666| 666| 					placementSupport.tooltipMessage = [
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 661| 661| 				var result = updateBuildingPlacementPreview(); // includes an update of the snap entity candidates
| 662| 662| 
| 663| 663| 				if (result && result.cost)
| 664|    |-				{
|    | 664|+			{
| 665| 665| 					var neededResources = Engine.GuiInterfaceCall("GetNeededResources", { "cost": result.cost });
| 666| 666| 					placementSupport.tooltipMessage = [
| 667| 667| 						getEntityCostTooltip(result),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 662| 662| 
| 663| 663| 				if (result && result.cost)
| 664| 664| 				{
| 665|    |-					var neededResources = Engine.GuiInterfaceCall("GetNeededResources", { "cost": result.cost });
|    | 665|+				var neededResources = Engine.GuiInterfaceCall("GetNeededResources", { "cost": result.cost });
| 666| 666| 					placementSupport.tooltipMessage = [
| 667| 667| 						getEntityCostTooltip(result),
| 668| 668| 						getNeededResourcesTooltip(neededResources)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 663| 663| 				if (result && result.cost)
| 664| 664| 				{
| 665| 665| 					var neededResources = Engine.GuiInterfaceCall("GetNeededResources", { "cost": result.cost });
| 666|    |-					placementSupport.tooltipMessage = [
|    | 666|+				placementSupport.tooltipMessage = [
| 667| 667| 						getEntityCostTooltip(result),
| 668| 668| 						getNeededResourcesTooltip(neededResources)
| 669| 669| 					].filter(tip => tip).join("\n");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 664| 664| 				{
| 665| 665| 					var neededResources = Engine.GuiInterfaceCall("GetNeededResources", { "cost": result.cost });
| 666| 666| 					placementSupport.tooltipMessage = [
| 667|    |-						getEntityCostTooltip(result),
|    | 667|+					getEntityCostTooltip(result),
| 668| 668| 						getNeededResourcesTooltip(neededResources)
| 669| 669| 					].filter(tip => tip).join("\n");
| 670| 670| 				}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 665| 665| 					var neededResources = Engine.GuiInterfaceCall("GetNeededResources", { "cost": result.cost });
| 666| 666| 					placementSupport.tooltipMessage = [
| 667| 667| 						getEntityCostTooltip(result),
| 668|    |-						getNeededResourcesTooltip(neededResources)
|    | 668|+					getNeededResourcesTooltip(neededResources)
| 669| 669| 					].filter(tip => tip).join("\n");
| 670| 670| 				}
| 671| 671| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 666| 666| 					placementSupport.tooltipMessage = [
| 667| 667| 						getEntityCostTooltip(result),
| 668| 668| 						getNeededResourcesTooltip(neededResources)
| 669|    |-					].filter(tip => tip).join("\n");
|    | 669|+				].filter(tip => tip).join("\n");
| 670| 670| 				}
| 671| 671| 
| 672| 672| 				break;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 667| 667| 						getEntityCostTooltip(result),
| 668| 668| 						getNeededResourcesTooltip(neededResources)
| 669| 669| 					].filter(tip => tip).join("\n");
| 670|    |-				}
|    | 670|+			}
| 671| 671| 
| 672| 672| 				break;
| 673| 673| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 669| 669| 					].filter(tip => tip).join("\n");
| 670| 670| 				}
| 671| 671| 
| 672|    |-				break;
|    | 672|+			break;
| 673| 673| 
| 674| 674| 			case "mousebuttondown":
| 675| 675| 				if (ev.button == SDL_BUTTON_LEFT)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 671| 671| 
| 672| 672| 				break;
| 673| 673| 
| 674|    |-			case "mousebuttondown":
|    | 674|+		case "mousebuttondown":
| 675| 675| 				if (ev.button == SDL_BUTTON_LEFT)
| 676| 676| 				{
| 677| 677| 					var queued = Engine.HotkeyIsPressed("session.queue");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 672| 672| 				break;
| 673| 673| 
| 674| 674| 			case "mousebuttondown":
| 675|    |-				if (ev.button == SDL_BUTTON_LEFT)
|    | 675|+			if (ev.button == SDL_BUTTON_LEFT)
| 676| 676| 				{
| 677| 677| 					var queued = Engine.HotkeyIsPressed("session.queue");
| 678| 678| 					if (tryPlaceWall(queued))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 673| 673| 
| 674| 674| 			case "mousebuttondown":
| 675| 675| 				if (ev.button == SDL_BUTTON_LEFT)
| 676|    |-				{
|    | 676|+			{
| 677| 677| 					var queued = Engine.HotkeyIsPressed("session.queue");
| 678| 678| 					if (tryPlaceWall(queued))
| 679| 679| 					{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 674| 674| 			case "mousebuttondown":
| 675| 675| 				if (ev.button == SDL_BUTTON_LEFT)
| 676| 676| 				{
| 677|    |-					var queued = Engine.HotkeyIsPressed("session.queue");
|    | 677|+				var queued = Engine.HotkeyIsPressed("session.queue");
| 678| 678| 					if (tryPlaceWall(queued))
| 679| 679| 					{
| 680| 680| 						if (queued)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 675| 675| 				if (ev.button == SDL_BUTTON_LEFT)
| 676| 676| 				{
| 677| 677| 					var queued = Engine.HotkeyIsPressed("session.queue");
| 678|    |-					if (tryPlaceWall(queued))
|    | 678|+				if (tryPlaceWall(queued))
| 679| 679| 					{
| 680| 680| 						if (queued)
| 681| 681| 						{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 676| 676| 				{
| 677| 677| 					var queued = Engine.HotkeyIsPressed("session.queue");
| 678| 678| 					if (tryPlaceWall(queued))
| 679|    |-					{
|    | 679|+				{
| 680| 680| 						if (queued)
| 681| 681| 						{
| 682| 682| 							// continue building, just set a new starting position where we left off
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 677| 677| 					var queued = Engine.HotkeyIsPressed("session.queue");
| 678| 678| 					if (tryPlaceWall(queued))
| 679| 679| 					{
| 680|    |-						if (queued)
|    | 680|+					if (queued)
| 681| 681| 						{
| 682| 682| 							// continue building, just set a new starting position where we left off
| 683| 683| 							placementSupport.position = placementSupport.wallEndPosition;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 678| 678| 					if (tryPlaceWall(queued))
| 679| 679| 					{
| 680| 680| 						if (queued)
| 681|    |-						{
|    | 681|+					{
| 682| 682| 							// continue building, just set a new starting position where we left off
| 683| 683| 							placementSupport.position = placementSupport.wallEndPosition;
| 684| 684| 							placementSupport.wallEndPosition = undefined;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 679| 679| 					{
| 680| 680| 						if (queued)
| 681| 681| 						{
| 682|    |-							// continue building, just set a new starting position where we left off
|    | 682|+						// continue building, just set a new starting position where we left off
| 683| 683| 							placementSupport.position = placementSupport.wallEndPosition;
| 684| 684| 							placementSupport.wallEndPosition = undefined;
| 685| 685| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 680| 680| 						if (queued)
| 681| 681| 						{
| 682| 682| 							// continue building, just set a new starting position where we left off
| 683|    |-							placementSupport.position = placementSupport.wallEndPosition;
|    | 683|+						placementSupport.position = placementSupport.wallEndPosition;
| 684| 684| 							placementSupport.wallEndPosition = undefined;
| 685| 685| 
| 686| 686| 							inputState = INPUT_BUILDING_WALL_CLICK;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 681| 681| 						{
| 682| 682| 							// continue building, just set a new starting position where we left off
| 683| 683| 							placementSupport.position = placementSupport.wallEndPosition;
| 684|    |-							placementSupport.wallEndPosition = undefined;
|    | 684|+						placementSupport.wallEndPosition = undefined;
| 685| 685| 
| 686| 686| 							inputState = INPUT_BUILDING_WALL_CLICK;
| 687| 687| 						}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 683| 683| 							placementSupport.position = placementSupport.wallEndPosition;
| 684| 684| 							placementSupport.wallEndPosition = undefined;
| 685| 685| 
| 686|    |-							inputState = INPUT_BUILDING_WALL_CLICK;
|    | 686|+						inputState = INPUT_BUILDING_WALL_CLICK;
| 687| 687| 						}
| 688| 688| 						else
| 689| 689| 						{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 684| 684| 							placementSupport.wallEndPosition = undefined;
| 685| 685| 
| 686| 686| 							inputState = INPUT_BUILDING_WALL_CLICK;
| 687|    |-						}
|    | 687|+					}
| 688| 688| 						else
| 689| 689| 						{
| 690| 690| 							placementSupport.Reset();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 685| 685| 
| 686| 686| 							inputState = INPUT_BUILDING_WALL_CLICK;
| 687| 687| 						}
| 688|    |-						else
|    | 688|+					else
| 689| 689| 						{
| 690| 690| 							placementSupport.Reset();
| 691| 691| 							inputState = INPUT_NORMAL;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 686| 686| 							inputState = INPUT_BUILDING_WALL_CLICK;
| 687| 687| 						}
| 688| 688| 						else
| 689|    |-						{
|    | 689|+					{
| 690| 690| 							placementSupport.Reset();
| 691| 691| 							inputState = INPUT_NORMAL;
| 692| 692| 						}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 687| 687| 						}
| 688| 688| 						else
| 689| 689| 						{
| 690|    |-							placementSupport.Reset();
|    | 690|+						placementSupport.Reset();
| 691| 691| 							inputState = INPUT_NORMAL;
| 692| 692| 						}
| 693| 693| 					}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 688| 688| 						else
| 689| 689| 						{
| 690| 690| 							placementSupport.Reset();
| 691|    |-							inputState = INPUT_NORMAL;
|    | 691|+						inputState = INPUT_NORMAL;
| 692| 692| 						}
| 693| 693| 					}
| 694| 694| 					else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 689| 689| 						{
| 690| 690| 							placementSupport.Reset();
| 691| 691| 							inputState = INPUT_NORMAL;
| 692|    |-						}
|    | 692|+					}
| 693| 693| 					}
| 694| 694| 					else
| 695| 695| 						placementSupport.tooltipMessage = translate("Cannot build wall here!");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 690| 690| 							placementSupport.Reset();
| 691| 691| 							inputState = INPUT_NORMAL;
| 692| 692| 						}
| 693|    |-					}
|    | 693|+				}
| 694| 694| 					else
| 695| 695| 						placementSupport.tooltipMessage = translate("Cannot build wall here!");
| 696| 696| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 691| 691| 							inputState = INPUT_NORMAL;
| 692| 692| 						}
| 693| 693| 					}
| 694|    |-					else
|    | 694|+				else
| 695| 695| 						placementSupport.tooltipMessage = translate("Cannot build wall here!");
| 696| 696| 
| 697| 697| 					updateBuildingPlacementPreview();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 692| 692| 						}
| 693| 693| 					}
| 694| 694| 					else
| 695|    |-						placementSupport.tooltipMessage = translate("Cannot build wall here!");
|    | 695|+					placementSupport.tooltipMessage = translate("Cannot build wall here!");
| 696| 696| 
| 697| 697| 					updateBuildingPlacementPreview();
| 698| 698| 					return true;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 694| 694| 					else
| 695| 695| 						placementSupport.tooltipMessage = translate("Cannot build wall here!");
| 696| 696| 
| 697|    |-					updateBuildingPlacementPreview();
|    | 697|+				updateBuildingPlacementPreview();
| 698| 698| 					return true;
| 699| 699| 				}
| 700| 700| 				else if (ev.button == SDL_BUTTON_RIGHT)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 695| 695| 						placementSupport.tooltipMessage = translate("Cannot build wall here!");
| 696| 696| 
| 697| 697| 					updateBuildingPlacementPreview();
| 698|    |-					return true;
|    | 698|+				return true;
| 699| 699| 				}
| 700| 700| 				else if (ev.button == SDL_BUTTON_RIGHT)
| 701| 701| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 696| 696| 
| 697| 697| 					updateBuildingPlacementPreview();
| 698| 698| 					return true;
| 699|    |-				}
|    | 699|+			}
| 700| 700| 				else if (ev.button == SDL_BUTTON_RIGHT)
| 701| 701| 				{
| 702| 702| 					// reset to normal input mode
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 697| 697| 					updateBuildingPlacementPreview();
| 698| 698| 					return true;
| 699| 699| 				}
| 700|    |-				else if (ev.button == SDL_BUTTON_RIGHT)
|    | 700|+			else if (ev.button == SDL_BUTTON_RIGHT)
| 701| 701| 				{
| 702| 702| 					// reset to normal input mode
| 703| 703| 					placementSupport.Reset();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 698| 698| 					return true;
| 699| 699| 				}
| 700| 700| 				else if (ev.button == SDL_BUTTON_RIGHT)
| 701|    |-				{
|    | 701|+			{
| 702| 702| 					// reset to normal input mode
| 703| 703| 					placementSupport.Reset();
| 704| 704| 					updateBuildingPlacementPreview();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 699| 699| 				}
| 700| 700| 				else if (ev.button == SDL_BUTTON_RIGHT)
| 701| 701| 				{
| 702|    |-					// reset to normal input mode
|    | 702|+				// reset to normal input mode
| 703| 703| 					placementSupport.Reset();
| 704| 704| 					updateBuildingPlacementPreview();
| 705| 705| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 700| 700| 				else if (ev.button == SDL_BUTTON_RIGHT)
| 701| 701| 				{
| 702| 702| 					// reset to normal input mode
| 703|    |-					placementSupport.Reset();
|    | 703|+				placementSupport.Reset();
| 704| 704| 					updateBuildingPlacementPreview();
| 705| 705| 
| 706| 706| 					inputState = INPUT_NORMAL;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 701| 701| 				{
| 702| 702| 					// reset to normal input mode
| 703| 703| 					placementSupport.Reset();
| 704|    |-					updateBuildingPlacementPreview();
|    | 704|+				updateBuildingPlacementPreview();
| 705| 705| 
| 706| 706| 					inputState = INPUT_NORMAL;
| 707| 707| 					return true;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 703| 703| 					placementSupport.Reset();
| 704| 704| 					updateBuildingPlacementPreview();
| 705| 705| 
| 706|    |-					inputState = INPUT_NORMAL;
|    | 706|+				inputState = INPUT_NORMAL;
| 707| 707| 					return true;
| 708| 708| 				}
| 709| 709| 				break;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 704| 704| 					updateBuildingPlacementPreview();
| 705| 705| 
| 706| 706| 					inputState = INPUT_NORMAL;
| 707|    |-					return true;
|    | 707|+				return true;
| 708| 708| 				}
| 709| 709| 				break;
| 710| 710| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 705| 705| 
| 706| 706| 					inputState = INPUT_NORMAL;
| 707| 707| 					return true;
| 708|    |-				}
|    | 708|+			}
| 709| 709| 				break;
| 710| 710| 		}
| 711| 711| 		break;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 706| 706| 					inputState = INPUT_NORMAL;
| 707| 707| 					return true;
| 708| 708| 				}
| 709|    |-				break;
|    | 709|+			break;
| 710| 710| 		}
| 711| 711| 		break;
| 712| 712| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 845| 845| 			break;
| 846| 846| 
| 847| 847| 		case "hotkeydown":
| 848|    |-				if (ev.hotkey.indexOf("selection.group.") == 0)
|    | 848|+			if (ev.hotkey.indexOf("selection.group.") == 0)
| 849| 849| 				{
| 850| 850| 					let now = Date.now();
| 851| 851| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 846| 846| 
| 847| 847| 		case "hotkeydown":
| 848| 848| 				if (ev.hotkey.indexOf("selection.group.") == 0)
| 849|    |-				{
|    | 849|+			{
| 850| 850| 					let now = Date.now();
| 851| 851| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 852| 852| 					{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 847| 847| 		case "hotkeydown":
| 848| 848| 				if (ev.hotkey.indexOf("selection.group.") == 0)
| 849| 849| 				{
| 850|    |-					let now = Date.now();
|    | 850|+				let now = Date.now();
| 851| 851| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 852| 852| 					{
| 853| 853| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 848| 848| 				if (ev.hotkey.indexOf("selection.group.") == 0)
| 849| 849| 				{
| 850| 850| 					let now = Date.now();
| 851|    |-					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
|    | 851|+				if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 852| 852| 					{
| 853| 853| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 854| 854| 						{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 849| 849| 				{
| 850| 850| 					let now = Date.now();
| 851| 851| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 852|    |-					{
|    | 852|+				{
| 853| 853| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 854| 854| 						{
| 855| 855| 							var sptr = ev.hotkey.split(".");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 850| 850| 					let now = Date.now();
| 851| 851| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 852| 852| 					{
| 853|    |-						if (ev.hotkey.indexOf("selection.group.select.") == 0)
|    | 853|+					if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 854| 854| 						{
| 855| 855| 							var sptr = ev.hotkey.split(".");
| 856| 856| 							performGroup("snap", sptr[3]);
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 851| 851| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 852| 852| 					{
| 853| 853| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 854|    |-						{
|    | 854|+					{
| 855| 855| 							var sptr = ev.hotkey.split(".");
| 856| 856| 							performGroup("snap", sptr[3]);
| 857| 857| 						}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 852| 852| 					{
| 853| 853| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 854| 854| 						{
| 855|    |-							var sptr = ev.hotkey.split(".");
|    | 855|+						var sptr = ev.hotkey.split(".");
| 856| 856| 							performGroup("snap", sptr[3]);
| 857| 857| 						}
| 858| 858| 					}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 853| 853| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 854| 854| 						{
| 855| 855| 							var sptr = ev.hotkey.split(".");
| 856|    |-							performGroup("snap", sptr[3]);
|    | 856|+						performGroup("snap", sptr[3]);
| 857| 857| 						}
| 858| 858| 					}
| 859| 859| 					else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 854| 854| 						{
| 855| 855| 							var sptr = ev.hotkey.split(".");
| 856| 856| 							performGroup("snap", sptr[3]);
| 857|    |-						}
|    | 857|+					}
| 858| 858| 					}
| 859| 859| 					else
| 860| 860| 					{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 855| 855| 							var sptr = ev.hotkey.split(".");
| 856| 856| 							performGroup("snap", sptr[3]);
| 857| 857| 						}
| 858|    |-					}
|    | 858|+				}
| 859| 859| 					else
| 860| 860| 					{
| 861| 861| 						var sptr = ev.hotkey.split(".");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 856| 856| 							performGroup("snap", sptr[3]);
| 857| 857| 						}
| 858| 858| 					}
| 859|    |-					else
|    | 859|+				else
| 860| 860| 					{
| 861| 861| 						var sptr = ev.hotkey.split(".");
| 862| 862| 						performGroup(sptr[2], sptr[3]);
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 857| 857| 						}
| 858| 858| 					}
| 859| 859| 					else
| 860|    |-					{
|    | 860|+				{
| 861| 861| 						var sptr = ev.hotkey.split(".");
| 862| 862| 						performGroup(sptr[2], sptr[3]);
| 863| 863| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 858| 858| 					}
| 859| 859| 					else
| 860| 860| 					{
| 861|    |-						var sptr = ev.hotkey.split(".");
|    | 861|+					var sptr = ev.hotkey.split(".");
| 862| 862| 						performGroup(sptr[2], sptr[3]);
| 863| 863| 
| 864| 864| 						doublePressTimer = now;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 859| 859| 					else
| 860| 860| 					{
| 861| 861| 						var sptr = ev.hotkey.split(".");
| 862|    |-						performGroup(sptr[2], sptr[3]);
|    | 862|+					performGroup(sptr[2], sptr[3]);
| 863| 863| 
| 864| 864| 						doublePressTimer = now;
| 865| 865| 						prevHotkey = ev.hotkey;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 861| 861| 						var sptr = ev.hotkey.split(".");
| 862| 862| 						performGroup(sptr[2], sptr[3]);
| 863| 863| 
| 864|    |-						doublePressTimer = now;
|    | 864|+					doublePressTimer = now;
| 865| 865| 						prevHotkey = ev.hotkey;
| 866| 866| 					}
| 867| 867| 				}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 862| 862| 						performGroup(sptr[2], sptr[3]);
| 863| 863| 
| 864| 864| 						doublePressTimer = now;
| 865|    |-						prevHotkey = ev.hotkey;
|    | 865|+					prevHotkey = ev.hotkey;
| 866| 866| 					}
| 867| 867| 				}
| 868| 868| 				break;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 863| 863| 
| 864| 864| 						doublePressTimer = now;
| 865| 865| 						prevHotkey = ev.hotkey;
| 866|    |-					}
|    | 866|+				}
| 867| 867| 				}
| 868| 868| 				break;
| 869| 869| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 864| 864| 						doublePressTimer = now;
| 865| 865| 						prevHotkey = ev.hotkey;
| 866| 866| 					}
| 867|    |-				}
|    | 867|+			}
| 868| 868| 				break;
| 869| 869| 		}
| 870| 870| 		break;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
| 865| 865| 						prevHotkey = ev.hotkey;
| 866| 866| 					}
| 867| 867| 				}
| 868|    |-				break;
|    | 868|+			break;
| 869| 869| 		}
| 870| 870| 		break;
| 871| 871| 
|    | [NORMAL] ESLintBear (space-in-parens):
|    | There should be no spaces inside this paren.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|1496|1496| 		g_BatchTrainingEntityAllowedCount < batchedSize * appropriateBuildings.length)
|1497|1497| 	{
|1498|1498| 		// Train as many full batches as we can
|1499|    |-		let buildingsCountToTrainFullBatch = Math.floor( g_BatchTrainingEntityAllowedCount / batchedSize);
|    |1499|+		let buildingsCountToTrainFullBatch = Math.floor(g_BatchTrainingEntityAllowedCount / batchedSize);
|1500|1500| 		Engine.PostNetworkCommand({
|1501|1501| 			"type": "train",
|1502|1502| 			"entities": appropriateBuildings.slice(0, buildingsCountToTrainFullBatch),
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/input.js
|1575|1575| 	var selectall = Engine.HotkeyIsPressed("selection.offscreen");
|1576|1576| 
|1577|1577| 	// Reset the last idle unit, etc., if the selection type has changed.
|1578|    |-	if (selectall || classes.length != lastIdleClasses.length || !classes.every((v,i) => v === lastIdleClasses[i]))
|    |1578|+	if (selectall || classes.length != lastIdleClasses.length || !classes.every((v, i) => v === lastIdleClasses[i]))
|1579|1579| 		resetIdleUnit();
|1580|1580| 	lastIdleClasses = classes;
|1581|1581| 

binaries/data/mods/public/gui/session/input.js
| 231| »   var·target·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'target' to undefined.

binaries/data/mods/public/gui/session/input.js
| 472| »   switch·(ev.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/input.js
| 499| »   switch·(inputState)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/input.js
| 503| »   »   switch·(ev.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/input.js
| 558| »   »   switch·(ev.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/input.js
| 568| »   »   switch·(ev.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/input.js
| 616| »   »   switch·(ev.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/input.js
| 645| »   »   switch·(ev.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/input.js
| 714| »   »   switch·(ev.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/input.js
| 812| »   switch·(inputState)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/input.js
| 815| »   »   switch·(ev.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/input.js
| 917| »   »   switch·(ev.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/input.js
|1006| »   »   switch·(ev.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/input.js
|1020| »   »   »   »   let·action·=·determineAction(ev.x,·ev.y);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'action' is already declared in the upper scope.

binaries/data/mods/public/gui/session/input.js
|1029| »   »   switch·(ev.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/input.js
|1098| »   »   »   switch·(ev.hotkey)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/input.js
|1526| »   switch·(action)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/input.js
| 231| »   var·target·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'target' to 'undefined'.

binaries/data/mods/public/gui/session/input.js
| 487| »   »   &&·(ev.button·==·SDL_BUTTON_LEFT·||·ev.button·==·SDL_BUTTON_RIGHT))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/gui/session/input.js
| 517| »   »   »   »   var·rect·=·updateBandbox(bandbox,·ev,·true);
|    | [NORMAL] JSHintBear:
|    | 'rect' is already defined.

binaries/data/mods/public/gui/session/input.js
| 520| »   »   »   »   var·ents·=·getPreferredEntities(Engine.PickPlayerEntitiesInRect(rect[0],·rect[1],·rect[2],·rect[3],·g_ViewedPlayer));
|    | [NORMAL] JSHintBear:
|    | 'ents' is already defined.

binaries/data/mods/public/gui/session/input.js
| 677| »   »   »   »   »   var·queued·=·Engine.HotkeyIsPressed("session.queue");
|    | [NORMAL] JSHintBear:
|    | 'queued' is already defined.

binaries/data/mods/public/gui/session/input.js
| 748| »   »   »   »   var·queued·=·Engine.HotkeyIsPressed("session.queue");
|    | [NORMAL] JSHintBear:
|    | 'queued' is already defined.

binaries/data/mods/public/gui/session/input.js
| 861| »   »   »   »   »   »   var·sptr·=·ev.hotkey.split(".");
|    | [NORMAL] JSHintBear:
|    | 'sptr' is already defined.

binaries/data/mods/public/gui/session/input.js
| 877| »   »   »   var·ent·=·Engine.PickEntityAtPoint(ev.x,·ev.y);
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

binaries/data/mods/public/gui/session/input.js
| 903| »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'default'.

binaries/data/mods/public/gui/session/input.js
| 927| »   »   »   var·ent·=·Engine.PickEntityAtPoint(ev.x,·ev.y);
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.
Executing section cli...

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

Freagarach marked 2 inline comments as done.Sat, Nov 16, 9:06 AM
Freagarach added inline comments.
binaries/data/mods/public/gui/session/input.js
248

Might be beneficial to cache this besides the g_UnitActions, since it is computed every time the cursor moves? (g_UnitActionsSorted?)

binaries/data/mods/public/gui/session/selection_panels_helpers.js
358

Should indeed be renamed.

binaries/data/mods/public/gui/session/unit_actions.js
1060

Really should because now it just sends the lowest entity ID to attack and that is probably a civilian.

1074

This translation works for now, but is bad for the user. How could we reliably specify to the user which action is to be undertaken?
We could include translations in the g_UnitActions action checks?

Freagarach added inline comments.Sat, Nov 16, 9:08 AM
binaries/data/mods/public/gui/session/unit_actions.js
1048–1051

+/t