Page MenuHomeWildfire Games

Input.js refactoring - separate diplomatic tribute in their own file.
Needs ReviewPublic

Authored by wraitii on Apr 20 2019, 4:32 PM.

Details

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

Rewrite diplomatic tribute code in its own file.
The rewrite is more react-ive by definition - as in like React - as in I separated state and rendering, when they were tied before.

If we rewrote every input mode like this, the input.js could be genericised, and then we wouldn't even need D1786.

Open questions:

  • Should we create the object when opening the diplomacy window?
  • How much do we want to automate the reactivity of rendering?
Test Plan

Look at changes.

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
D1837_refactor_input_tributing
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 7230
Build 11784: Vulcan BuildJenkins
Build 11783: arc lint + arc unit

Event Timeline

wraitii created this revision.Apr 20 2019, 4:32 PM

This change isn't necessary "production ready" as it's kind of a straightforward code move, but it works. Note that since we now have an easy way to handle state, we could improve the tributing (for example, tributing different resources in one go...) quite easily, whereas before it was bound to be a pain.

if we go this route we might want to implement some conventions using ES6 classes or something.

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|   6|   6| 	this.hidden = {};
|   7|   7| 
|   8|   8| 	this.currentAmounts = {};
|   9|    |-}
|    |   9|+};
|  10|  10| 
|  11|  11| const TributingMenu = function() {}
|  12|  12| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|   8|   8| 	this.currentAmounts = {};
|   9|   9| }
|  10|  10| 
|  11|    |-const TributingMenu = function() {}
|    |  11|+const TributingMenu = function() {};
|  12|  12| 
|  13|  13| 
|  14|  14| TributingAction.prototype.processEvent = function(ev) {
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|  14|  14| TributingAction.prototype.processEvent = function(ev) {
|  15|  15| 	if (ev.type == "hotkeyup" && ev.hotkey == "session.masstribute")
|  16|  16| 		this.doTribute();
|  17|    |-}
|    |  17|+};
|  18|  18| 
|  19|  19| 
|  20|  20| TributingAction.prototype.setPlayerHidden = function(player, hidden) {
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|  20|  20| TributingAction.prototype.setPlayerHidden = function(player, hidden) {
|  21|  21| 	this.hidden[player] = hidden;
|  22|  22| 	this.render();
|  23|    |-}
|    |  23|+};
|  24|  24| 
|  25|  25| TributingAction.prototype.getCurrentAmount = function() {
|  26|  26| 	return 100 * this.multiplier;
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|  24|  24| 
|  25|  25| TributingAction.prototype.getCurrentAmount = function() {
|  26|  26| 	return 100 * this.multiplier;
|  27|    |-}
|    |  27|+};
|  28|  28| 
|  29|  29| TributingAction.prototype.tributeButtonClicked = function(i, resCode) {
|  30|  30| 	let isBatchTrainPressed = Engine.HotkeyIsPressed("session.masstribute");
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|  50|  50| 	Engine.PostNetworkCommand({ "type": "tribute", "player": this.tributePlayer, "amounts": this.currentAmounts });
|  51|  51| 	this.multiplier = 1;
|  52|  52| 	inputState = INPUT_NORMAL;
|  53|    |-}
|    |  53|+};
|  54|  54| 
|  55|  55| TributingAction.prototype.formatTributeTooltip = function(playerID, resourceCode, amount)
|  56|  56| {
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|  60|  60| 		"playerName": colorizePlayernameByID(playerID),
|  61|  61| 		"greaterAmount": amount < 500 ? 500 : amount + 500
|  62|  62| 	});
|  63|    |-}
|    |  63|+};
|  64|  64| 
|  65|  65| TributingAction.prototype.renderPlayer = function(i) {
|  66|  66| 	let resCodes = g_ResourceData.GetCodes();
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|  85|  85| 		button.tooltip = this.formatTributeTooltip(i, resCode, this.getCurrentAmount());
|  86|  86| 		button.onPress = ((i, resCode) => () => this.tributeButtonClicked(i, resCode))(i, resCode);
|  87|  87| 	}
|  88|    |-}
|    |  88|+};
|  89|  89| 
|  90|  90| TributingAction.prototype.render = function() {
|  91|  91| 	for (let i = 1; i < g_Players.length; ++i)
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|  90|  90| TributingAction.prototype.render = function() {
|  91|  91| 	for (let i = 1; i < g_Players.length; ++i)
|  92|  92| 		this.renderPlayer(i);
|  93|    |-}
|    |  93|+};
|  94|  94| 
|  95|  95| const g_TributingAction = new TributingAction();

binaries/data/mods/public/gui/session/inputs/tributing.js
|  86| »   »   button.onPress·=·((i,·resCode)·=>·()·=>·this.tributeButtonClicked(i,·resCode))(i,·resCode);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/inputs/tributing.js
|  86| »   »   button.onPress·=·((i,·resCode)·=>·()·=>·this.tributeButtonClicked(i,·resCode))(i,·resCode);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'resCode' is already declared in the upper scope.

binaries/data/mods/public/gui/session/inputs/tributing.js
|   9| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/session/inputs/tributing.js
|  11| const·TributingMenu·=·function()·{}
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/session/inputs/tributing.js
|  17| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/session/inputs/tributing.js
|  23| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/session/inputs/tributing.js
|  27| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/session/inputs/tributing.js
|  53| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/session/inputs/tributing.js
|  63| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/session/inputs/tributing.js
|  88| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/session/inputs/tributing.js
|  93| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/menu.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/menu.js
| 817| 817| 	Engine.GetGUIObjectByName("barterHelp").hidden = !canBarter;
| 818| 818| 
| 819| 819| 	if (canBarter)
| 820|    |-		g_ResourceData.GetCodes().forEach((resCode, i) => { barterUpdateCommon(resCode, i, "barter", g_ViewedPlayer) });
|    | 820|+		g_ResourceData.GetCodes().forEach((resCode, i) => { barterUpdateCommon(resCode, i, "barter", g_ViewedPlayer); });
| 821| 821| }
| 822| 822| 
| 823| 823| function getIdleLandTradersText(traderNumber)

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

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

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

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

binaries/data/mods/public/gui/session/menu.js
| 820| »   »   g_ResourceData.GetCodes().forEach((resCode,·i)·=>·{·barterUpdateCommon(resCode,·i,·"barter",·g_ViewedPlayer)·});
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 181| 181| 		}
| 182| 182| 	}
| 183| 183| 	else if (placementSupport.mode === "wall")
| 184|    |-	{
|    | 184|+	
| 185| 185| 		if (placementSupport.wallSet && placementSupport.position)
| 186| 186| 		{
| 187| 187| 			// Fetch an updated list of snapping candidate entities
| 199| 199| 				"snapEntities": placementSupport.wallSnapEntities,	// snapping entities (towers) for starting a wall segment
| 200| 200| 			});
| 201| 201| 		}
| 202|    |-	}
|    | 202|+	
| 203| 203| 
| 204| 204| 	return false;
| 205| 205| }
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 288| 288| 	}
| 289| 289| 
| 290| 290| 	if (!updateBuildingPlacementPreview())
| 291|    |-	{
|    | 291|+	
| 292| 292| 		// invalid location - don't build it
| 293| 293| 		// TODO: play a sound?
| 294| 294| 		return false;
| 295|    |-	}
|    | 295|+	
| 296| 296| 
| 297| 297| 	var selection = g_Selection.toList();
| 298| 298| 
|    | [NORMAL] ESLintBear (space-unary-ops):
|    | Unary word operator 'typeof' must be followed by whitespace.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 327| 327| 	}
| 328| 328| 
| 329| 329| 	var wallPlacementInfo = updateBuildingPlacementPreview(); // entities making up the wall (wall segments, towers, ...)
| 330|    |-	if (!(wallPlacementInfo === false || typeof(wallPlacementInfo) === "object"))
|    | 330|+	if (!(wallPlacementInfo === false || typeof (wallPlacementInfo) === "object"))
| 331| 331| 	{
| 332| 332| 		error("Invalid updateBuildingPlacementPreview return value: " + uneval(wallPlacementInfo));
| 333| 333| 		return false;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 354| 354| 	// (this is somewhat non-ideal and hardcode-ish)
| 355| 355| 	var hasWallSegment = false;
| 356| 356| 	for (let piece of cmd.pieces)
| 357|    |-	{
|    | 357|+	
| 358| 358| 		if (piece.template != cmd.wallSet.templates.tower) // TODO: hardcode-ish :(
| 359| 359| 		{
| 360| 360| 			hasWallSegment = true;
| 361| 361| 			break;
| 362| 362| 		}
| 363|    |-	}
|    | 363|+	
| 364| 364| 
| 365| 365| 	if (hasWallSegment)
| 366| 366| 	{
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 477| 477| 	mouseIsOverObject = (hoveredObject != null);
| 478| 478| 
| 479| 479| 	// Close the menu when interacting with the game world
| 480|    |-	if (!mouseIsOverObject && (ev.type =="mousebuttonup" || ev.type == "mousebuttondown")
| 481|    |-		&& (ev.button == SDL_BUTTON_LEFT || ev.button == SDL_BUTTON_RIGHT))
|    | 480|+	if (!mouseIsOverObject && (ev.type =="mousebuttonup" || ev.type == "mousebuttondown") &&
|    | 481|+		(ev.button == SDL_BUTTON_LEFT || ev.button == SDL_BUTTON_RIGHT))
| 482| 482| 		closeMenu();
| 483| 483| 
| 484| 484| 	// State-machine processing:
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 518| 518| 
| 519| 519| 				// Update the list of selected units
| 520| 520| 				if (Engine.HotkeyIsPressed("selection.add"))
| 521|    |-				{
|    | 521|+				
| 522| 522| 					g_Selection.addList(ents);
| 523|    |-				}
|    | 523|+				
| 524| 524| 				else if (Engine.HotkeyIsPressed("selection.remove"))
| 525| 525| 				{
| 526| 526| 					g_Selection.removeList(ents);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 522| 522| 					g_Selection.addList(ents);
| 523| 523| 				}
| 524| 524| 				else if (Engine.HotkeyIsPressed("selection.remove"))
| 525|    |-				{
|    | 525|+				
| 526| 526| 					g_Selection.removeList(ents);
| 527|    |-				}
|    | 527|+				
| 528| 528| 				else
| 529| 529| 				{
| 530| 530| 					g_Selection.reset();
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 578| 578| 				// If shift is down, let the player continue placing another of the same building
| 579| 579| 				var queued = Engine.HotkeyIsPressed("session.queue");
| 580| 580| 				if (tryPlaceBuilding(queued))
| 581|    |-				{
|    | 581|+				
| 582| 582| 					if (queued)
| 583| 583| 						inputState = INPUT_BUILDING_PLACEMENT;
| 584| 584| 					else
| 585| 585| 						inputState = INPUT_NORMAL;
| 586|    |-				}
|    | 586|+				
| 587| 587| 				else
| 588| 588| 				{
| 589| 589| 					inputState = INPUT_BUILDING_PLACEMENT;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 585| 585| 						inputState = INPUT_NORMAL;
| 586| 586| 				}
| 587| 587| 				else
| 588|    |-				{
|    | 588|+				
| 589| 589| 					inputState = INPUT_BUILDING_PLACEMENT;
| 590|    |-				}
|    | 590|+				
| 591| 591| 				return true;
| 592| 592| 			}
| 593| 593| 			break;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 638| 638| 		// user to continue building walls.
| 639| 639| 		switch (ev.type)
| 640| 640| 		{
| 641|    |-			case "mousemotion":
|    | 641|+		case "mousemotion":
| 642| 642| 				placementSupport.wallEndPosition = Engine.GetTerrainAtScreenPoint(ev.x, ev.y);
| 643| 643| 
| 644| 644| 				// 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.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 639| 639| 		switch (ev.type)
| 640| 640| 		{
| 641| 641| 			case "mousemotion":
| 642|    |-				placementSupport.wallEndPosition = Engine.GetTerrainAtScreenPoint(ev.x, ev.y);
|    | 642|+			placementSupport.wallEndPosition = Engine.GetTerrainAtScreenPoint(ev.x, ev.y);
| 643| 643| 
| 644| 644| 				// Update the building placement preview, and by extension, the list of snapping candidate entities for both (!)
| 645| 645| 				// the ending point and the starting point to snap to.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 641| 641| 			case "mousemotion":
| 642| 642| 				placementSupport.wallEndPosition = Engine.GetTerrainAtScreenPoint(ev.x, ev.y);
| 643| 643| 
| 644|    |-				// Update the building placement preview, and by extension, the list of snapping candidate entities for both (!)
|    | 644|+			// Update the building placement preview, and by extension, the list of snapping candidate entities for both (!)
| 645| 645| 				// the ending point and the starting point to snap to.
| 646| 646| 				//
| 647| 647| 				// 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.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 642| 642| 				placementSupport.wallEndPosition = Engine.GetTerrainAtScreenPoint(ev.x, ev.y);
| 643| 643| 
| 644| 644| 				// Update the building placement preview, and by extension, the list of snapping candidate entities for both (!)
| 645|    |-				// the ending point and the starting point to snap to.
|    | 645|+			// the ending point and the starting point to snap to.
| 646| 646| 				//
| 647| 647| 				// TODO: Note that here, we need to fetch all similar entities, including any offscreen ones, to support the case
| 648| 648| 				// 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.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 643| 643| 
| 644| 644| 				// Update the building placement preview, and by extension, the list of snapping candidate entities for both (!)
| 645| 645| 				// the ending point and the starting point to snap to.
| 646|    |-				//
|    | 646|+			//
| 647| 647| 				// TODO: Note that here, we need to fetch all similar entities, including any offscreen ones, to support the case
| 648| 648| 				// where the snap entity for the starting point has moved offscreen, or has been deleted/destroyed, or was a
| 649| 649| 				// 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.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 644| 644| 				// Update the building placement preview, and by extension, the list of snapping candidate entities for both (!)
| 645| 645| 				// the ending point and the starting point to snap to.
| 646| 646| 				//
| 647|    |-				// TODO: Note that here, we need to fetch all similar entities, including any offscreen ones, to support the case
|    | 647|+			// TODO: Note that here, we need to fetch all similar entities, including any offscreen ones, to support the case
| 648| 648| 				// where the snap entity for the starting point has moved offscreen, or has been deleted/destroyed, or was a
| 649| 649| 				// foundation and has been replaced with a completed entity since the user first chose it. Fetching all towers on
| 650| 650| 				// 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.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 645| 645| 				// the ending point and the starting point to snap to.
| 646| 646| 				//
| 647| 647| 				// TODO: Note that here, we need to fetch all similar entities, including any offscreen ones, to support the case
| 648|    |-				// where the snap entity for the starting point has moved offscreen, or has been deleted/destroyed, or was a
|    | 648|+			// where the snap entity for the starting point has moved offscreen, or has been deleted/destroyed, or was a
| 649| 649| 				// foundation and has been replaced with a completed entity since the user first chose it. Fetching all towers on
| 650| 650| 				// the entire map instead of only the current screen might get expensive fast since walls all have a ton of towers
| 651| 651| 				// 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.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 646| 646| 				//
| 647| 647| 				// TODO: Note that here, we need to fetch all similar entities, including any offscreen ones, to support the case
| 648| 648| 				// where the snap entity for the starting point has moved offscreen, or has been deleted/destroyed, or was a
| 649|    |-				// foundation and has been replaced with a completed entity since the user first chose it. Fetching all towers on
|    | 649|+			// foundation and has been replaced with a completed entity since the user first chose it. Fetching all towers on
| 650| 650| 				// the entire map instead of only the current screen might get expensive fast since walls all have a ton of towers
| 651| 651| 				// in them. Might be useful to query only for entities within a certain range around the starting point and ending
| 652| 652| 				// points.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 647| 647| 				// TODO: Note that here, we need to fetch all similar entities, including any offscreen ones, to support the case
| 648| 648| 				// where the snap entity for the starting point has moved offscreen, or has been deleted/destroyed, or was a
| 649| 649| 				// foundation and has been replaced with a completed entity since the user first chose it. Fetching all towers on
| 650|    |-				// the entire map instead of only the current screen might get expensive fast since walls all have a ton of towers
|    | 650|+			// the entire map instead of only the current screen might get expensive fast since walls all have a ton of towers
| 651| 651| 				// in them. Might be useful to query only for entities within a certain range around the starting point and ending
| 652| 652| 				// points.
| 653| 653| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 648| 648| 				// where the snap entity for the starting point has moved offscreen, or has been deleted/destroyed, or was a
| 649| 649| 				// foundation and has been replaced with a completed entity since the user first chose it. Fetching all towers on
| 650| 650| 				// the entire map instead of only the current screen might get expensive fast since walls all have a ton of towers
| 651|    |-				// in them. Might be useful to query only for entities within a certain range around the starting point and ending
|    | 651|+			// in them. Might be useful to query only for entities within a certain range around the starting point and ending
| 652| 652| 				// points.
| 653| 653| 
| 654| 654| 				placementSupport.wallSnapEntitiesIncludeOffscreen = true;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 649| 649| 				// foundation and has been replaced with a completed entity since the user first chose it. Fetching all towers on
| 650| 650| 				// the entire map instead of only the current screen might get expensive fast since walls all have a ton of towers
| 651| 651| 				// in them. Might be useful to query only for entities within a certain range around the starting point and ending
| 652|    |-				// points.
|    | 652|+			// points.
| 653| 653| 
| 654| 654| 				placementSupport.wallSnapEntitiesIncludeOffscreen = true;
| 655| 655| 				var result = updateBuildingPlacementPreview(); // includes an update of the snap entity candidates
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 651| 651| 				// in them. Might be useful to query only for entities within a certain range around the starting point and ending
| 652| 652| 				// points.
| 653| 653| 
| 654|    |-				placementSupport.wallSnapEntitiesIncludeOffscreen = true;
|    | 654|+			placementSupport.wallSnapEntitiesIncludeOffscreen = true;
| 655| 655| 				var result = updateBuildingPlacementPreview(); // includes an update of the snap entity candidates
| 656| 656| 
| 657| 657| 				if (result && result.cost)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 652| 652| 				// points.
| 653| 653| 
| 654| 654| 				placementSupport.wallSnapEntitiesIncludeOffscreen = true;
| 655|    |-				var result = updateBuildingPlacementPreview(); // includes an update of the snap entity candidates
|    | 655|+			var result = updateBuildingPlacementPreview(); // includes an update of the snap entity candidates
| 656| 656| 
| 657| 657| 				if (result && result.cost)
| 658| 658| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 654| 654| 				placementSupport.wallSnapEntitiesIncludeOffscreen = true;
| 655| 655| 				var result = updateBuildingPlacementPreview(); // includes an update of the snap entity candidates
| 656| 656| 
| 657|    |-				if (result && result.cost)
|    | 657|+			if (result && result.cost)
| 658| 658| 				{
| 659| 659| 					var neededResources = Engine.GuiInterfaceCall("GetNeededResources", { "cost": result.cost });
| 660| 660| 					placementSupport.tooltipMessage = [
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 655| 655| 				var result = updateBuildingPlacementPreview(); // includes an update of the snap entity candidates
| 656| 656| 
| 657| 657| 				if (result && result.cost)
| 658|    |-				{
|    | 658|+			{
| 659| 659| 					var neededResources = Engine.GuiInterfaceCall("GetNeededResources", { "cost": result.cost });
| 660| 660| 					placementSupport.tooltipMessage = [
| 661| 661| 						getEntityCostTooltip(result),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 656| 656| 
| 657| 657| 				if (result && result.cost)
| 658| 658| 				{
| 659|    |-					var neededResources = Engine.GuiInterfaceCall("GetNeededResources", { "cost": result.cost });
|    | 659|+				var neededResources = Engine.GuiInterfaceCall("GetNeededResources", { "cost": result.cost });
| 660| 660| 					placementSupport.tooltipMessage = [
| 661| 661| 						getEntityCostTooltip(result),
| 662| 662| 						getNeededResourcesTooltip(neededResources)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 657| 657| 				if (result && result.cost)
| 658| 658| 				{
| 659| 659| 					var neededResources = Engine.GuiInterfaceCall("GetNeededResources", { "cost": result.cost });
| 660|    |-					placementSupport.tooltipMessage = [
|    | 660|+				placementSupport.tooltipMessage = [
| 661| 661| 						getEntityCostTooltip(result),
| 662| 662| 						getNeededResourcesTooltip(neededResources)
| 663| 663| 					].filter(tip => tip).join("\n");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 658| 658| 				{
| 659| 659| 					var neededResources = Engine.GuiInterfaceCall("GetNeededResources", { "cost": result.cost });
| 660| 660| 					placementSupport.tooltipMessage = [
| 661|    |-						getEntityCostTooltip(result),
|    | 661|+					getEntityCostTooltip(result),
| 662| 662| 						getNeededResourcesTooltip(neededResources)
| 663| 663| 					].filter(tip => tip).join("\n");
| 664| 664| 				}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 659| 659| 					var neededResources = Engine.GuiInterfaceCall("GetNeededResources", { "cost": result.cost });
| 660| 660| 					placementSupport.tooltipMessage = [
| 661| 661| 						getEntityCostTooltip(result),
| 662|    |-						getNeededResourcesTooltip(neededResources)
|    | 662|+					getNeededResourcesTooltip(neededResources)
| 663| 663| 					].filter(tip => tip).join("\n");
| 664| 664| 				}
| 665| 665| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 660| 660| 					placementSupport.tooltipMessage = [
| 661| 661| 						getEntityCostTooltip(result),
| 662| 662| 						getNeededResourcesTooltip(neededResources)
| 663|    |-					].filter(tip => tip).join("\n");
|    | 663|+				].filter(tip => tip).join("\n");
| 664| 664| 				}
| 665| 665| 
| 666| 666| 				break;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 661| 661| 						getEntityCostTooltip(result),
| 662| 662| 						getNeededResourcesTooltip(neededResources)
| 663| 663| 					].filter(tip => tip).join("\n");
| 664|    |-				}
|    | 664|+			}
| 665| 665| 
| 666| 666| 				break;
| 667| 667| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 663| 663| 					].filter(tip => tip).join("\n");
| 664| 664| 				}
| 665| 665| 
| 666|    |-				break;
|    | 666|+			break;
| 667| 667| 
| 668| 668| 			case "mousebuttondown":
| 669| 669| 				if (ev.button == SDL_BUTTON_LEFT)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 665| 665| 
| 666| 666| 				break;
| 667| 667| 
| 668|    |-			case "mousebuttondown":
|    | 668|+		case "mousebuttondown":
| 669| 669| 				if (ev.button == SDL_BUTTON_LEFT)
| 670| 670| 				{
| 671| 671| 					var queued = Engine.HotkeyIsPressed("session.queue");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 666| 666| 				break;
| 667| 667| 
| 668| 668| 			case "mousebuttondown":
| 669|    |-				if (ev.button == SDL_BUTTON_LEFT)
|    | 669|+			if (ev.button == SDL_BUTTON_LEFT)
| 670| 670| 				{
| 671| 671| 					var queued = Engine.HotkeyIsPressed("session.queue");
| 672| 672| 					if (tryPlaceWall(queued))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 667| 667| 
| 668| 668| 			case "mousebuttondown":
| 669| 669| 				if (ev.button == SDL_BUTTON_LEFT)
| 670|    |-				{
|    | 670|+			{
| 671| 671| 					var queued = Engine.HotkeyIsPressed("session.queue");
| 672| 672| 					if (tryPlaceWall(queued))
| 673| 673| 					{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 668| 668| 			case "mousebuttondown":
| 669| 669| 				if (ev.button == SDL_BUTTON_LEFT)
| 670| 670| 				{
| 671|    |-					var queued = Engine.HotkeyIsPressed("session.queue");
|    | 671|+				var queued = Engine.HotkeyIsPressed("session.queue");
| 672| 672| 					if (tryPlaceWall(queued))
| 673| 673| 					{
| 674| 674| 						if (queued)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 669| 669| 				if (ev.button == SDL_BUTTON_LEFT)
| 670| 670| 				{
| 671| 671| 					var queued = Engine.HotkeyIsPressed("session.queue");
| 672|    |-					if (tryPlaceWall(queued))
|    | 672|+				if (tryPlaceWall(queued))
| 673| 673| 					{
| 674| 674| 						if (queued)
| 675| 675| 						{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 670| 670| 				{
| 671| 671| 					var queued = Engine.HotkeyIsPressed("session.queue");
| 672| 672| 					if (tryPlaceWall(queued))
| 673|    |-					{
|    | 673|+					
| 674| 674| 						if (queued)
| 675| 675| 						{
| 676| 676| 							// continue building, just set a new starting position where we left off
| 684| 684| 							placementSupport.Reset();
| 685| 685| 							inputState = INPUT_NORMAL;
| 686| 686| 						}
| 687|    |-					}
|    | 687|+					
| 688| 688| 					else
| 689| 689| 						placementSupport.tooltipMessage = translate("Cannot build wall here!");
| 690| 690| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 670| 670| 				{
| 671| 671| 					var queued = Engine.HotkeyIsPressed("session.queue");
| 672| 672| 					if (tryPlaceWall(queued))
| 673|    |-					{
|    | 673|+				{
| 674| 674| 						if (queued)
| 675| 675| 						{
| 676| 676| 							// continue building, just set a new starting position where we left off
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 671| 671| 					var queued = Engine.HotkeyIsPressed("session.queue");
| 672| 672| 					if (tryPlaceWall(queued))
| 673| 673| 					{
| 674|    |-						if (queued)
|    | 674|+					if (queued)
| 675| 675| 						{
| 676| 676| 							// continue building, just set a new starting position where we left off
| 677| 677| 							placementSupport.position = placementSupport.wallEndPosition;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 672| 672| 					if (tryPlaceWall(queued))
| 673| 673| 					{
| 674| 674| 						if (queued)
| 675|    |-						{
|    | 675|+					{
| 676| 676| 							// continue building, just set a new starting position where we left off
| 677| 677| 							placementSupport.position = placementSupport.wallEndPosition;
| 678| 678| 							placementSupport.wallEndPosition = undefined;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 673| 673| 					{
| 674| 674| 						if (queued)
| 675| 675| 						{
| 676|    |-							// continue building, just set a new starting position where we left off
|    | 676|+						// continue building, just set a new starting position where we left off
| 677| 677| 							placementSupport.position = placementSupport.wallEndPosition;
| 678| 678| 							placementSupport.wallEndPosition = undefined;
| 679| 679| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 674| 674| 						if (queued)
| 675| 675| 						{
| 676| 676| 							// continue building, just set a new starting position where we left off
| 677|    |-							placementSupport.position = placementSupport.wallEndPosition;
|    | 677|+						placementSupport.position = placementSupport.wallEndPosition;
| 678| 678| 							placementSupport.wallEndPosition = undefined;
| 679| 679| 
| 680| 680| 							inputState = INPUT_BUILDING_WALL_CLICK;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 675| 675| 						{
| 676| 676| 							// continue building, just set a new starting position where we left off
| 677| 677| 							placementSupport.position = placementSupport.wallEndPosition;
| 678|    |-							placementSupport.wallEndPosition = undefined;
|    | 678|+						placementSupport.wallEndPosition = undefined;
| 679| 679| 
| 680| 680| 							inputState = INPUT_BUILDING_WALL_CLICK;
| 681| 681| 						}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 677| 677| 							placementSupport.position = placementSupport.wallEndPosition;
| 678| 678| 							placementSupport.wallEndPosition = undefined;
| 679| 679| 
| 680|    |-							inputState = INPUT_BUILDING_WALL_CLICK;
|    | 680|+						inputState = INPUT_BUILDING_WALL_CLICK;
| 681| 681| 						}
| 682| 682| 						else
| 683| 683| 						{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 678| 678| 							placementSupport.wallEndPosition = undefined;
| 679| 679| 
| 680| 680| 							inputState = INPUT_BUILDING_WALL_CLICK;
| 681|    |-						}
|    | 681|+					}
| 682| 682| 						else
| 683| 683| 						{
| 684| 684| 							placementSupport.Reset();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 679| 679| 
| 680| 680| 							inputState = INPUT_BUILDING_WALL_CLICK;
| 681| 681| 						}
| 682|    |-						else
|    | 682|+					else
| 683| 683| 						{
| 684| 684| 							placementSupport.Reset();
| 685| 685| 							inputState = INPUT_NORMAL;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 680| 680| 							inputState = INPUT_BUILDING_WALL_CLICK;
| 681| 681| 						}
| 682| 682| 						else
| 683|    |-						{
|    | 683|+					{
| 684| 684| 							placementSupport.Reset();
| 685| 685| 							inputState = INPUT_NORMAL;
| 686| 686| 						}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 681| 681| 						}
| 682| 682| 						else
| 683| 683| 						{
| 684|    |-							placementSupport.Reset();
|    | 684|+						placementSupport.Reset();
| 685| 685| 							inputState = INPUT_NORMAL;
| 686| 686| 						}
| 687| 687| 					}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 682| 682| 						else
| 683| 683| 						{
| 684| 684| 							placementSupport.Reset();
| 685|    |-							inputState = INPUT_NORMAL;
|    | 685|+						inputState = INPUT_NORMAL;
| 686| 686| 						}
| 687| 687| 					}
| 688| 688| 					else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 683| 683| 						{
| 684| 684| 							placementSupport.Reset();
| 685| 685| 							inputState = INPUT_NORMAL;
| 686|    |-						}
|    | 686|+					}
| 687| 687| 					}
| 688| 688| 					else
| 689| 689| 						placementSupport.tooltipMessage = translate("Cannot build wall here!");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 684| 684| 							placementSupport.Reset();
| 685| 685| 							inputState = INPUT_NORMAL;
| 686| 686| 						}
| 687|    |-					}
|    | 687|+				}
| 688| 688| 					else
| 689| 689| 						placementSupport.tooltipMessage = translate("Cannot build wall here!");
| 690| 690| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 685| 685| 							inputState = INPUT_NORMAL;
| 686| 686| 						}
| 687| 687| 					}
| 688|    |-					else
|    | 688|+				else
| 689| 689| 						placementSupport.tooltipMessage = translate("Cannot build wall here!");
| 690| 690| 
| 691| 691| 					updateBuildingPlacementPreview();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 686| 686| 						}
| 687| 687| 					}
| 688| 688| 					else
| 689|    |-						placementSupport.tooltipMessage = translate("Cannot build wall here!");
|    | 689|+					placementSupport.tooltipMessage = translate("Cannot build wall here!");
| 690| 690| 
| 691| 691| 					updateBuildingPlacementPreview();
| 692| 692| 					return true;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 688| 688| 					else
| 689| 689| 						placementSupport.tooltipMessage = translate("Cannot build wall here!");
| 690| 690| 
| 691|    |-					updateBuildingPlacementPreview();
|    | 691|+				updateBuildingPlacementPreview();
| 692| 692| 					return true;
| 693| 693| 				}
| 694| 694| 				else if (ev.button == SDL_BUTTON_RIGHT)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 689| 689| 						placementSupport.tooltipMessage = translate("Cannot build wall here!");
| 690| 690| 
| 691| 691| 					updateBuildingPlacementPreview();
| 692|    |-					return true;
|    | 692|+				return true;
| 693| 693| 				}
| 694| 694| 				else if (ev.button == SDL_BUTTON_RIGHT)
| 695| 695| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 690| 690| 
| 691| 691| 					updateBuildingPlacementPreview();
| 692| 692| 					return true;
| 693|    |-				}
|    | 693|+			}
| 694| 694| 				else if (ev.button == SDL_BUTTON_RIGHT)
| 695| 695| 				{
| 696| 696| 					// reset to normal input mode
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 691| 691| 					updateBuildingPlacementPreview();
| 692| 692| 					return true;
| 693| 693| 				}
| 694|    |-				else if (ev.button == SDL_BUTTON_RIGHT)
|    | 694|+			else if (ev.button == SDL_BUTTON_RIGHT)
| 695| 695| 				{
| 696| 696| 					// reset to normal input mode
| 697| 697| 					placementSupport.Reset();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 692| 692| 					return true;
| 693| 693| 				}
| 694| 694| 				else if (ev.button == SDL_BUTTON_RIGHT)
| 695|    |-				{
|    | 695|+			{
| 696| 696| 					// reset to normal input mode
| 697| 697| 					placementSupport.Reset();
| 698| 698| 					updateBuildingPlacementPreview();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 693| 693| 				}
| 694| 694| 				else if (ev.button == SDL_BUTTON_RIGHT)
| 695| 695| 				{
| 696|    |-					// reset to normal input mode
|    | 696|+				// reset to normal input mode
| 697| 697| 					placementSupport.Reset();
| 698| 698| 					updateBuildingPlacementPreview();
| 699| 699| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 694| 694| 				else if (ev.button == SDL_BUTTON_RIGHT)
| 695| 695| 				{
| 696| 696| 					// reset to normal input mode
| 697|    |-					placementSupport.Reset();
|    | 697|+				placementSupport.Reset();
| 698| 698| 					updateBuildingPlacementPreview();
| 699| 699| 
| 700| 700| 					inputState = INPUT_NORMAL;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 695| 695| 				{
| 696| 696| 					// reset to normal input mode
| 697| 697| 					placementSupport.Reset();
| 698|    |-					updateBuildingPlacementPreview();
|    | 698|+				updateBuildingPlacementPreview();
| 699| 699| 
| 700| 700| 					inputState = INPUT_NORMAL;
| 701| 701| 					return true;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 697| 697| 					placementSupport.Reset();
| 698| 698| 					updateBuildingPlacementPreview();
| 699| 699| 
| 700|    |-					inputState = INPUT_NORMAL;
|    | 700|+				inputState = INPUT_NORMAL;
| 701| 701| 					return true;
| 702| 702| 				}
| 703| 703| 				break;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 698| 698| 					updateBuildingPlacementPreview();
| 699| 699| 
| 700| 700| 					inputState = INPUT_NORMAL;
| 701|    |-					return true;
|    | 701|+				return true;
| 702| 702| 				}
| 703| 703| 				break;
| 704| 704| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 699| 699| 
| 700| 700| 					inputState = INPUT_NORMAL;
| 701| 701| 					return true;
| 702|    |-				}
|    | 702|+			}
| 703| 703| 				break;
| 704| 704| 		}
| 705| 705| 		break;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 700| 700| 					inputState = INPUT_NORMAL;
| 701| 701| 					return true;
| 702| 702| 				}
| 703|    |-				break;
|    | 703|+			break;
| 704| 704| 		}
| 705| 705| 		break;
| 706| 706| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 710| 710| 		case "mousemotion":
| 711| 711| 			let maxDragDelta = 16;
| 712| 712| 			if (g_DragStart.distanceTo(ev) >= maxDragDelta)
| 713|    |-			{
|    | 713|+			
| 714| 714| 				// Rotate in the direction of the mouse
| 715| 715| 				placementSupport.angle = placementSupport.position.horizAngleTo(Engine.GetTerrainAtScreenPoint(ev.x, ev.y));
| 716|    |-			}
|    | 716|+			
| 717| 717| 			else
| 718| 718| 			{
| 719| 719| 				// If the mouse is near the center, snap back to the default orientation
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 715| 715| 				placementSupport.angle = placementSupport.position.horizAngleTo(Engine.GetTerrainAtScreenPoint(ev.x, ev.y));
| 716| 716| 			}
| 717| 717| 			else
| 718|    |-			{
|    | 718|+			
| 719| 719| 				// If the mouse is near the center, snap back to the default orientation
| 720| 720| 				placementSupport.SetDefaultAngle();
| 721|    |-			}
|    | 721|+			
| 722| 722| 
| 723| 723| 			var snapData = Engine.GuiInterfaceCall("GetFoundationSnapData", {
| 724| 724| 				"template": placementSupport.template,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 741| 741| 				// If shift is down, let the player continue placing another of the same building
| 742| 742| 				var queued = Engine.HotkeyIsPressed("session.queue");
| 743| 743| 				if (tryPlaceBuilding(queued))
| 744|    |-				{
|    | 744|+				
| 745| 745| 					if (queued)
| 746| 746| 						inputState = INPUT_BUILDING_PLACEMENT;
| 747| 747| 					else
| 748| 748| 						inputState = INPUT_NORMAL;
| 749|    |-				}
|    | 749|+				
| 750| 750| 				else
| 751| 751| 				{
| 752| 752| 					inputState = INPUT_BUILDING_PLACEMENT;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 748| 748| 						inputState = INPUT_NORMAL;
| 749| 749| 				}
| 750| 750| 				else
| 751|    |-				{
|    | 751|+				
| 752| 752| 					inputState = INPUT_BUILDING_PLACEMENT;
| 753|    |-				}
|    | 753|+				
| 754| 754| 				return true;
| 755| 755| 			}
| 756| 756| 			break;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 793| 793| 
| 794| 794| 	// Handle the time-warp testing features, restricted to single-player
| 795| 795| 	if (!g_IsNetworked && Engine.GetGUIObjectByName("devTimeWarp").checked)
| 796|    |-	{
|    | 796|+	
| 797| 797| 		if (ev.type == "hotkeydown" && ev.hotkey == "session.timewarp.fastforward")
| 798| 798| 			Engine.SetSimRate(20.0);
| 799| 799| 		else if (ev.type == "hotkeyup" && ev.hotkey == "session.timewarp.fastforward")
| 800| 800| 			Engine.SetSimRate(1.0);
| 801| 801| 		else if (ev.type == "hotkeyup" && ev.hotkey == "session.timewarp.rewind")
| 802| 802| 			Engine.RewindTimeWarp();
| 803|    |-	}
|    | 803|+	
| 804| 804| 
| 805| 805| 	if (ev.hotkey == "session.highlightguarding")
| 806| 806| 	{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 852| 852| 			break;
| 853| 853| 
| 854| 854| 		case "hotkeydown":
| 855|    |-				if (ev.hotkey.indexOf("selection.group.") == 0)
|    | 855|+			if (ev.hotkey.indexOf("selection.group.") == 0)
| 856| 856| 				{
| 857| 857| 					let now = Date.now();
| 858| 858| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 853| 853| 
| 854| 854| 		case "hotkeydown":
| 855| 855| 				if (ev.hotkey.indexOf("selection.group.") == 0)
| 856|    |-				{
|    | 856|+			{
| 857| 857| 					let now = Date.now();
| 858| 858| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 859| 859| 					{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 854| 854| 		case "hotkeydown":
| 855| 855| 				if (ev.hotkey.indexOf("selection.group.") == 0)
| 856| 856| 				{
| 857|    |-					let now = Date.now();
|    | 857|+				let now = Date.now();
| 858| 858| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 859| 859| 					{
| 860| 860| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 855| 855| 				if (ev.hotkey.indexOf("selection.group.") == 0)
| 856| 856| 				{
| 857| 857| 					let now = Date.now();
| 858|    |-					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
|    | 858|+				if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 859| 859| 					{
| 860| 860| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 861| 861| 						{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 856| 856| 				{
| 857| 857| 					let now = Date.now();
| 858| 858| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 859|    |-					{
|    | 859|+				{
| 860| 860| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 861| 861| 						{
| 862| 862| 							var sptr = ev.hotkey.split(".");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 857| 857| 					let now = Date.now();
| 858| 858| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 859| 859| 					{
| 860|    |-						if (ev.hotkey.indexOf("selection.group.select.") == 0)
|    | 860|+					if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 861| 861| 						{
| 862| 862| 							var sptr = ev.hotkey.split(".");
| 863| 863| 							performGroup("snap", sptr[3]);
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 858| 858| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 859| 859| 					{
| 860| 860| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 861|    |-						{
|    | 861|+					{
| 862| 862| 							var sptr = ev.hotkey.split(".");
| 863| 863| 							performGroup("snap", sptr[3]);
| 864| 864| 						}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 859| 859| 					{
| 860| 860| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 861| 861| 						{
| 862|    |-							var sptr = ev.hotkey.split(".");
|    | 862|+						var sptr = ev.hotkey.split(".");
| 863| 863| 							performGroup("snap", sptr[3]);
| 864| 864| 						}
| 865| 865| 					}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 860| 860| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 861| 861| 						{
| 862| 862| 							var sptr = ev.hotkey.split(".");
| 863|    |-							performGroup("snap", sptr[3]);
|    | 863|+						performGroup("snap", sptr[3]);
| 864| 864| 						}
| 865| 865| 					}
| 866| 866| 					else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 861| 861| 						{
| 862| 862| 							var sptr = ev.hotkey.split(".");
| 863| 863| 							performGroup("snap", sptr[3]);
| 864|    |-						}
|    | 864|+					}
| 865| 865| 					}
| 866| 866| 					else
| 867| 867| 					{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 862| 862| 							var sptr = ev.hotkey.split(".");
| 863| 863| 							performGroup("snap", sptr[3]);
| 864| 864| 						}
| 865|    |-					}
|    | 865|+				}
| 866| 866| 					else
| 867| 867| 					{
| 868| 868| 						var sptr = ev.hotkey.split(".");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 863| 863| 							performGroup("snap", sptr[3]);
| 864| 864| 						}
| 865| 865| 					}
| 866|    |-					else
|    | 866|+				else
| 867| 867| 					{
| 868| 868| 						var sptr = ev.hotkey.split(".");
| 869| 869| 						performGroup(sptr[2], sptr[3]);
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 864| 864| 						}
| 865| 865| 					}
| 866| 866| 					else
| 867|    |-					{
|    | 867|+				{
| 868| 868| 						var sptr = ev.hotkey.split(".");
| 869| 869| 						performGroup(sptr[2], sptr[3]);
| 870| 870| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 865| 865| 					}
| 866| 866| 					else
| 867| 867| 					{
| 868|    |-						var sptr = ev.hotkey.split(".");
|    | 868|+					var sptr = ev.hotkey.split(".");
| 869| 869| 						performGroup(sptr[2], sptr[3]);
| 870| 870| 
| 871| 871| 						doublePressTimer = now;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 866| 866| 					else
| 867| 867| 					{
| 868| 868| 						var sptr = ev.hotkey.split(".");
| 869|    |-						performGroup(sptr[2], sptr[3]);
|    | 869|+					performGroup(sptr[2], sptr[3]);
| 870| 870| 
| 871| 871| 						doublePressTimer = now;
| 872| 872| 						prevHotkey = ev.hotkey;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 868| 868| 						var sptr = ev.hotkey.split(".");
| 869| 869| 						performGroup(sptr[2], sptr[3]);
| 870| 870| 
| 871|    |-						doublePressTimer = now;
|    | 871|+					doublePressTimer = now;
| 872| 872| 						prevHotkey = ev.hotkey;
| 873| 873| 					}
| 874| 874| 				}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 869| 869| 						performGroup(sptr[2], sptr[3]);
| 870| 870| 
| 871| 871| 						doublePressTimer = now;
| 872|    |-						prevHotkey = ev.hotkey;
|    | 872|+					prevHotkey = ev.hotkey;
| 873| 873| 					}
| 874| 874| 				}
| 875| 875| 				break;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 870| 870| 
| 871| 871| 						doublePressTimer = now;
| 872| 872| 						prevHotkey = ev.hotkey;
| 873|    |-					}
|    | 873|+				}
| 874| 874| 				}
| 875| 875| 				break;
| 876| 876| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 871| 871| 						doublePressTimer = now;
| 872| 872| 						prevHotkey = ev.hotkey;
| 873| 873| 					}
| 874|    |-				}
|    | 874|+			}
| 875| 875| 				break;
| 876| 876| 		}
| 877| 877| 		break;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 872| 872| 						prevHotkey = ev.hotkey;
| 873| 873| 					}
| 874| 874| 				}
| 875|    |-				break;
|    | 875|+			break;
| 876| 876| 		}
| 877| 877| 		break;
| 878| 878| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|1040|1040| 			placementSupport.position = Engine.GetTerrainAtScreenPoint(ev.x, ev.y);
|1041|1041| 
|1042|1042| 			if (placementSupport.mode === "wall")
|1043|    |-			{
|    |1043|+			
|1044|1044| 				// Including only the on-screen towers in the next snap candidate list is sufficient here, since the user is
|1045|1045| 				// still selecting a starting point (which must necessarily be on-screen). (The update of the snap entities
|1046|1046| 				// itself happens in the call to updateBuildingPlacementPreview below).
|1047|1047| 				placementSupport.wallSnapEntitiesIncludeOffscreen = false;
|1048|    |-			}
|    |1048|+			
|1049|1049| 			else
|1050|1050| 			{
|1051|1051| 				// cancel if not enough resources
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|1312|1312| 	if (templateData.attack &&
|1313|1313| 		templateData.attack.Ranged &&
|1314|1314| 		templateData.attack.Ranged.maxRange)
|1315|    |-	{
|    |1315|+	
|1316|1316| 		// add attack information to display a good tooltip
|1317|1317| 		placementSupport.attack = templateData.attack;
|1318|    |-	}
|    |1318|+	
|1319|1319| }
|1320|1320| 
|1321|1321| // Batch training:
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|1396|1396| 	if (Engine.HotkeyIsPressed("session.batchtrain") && (canBeAddedCount == undefined || canBeAddedCount > 1))
|1397|1397| 	{
|1398|1398| 		if (inputState == INPUT_BATCHTRAINING)
|1399|    |-		{
|    |1399|+		
|1400|1400| 			// Check if we are training in the same building(s) as the last batch
|1401|1401| 			// NOTE: We just check if the arrays are the same and if the order is the same
|1402|1402| 			// If the order changed, we have a new selection and we should create a new batch.
|1429|1429| 			else if (!decrement)
|1430|1430| 				flushTrainingBatch();
|1431|1431| 				// fall through to create the new batch
|1432|    |-		}
|    |1432|+		
|1433|1433| 
|1434|1434| 		// Don't start a new batch if decrementing or unable to afford it.
|1435|1435| 		if (decrement || Engine.GuiInterfaceCall("GetNeededResources", { "cost":
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|1428|1428| 			// Otherwise start a new one
|1429|1429| 			else if (!decrement)
|1430|1430| 				flushTrainingBatch();
|1431|    |-				// fall through to create the new batch
|    |1431|+			// fall through to create the new batch
|1432|1432| 		}
|1433|1433| 
|1434|1434| 		// Don't start a new batch if decrementing or unable to afford it.
|    | [NORMAL] ESLintBear (space-in-parens):
|    | There should be no spaces inside this paren.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|1506|1506| 		g_BatchTrainingEntityAllowedCount < batchedSize * appropriateBuildings.length)
|1507|1507| 	{
|1508|1508| 		// Train as many full batches as we can
|1509|    |-		let buildingsCountToTrainFullBatch = Math.floor( g_BatchTrainingEntityAllowedCount / batchedSize);
|    |1509|+		let buildingsCountToTrainFullBatch = Math.floor(g_BatchTrainingEntityAllowedCount / batchedSize);
|1510|1510| 		Engine.PostNetworkCommand({
|1511|1511| 			"type": "train",
|1512|1512| 			"entities": appropriateBuildings.slice(0, buildingsCountToTrainFullBatch),
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|1585|1585| 	var selectall = Engine.HotkeyIsPressed("selection.offscreen");
|1586|1586| 
|1587|1587| 	// Reset the last idle unit, etc., if the selection type has changed.
|1588|    |-	if (selectall || classes.length != lastIdleClasses.length || !classes.every((v,i) => v === lastIdleClasses[i]))
|    |1588|+	if (selectall || classes.length != lastIdleClasses.length || !classes.every((v, i) => v === lastIdleClasses[i]))
|1589|1589| 		resetIdleUnit();
|1590|1590| 	lastIdleClasses = classes;
|1591|1591| 

binaries/data/mods/public/gui/session/input.js
| 228| »   »   var·entState·=·GetEntityState(ent);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'entState' is already declared in the upper scope.

binaries/data/mods/public/gui/session/input.js
| 235| »   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
| 249| »   var·actionInfo·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'actionInfo' to undefined.

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/gui/session/input.js
|1027| »   »   »   »   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
|1036| »   »   switch·(ev.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

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

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

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

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

binaries/data/mods/public/gui/session/input.js
| 263| »   for·(var·action·of·actions)
|    | [NORMAL] JSHintBear:
|    | 'action' is already defined.

binaries/data/mods/public/gui/session/input.js
| 266| »   »   »   var·r·=·g_UnitActions[action].hotkeyActionCheck(target,·selection);
|    | [NORMAL] JSHintBear:
|    | 'r' is already defined.

binaries/data/mods/public/gui/session/input.js
| 271| »   for·(var·action·of·actions)
|    | [NORMAL] JSHintBear:
|    | 'action' is already defined.

binaries/data/mods/public/gui/session/input.js
| 274| »   »   »   var·r·=·g_UnitActions[action].actionCheck(target,·selection);
|    | [NORMAL] JSHintBear:
|    | 'r' is already defined.

binaries/data/mods/public/gui/session/input.js
| 481| »   »   &&·(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
| 511| »   »   »   »   var·rect·=·updateBandbox(bandbox,·ev,·true);
|    | [NORMAL] JSHintBear:
|    | 'rect' is already defined.

binaries/data/mods/public/gui/session/input.js
| 514| »   »   »   »   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
| 671| »   »   »   »   »   var·queued·=·Engine.HotkeyIsPressed("session.queue");
|    | [NORMAL] JSHintBear:
|    | 'queued' is already defined.

binaries/data/mods/public/gui/session/input.js
| 711| »   »   »   let·maxDragDelta·=·16;
|    | [MAJOR] JSHintBear:
|    | 'maxDragDelta' has already been declared.

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

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

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

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

binaries/data/mods/public/gui/session/input.js
| 934| »   »   »   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/differential/1241/display/redirect

Stan added a subscriber: Stan.Apr 20 2019, 5:32 PM
Stan added inline comments.
binaries/data/mods/public/gui/session/inputs/tributing.js
10

Missing semicolon;

12

Missing semicolon;

18

Missing semicolon;

24

Missing semicolon;

28

Missing semicolon;

64

Missing semicolon;

89

Missing semicolon;

94

Missing semicolon;

wraitii updated this revision to Diff 7790.Apr 21 2019, 11:05 AM

More complete example of what I'm envisioning. We'd have possibly multiple "Input State" components that listen to events and possibly 'kill' themselves - so no transition from an input state to another input state except "no input".

In this example I'm creating two such input states: TributingMenu, which uses it to change the tooltip (honestly that could be removed but I wanted to showcase that, and TributingAction.

I believe it could be better to split this in InputStates and "interface handlers subscribed to input" or something, but the behaviour would mostly be the same. Then we could keep a list of such handlers instead of manual handling stuff. Then we could even go full-react and create these handlers automatically when loading windows...

wraitii added inline comments.Apr 21 2019, 11:07 AM
binaries/data/mods/public/gui/session/inputs/tributing.js
52

Notice how this gets called every frame (could be avoided but doesn't have to) but only updates if necessary, in a reactive fashion

57

Likewise we update the tooltip only when necessary. We could split the tooltip update in a separate function too, as this re-renders everything.

binaries/data/mods/public/gui/session/menu.js
390

Should actually call _leave here but I forgot in this diff.

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/input_state.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/input_state.js
|  11|  11| 	g_InputStates.splice(g_InputStates.indexOf(this), 1);
|  12|  12| };
|  13|  13| 
|  14|    |-InputState.prototype.handleInputBeforeGui = function(ev) {}
|    |  14|+InputState.prototype.handleInputBeforeGui = function(ev) {};
|  15|  15| 
|  16|  16| InputState.prototype.handleInputAfterGui = function(ev) {}
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/input_state.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/input_state.js
|  13|  13| 
|  14|  14| InputState.prototype.handleInputBeforeGui = function(ev) {}
|  15|  15| 
|  16|    |-InputState.prototype.handleInputAfterGui = function(ev) {}
|    |  16|+InputState.prototype.handleInputAfterGui = function(ev) {};

binaries/data/mods/public/gui/session/inputs/input_state.js
|  14| InputState.prototype.handleInputBeforeGui·=·function(ev)·{}
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/session/inputs/input_state.js
|  16| InputState.prototype.handleInputAfterGui·=·function(ev)·{}
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|  50|  50| 			return;
|  51|  51| 		this.hidden[player] = hidden;
|  52|  52| 		this.renderPlayer(player);
|  53|    |-	}
|    |  53|+	};
|  54|  54| 
|  55|  55| 	ret.handleInputBeforeGui = function(ev) {
|  56|  56| 		if ((ev.type == "hotkeydown" || ev.type == "hotkeyup") && ev.hotkey == "session.masstribute")
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|  89|  89| 			tributeString += sprintf(translate("Shift-click to tribute %(amount)s."), {
|  90|  90| 				"amount": this.amountLarge
|  91|  91| 			});
|  92|    |-		return tributeString
|    |  92|+		return tributeString;
|  93|  93| 	}
|  94|  94| 
|  95|  95| 	ret.getTributeAmount = function(large) {
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|  90|  90| 				"amount": this.amountLarge
|  91|  91| 			});
|  92|  92| 		return tributeString
|  93|    |-	}
|    |  93|+	};
|  94|  94| 
|  95|  95| 	ret.getTributeAmount = function(large) {
|  96|  96| 		return large ? 500 : 100;
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
| 118| 118| 			button.tooltip = this.formatTributeTooltip(i, resCode);
| 119| 119| 			button.onPress = ((i, resCode) => () => this.tributeButtonClicked(i, resCode))(i, resCode);
| 120| 120| 		}
| 121|    |-	}
|    | 121|+	};
| 122| 122| 
| 123| 123| 	ret.render = function() {
| 124| 124| 		for (let i = 1; i < g_Players.length; ++i)
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
| 123| 123| 	ret.render = function() {
| 124| 124| 		for (let i = 1; i < g_Players.length; ++i)
| 125| 125| 			this.renderPlayer(i);
| 126|    |-	}
|    | 126|+	};
| 127| 127| 
| 128| 128| 	return ret;
| 129| 129| }
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/inputs/tributing.js
| 126| 126| 	}
| 127| 127| 
| 128| 128| 	return ret;
| 129|    |-}
|    | 129|+};
| 130| 130| 
| 131| 131| var g_TributingMenu;

binaries/data/mods/public/gui/session/inputs/tributing.js
| 119| »   »   »   button.onPress·=·((i,·resCode)·=>·()·=>·this.tributeButtonClicked(i,·resCode))(i,·resCode);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/inputs/tributing.js
| 119| »   »   »   button.onPress·=·((i,·resCode)·=>·()·=>·this.tributeButtonClicked(i,·resCode))(i,·resCode);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'resCode' is already declared in the upper scope.

binaries/data/mods/public/gui/session/inputs/tributing.js
|  53| »   }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/session/inputs/tributing.js
|  92| »   »   return·tributeString
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/session/inputs/tributing.js
|  93| »   }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/session/inputs/tributing.js
| 121| »   }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/session/inputs/tributing.js
| 126| »   }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/session/inputs/tributing.js
| 129| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/menu.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/menu.js
| 817| 817| 	Engine.GetGUIObjectByName("barterHelp").hidden = !canBarter;
| 818| 818| 
| 819| 819| 	if (canBarter)
| 820|    |-		g_ResourceData.GetCodes().forEach((resCode, i) => { barterUpdateCommon(resCode, i, "barter", g_ViewedPlayer) });
|    | 820|+		g_ResourceData.GetCodes().forEach((resCode, i) => { barterUpdateCommon(resCode, i, "barter", g_ViewedPlayer); });
| 821| 821| }
| 822| 822| 
| 823| 823| function getIdleLandTradersText(traderNumber)

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

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

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

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

binaries/data/mods/public/gui/session/menu.js
| 820| »   »   g_ResourceData.GetCodes().forEach((resCode,·i)·=>·{·barterUpdateCommon(resCode,·i,·"barter",·g_ViewedPlayer)·});
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 186| 186| 		}
| 187| 187| 	}
| 188| 188| 	else if (placementSupport.mode === "wall")
| 189|    |-	{
|    | 189|+	
| 190| 190| 		if (placementSupport.wallSet && placementSupport.position)
| 191| 191| 		{
| 192| 192| 			// Fetch an updated list of snapping candidate entities
| 204| 204| 				"snapEntities": placementSupport.wallSnapEntities,	// snapping entities (towers) for starting a wall segment
| 205| 205| 			});
| 206| 206| 		}
| 207|    |-	}
|    | 207|+	
| 208| 208| 
| 209| 209| 	return false;
| 210| 210| }
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 293| 293| 	}
| 294| 294| 
| 295| 295| 	if (!updateBuildingPlacementPreview())
| 296|    |-	{
|    | 296|+	
| 297| 297| 		// invalid location - don't build it
| 298| 298| 		// TODO: play a sound?
| 299| 299| 		return false;
| 300|    |-	}
|    | 300|+	
| 301| 301| 
| 302| 302| 	var selection = g_Selection.toList();
| 303| 303| 
|    | [NORMAL] ESLintBear (space-unary-ops):
|    | Unary word operator 'typeof' must be followed by whitespace.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 332| 332| 	}
| 333| 333| 
| 334| 334| 	var wallPlacementInfo = updateBuildingPlacementPreview(); // entities making up the wall (wall segments, towers, ...)
| 335|    |-	if (!(wallPlacementInfo === false || typeof(wallPlacementInfo) === "object"))
|    | 335|+	if (!(wallPlacementInfo === false || typeof (wallPlacementInfo) === "object"))
| 336| 336| 	{
| 337| 337| 		error("Invalid updateBuildingPlacementPreview return value: " + uneval(wallPlacementInfo));
| 338| 338| 		return false;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 359| 359| 	// (this is somewhat non-ideal and hardcode-ish)
| 360| 360| 	var hasWallSegment = false;
| 361| 361| 	for (let piece of cmd.pieces)
| 362|    |-	{
|    | 362|+	
| 363| 363| 		if (piece.template != cmd.wallSet.templates.tower) // TODO: hardcode-ish :(
| 364| 364| 		{
| 365| 365| 			hasWallSegment = true;
| 366| 366| 			break;
| 367| 367| 		}
| 368|    |-	}
|    | 368|+	
| 369| 369| 
| 370| 370| 	if (hasWallSegment)
| 371| 371| 	{
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 482| 482| 	mouseIsOverObject = (hoveredObject != null);
| 483| 483| 
| 484| 484| 	// Close the menu when interacting with the game world
| 485|    |-	if (!mouseIsOverObject && (ev.type =="mousebuttonup" || ev.type == "mousebuttondown")
| 486|    |-		&& (ev.button == SDL_BUTTON_LEFT || ev.button == SDL_BUTTON_RIGHT))
|    | 485|+	if (!mouseIsOverObject && (ev.type =="mousebuttonup" || ev.type == "mousebuttondown") &&
|    | 486|+		(ev.button == SDL_BUTTON_LEFT || ev.button == SDL_BUTTON_RIGHT))
| 487| 487| 		closeMenu();
| 488| 488| 
| 489| 489| 	if (g_InputStates.some(e => e.handleInputBeforeGui(ev)))
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 525| 525| 
| 526| 526| 				// Update the list of selected units
| 527| 527| 				if (Engine.HotkeyIsPressed("selection.add"))
| 528|    |-				{
|    | 528|+				
| 529| 529| 					g_Selection.addList(ents);
| 530|    |-				}
|    | 530|+				
| 531| 531| 				else if (Engine.HotkeyIsPressed("selection.remove"))
| 532| 532| 				{
| 533| 533| 					g_Selection.removeList(ents);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 529| 529| 					g_Selection.addList(ents);
| 530| 530| 				}
| 531| 531| 				else if (Engine.HotkeyIsPressed("selection.remove"))
| 532|    |-				{
|    | 532|+				
| 533| 533| 					g_Selection.removeList(ents);
| 534|    |-				}
|    | 534|+				
| 535| 535| 				else
| 536| 536| 				{
| 537| 537| 					g_Selection.reset();
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 585| 585| 				// If shift is down, let the player continue placing another of the same building
| 586| 586| 				var queued = Engine.HotkeyIsPressed("session.queue");
| 587| 587| 				if (tryPlaceBuilding(queued))
| 588|    |-				{
|    | 588|+				
| 589| 589| 					if (queued)
| 590| 590| 						inputState = INPUT_BUILDING_PLACEMENT;
| 591| 591| 					else
| 592| 592| 						inputState = INPUT_NORMAL;
| 593|    |-				}
|    | 593|+				
| 594| 594| 				else
| 595| 595| 				{
| 596| 596| 					inputState = INPUT_BUILDING_PLACEMENT;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 592| 592| 						inputState = INPUT_NORMAL;
| 593| 593| 				}
| 594| 594| 				else
| 595|    |-				{
|    | 595|+				
| 596| 596| 					inputState = INPUT_BUILDING_PLACEMENT;
| 597|    |-				}
|    | 597|+				
| 598| 598| 				return true;
| 599| 599| 			}
| 600| 600| 			break;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 645| 645| 		// user to continue building walls.
| 646| 646| 		switch (ev.type)
| 647| 647| 		{
| 648|    |-			case "mousemotion":
|    | 648|+		case "mousemotion":
| 649| 649| 				placementSupport.wallEndPosition = Engine.GetTerrainAtScreenPoint(ev.x, ev.y);
| 650| 650| 
| 651| 651| 				// 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.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 646| 646| 		switch (ev.type)
| 647| 647| 		{
| 648| 648| 			case "mousemotion":
| 649|    |-				placementSupport.wallEndPosition = Engine.GetTerrainAtScreenPoint(ev.x, ev.y);
|    | 649|+			placementSupport.wallEndPosition = Engine.GetTerrainAtScreenPoint(ev.x, ev.y);
| 650| 650| 
| 651| 651| 				// Update the building placement preview, and by extension, the list of snapping candidate entities for both (!)
| 652| 652| 				// the ending point and the starting point to snap to.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 648| 648| 			case "mousemotion":
| 649| 649| 				placementSupport.wallEndPosition = Engine.GetTerrainAtScreenPoint(ev.x, ev.y);
| 650| 650| 
| 651|    |-				// Update the building placement preview, and by extension, the list of snapping candidate entities for both (!)
|    | 651|+			// Update the building placement preview, and by extension, the list of snapping candidate entities for both (!)
| 652| 652| 				// the ending point and the starting point to snap to.
| 653| 653| 				//
| 654| 654| 				// 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.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 649| 649| 				placementSupport.wallEndPosition = Engine.GetTerrainAtScreenPoint(ev.x, ev.y);
| 650| 650| 
| 651| 651| 				// Update the building placement preview, and by extension, the list of snapping candidate entities for both (!)
| 652|    |-				// the ending point and the starting point to snap to.
|    | 652|+			// the ending point and the starting point to snap to.
| 653| 653| 				//
| 654| 654| 				// TODO: Note that here, we need to fetch all similar entities, including any offscreen ones, to support the case
| 655| 655| 				// 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.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 650| 650| 
| 651| 651| 				// Update the building placement preview, and by extension, the list of snapping candidate entities for both (!)
| 652| 652| 				// the ending point and the starting point to snap to.
| 653|    |-				//
|    | 653|+			//
| 654| 654| 				// TODO: Note that here, we need to fetch all similar entities, including any offscreen ones, to support the case
| 655| 655| 				// where the snap entity for the starting point has moved offscreen, or has been deleted/destroyed, or was a
| 656| 656| 				// 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.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 651| 651| 				// Update the building placement preview, and by extension, the list of snapping candidate entities for both (!)
| 652| 652| 				// the ending point and the starting point to snap to.
| 653| 653| 				//
| 654|    |-				// TODO: Note that here, we need to fetch all similar entities, including any offscreen ones, to support the case
|    | 654|+			// TODO: Note that here, we need to fetch all similar entities, including any offscreen ones, to support the case
| 655| 655| 				// where the snap entity for the starting point has moved offscreen, or has been deleted/destroyed, or was a
| 656| 656| 				// foundation and has been replaced with a completed entity since the user first chose it. Fetching all towers on
| 657| 657| 				// 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.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 652| 652| 				// the ending point and the starting point to snap to.
| 653| 653| 				//
| 654| 654| 				// TODO: Note that here, we need to fetch all similar entities, including any offscreen ones, to support the case
| 655|    |-				// where the snap entity for the starting point has moved offscreen, or has been deleted/destroyed, or was a
|    | 655|+			// where the snap entity for the starting point has moved offscreen, or has been deleted/destroyed, or was a
| 656| 656| 				// foundation and has been replaced with a completed entity since the user first chose it. Fetching all towers on
| 657| 657| 				// the entire map instead of only the current screen might get expensive fast since walls all have a ton of towers
| 658| 658| 				// 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.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 653| 653| 				//
| 654| 654| 				// TODO: Note that here, we need to fetch all similar entities, including any offscreen ones, to support the case
| 655| 655| 				// where the snap entity for the starting point has moved offscreen, or has been deleted/destroyed, or was a
| 656|    |-				// foundation and has been replaced with a completed entity since the user first chose it. Fetching all towers on
|    | 656|+			// foundation and has been replaced with a completed entity since the user first chose it. Fetching all towers on
| 657| 657| 				// the entire map instead of only the current screen might get expensive fast since walls all have a ton of towers
| 658| 658| 				// in them. Might be useful to query only for entities within a certain range around the starting point and ending
| 659| 659| 				// points.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 654| 654| 				// TODO: Note that here, we need to fetch all similar entities, including any offscreen ones, to support the case
| 655| 655| 				// where the snap entity for the starting point has moved offscreen, or has been deleted/destroyed, or was a
| 656| 656| 				// foundation and has been replaced with a completed entity since the user first chose it. Fetching all towers on
| 657|    |-				// the entire map instead of only the current screen might get expensive fast since walls all have a ton of towers
|    | 657|+			// the entire map instead of only the current screen might get expensive fast since walls all have a ton of towers
| 658| 658| 				// in them. Might be useful to query only for entities within a certain range around the starting point and ending
| 659| 659| 				// points.
| 660| 660| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 655| 655| 				// where the snap entity for the starting point has moved offscreen, or has been deleted/destroyed, or was a
| 656| 656| 				// foundation and has been replaced with a completed entity since the user first chose it. Fetching all towers on
| 657| 657| 				// the entire map instead of only the current screen might get expensive fast since walls all have a ton of towers
| 658|    |-				// in them. Might be useful to query only for entities within a certain range around the starting point and ending
|    | 658|+			// in them. Might be useful to query only for entities within a certain range around the starting point and ending
| 659| 659| 				// points.
| 660| 660| 
| 661| 661| 				placementSupport.wallSnapEntitiesIncludeOffscreen = true;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 656| 656| 				// foundation and has been replaced with a completed entity since the user first chose it. Fetching all towers on
| 657| 657| 				// the entire map instead of only the current screen might get expensive fast since walls all have a ton of towers
| 658| 658| 				// in them. Might be useful to query only for entities within a certain range around the starting point and ending
| 659|    |-				// points.
|    | 659|+			// points.
| 660| 660| 
| 661| 661| 				placementSupport.wallSnapEntitiesIncludeOffscreen = true;
| 662| 662| 				var result = updateBuildingPlacementPreview(); // includes an update of the snap entity candidates
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 658| 658| 				// in them. Might be useful to query only for entities within a certain range around the starting point and ending
| 659| 659| 				// points.
| 660| 660| 
| 661|    |-				placementSupport.wallSnapEntitiesIncludeOffscreen = true;
|    | 661|+			placementSupport.wallSnapEntitiesIncludeOffscreen = true;
| 662| 662| 				var result = updateBuildingPlacementPreview(); // includes an update of the snap entity candidates
| 663| 663| 
| 664| 664| 				if (result && result.cost)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 659| 659| 				// points.
| 660| 660| 
| 661| 661| 				placementSupport.wallSnapEntitiesIncludeOffscreen = true;
| 662|    |-				var result = updateBuildingPlacementPreview(); // includes an update of the snap entity candidates
|    | 662|+			var result = updateBuildingPlacementPreview(); // includes an update of the snap entity candidates
| 663| 663| 
| 664| 664| 				if (result && result.cost)
| 665| 665| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 661| 661| 				placementSupport.wallSnapEntitiesIncludeOffscreen = true;
| 662| 662| 				var result = updateBuildingPlacementPreview(); // includes an update of the snap entity candidates
| 663| 663| 
| 664|    |-				if (result && result.cost)
|    | 664|+			if (result && result.cost)
| 665| 665| 				{
| 666| 666| 					var neededResources = Engine.GuiInterfaceCall("GetNeededResources", { "cost": result.cost });
| 667| 667| 					placementSupport.tooltipMessage = [
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 662| 662| 				var result = updateBuildingPlacementPreview(); // includes an update of the snap entity candidates
| 663| 663| 
| 664| 664| 				if (result && result.cost)
| 665|    |-				{
|    | 665|+			{
| 666| 666| 					var neededResources = Engine.GuiInterfaceCall("GetNeededResources", { "cost": result.cost });
| 667| 667| 					placementSupport.tooltipMessage = [
| 668| 668| 						getEntityCostTooltip(result),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 663| 663| 
| 664| 664| 				if (result && result.cost)
| 665| 665| 				{
| 666|    |-					var neededResources = Engine.GuiInterfaceCall("GetNeededResources", { "cost": result.cost });
|    | 666|+				var neededResources = Engine.GuiInterfaceCall("GetNeededResources", { "cost": result.cost });
| 667| 667| 					placementSupport.tooltipMessage = [
| 668| 668| 						getEntityCostTooltip(result),
| 669| 669| 						getNeededResourcesTooltip(neededResources)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 664| 664| 				if (result && result.cost)
| 665| 665| 				{
| 666| 666| 					var neededResources = Engine.GuiInterfaceCall("GetNeededResources", { "cost": result.cost });
| 667|    |-					placementSupport.tooltipMessage = [
|    | 667|+				placementSupport.tooltipMessage = [
| 668| 668| 						getEntityCostTooltip(result),
| 669| 669| 						getNeededResourcesTooltip(neededResources)
| 670| 670| 					].filter(tip => tip).join("\n");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 665| 665| 				{
| 666| 666| 					var neededResources = Engine.GuiInterfaceCall("GetNeededResources", { "cost": result.cost });
| 667| 667| 					placementSupport.tooltipMessage = [
| 668|    |-						getEntityCostTooltip(result),
|    | 668|+					getEntityCostTooltip(result),
| 669| 669| 						getNeededResourcesTooltip(neededResources)
| 670| 670| 					].filter(tip => tip).join("\n");
| 671| 671| 				}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 666| 666| 					var neededResources = Engine.GuiInterfaceCall("GetNeededResources", { "cost": result.cost });
| 667| 667| 					placementSupport.tooltipMessage = [
| 668| 668| 						getEntityCostTooltip(result),
| 669|    |-						getNeededResourcesTooltip(neededResources)
|    | 669|+					getNeededResourcesTooltip(neededResources)
| 670| 670| 					].filter(tip => tip).join("\n");
| 671| 671| 				}
| 672| 672| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 667| 667| 					placementSupport.tooltipMessage = [
| 668| 668| 						getEntityCostTooltip(result),
| 669| 669| 						getNeededResourcesTooltip(neededResources)
| 670|    |-					].filter(tip => tip).join("\n");
|    | 670|+				].filter(tip => tip).join("\n");
| 671| 671| 				}
| 672| 672| 
| 673| 673| 				break;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 668| 668| 						getEntityCostTooltip(result),
| 669| 669| 						getNeededResourcesTooltip(neededResources)
| 670| 670| 					].filter(tip => tip).join("\n");
| 671|    |-				}
|    | 671|+			}
| 672| 672| 
| 673| 673| 				break;
| 674| 674| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 670| 670| 					].filter(tip => tip).join("\n");
| 671| 671| 				}
| 672| 672| 
| 673|    |-				break;
|    | 673|+			break;
| 674| 674| 
| 675| 675| 			case "mousebuttondown":
| 676| 676| 				if (ev.button == SDL_BUTTON_LEFT)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 672| 672| 
| 673| 673| 				break;
| 674| 674| 
| 675|    |-			case "mousebuttondown":
|    | 675|+		case "mousebuttondown":
| 676| 676| 				if (ev.button == SDL_BUTTON_LEFT)
| 677| 677| 				{
| 678| 678| 					var queued = Engine.HotkeyIsPressed("session.queue");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 673| 673| 				break;
| 674| 674| 
| 675| 675| 			case "mousebuttondown":
| 676|    |-				if (ev.button == SDL_BUTTON_LEFT)
|    | 676|+			if (ev.button == SDL_BUTTON_LEFT)
| 677| 677| 				{
| 678| 678| 					var queued = Engine.HotkeyIsPressed("session.queue");
| 679| 679| 					if (tryPlaceWall(queued))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 674| 674| 
| 675| 675| 			case "mousebuttondown":
| 676| 676| 				if (ev.button == SDL_BUTTON_LEFT)
| 677|    |-				{
|    | 677|+			{
| 678| 678| 					var queued = Engine.HotkeyIsPressed("session.queue");
| 679| 679| 					if (tryPlaceWall(queued))
| 680| 680| 					{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 675| 675| 			case "mousebuttondown":
| 676| 676| 				if (ev.button == SDL_BUTTON_LEFT)
| 677| 677| 				{
| 678|    |-					var queued = Engine.HotkeyIsPressed("session.queue");
|    | 678|+				var queued = Engine.HotkeyIsPressed("session.queue");
| 679| 679| 					if (tryPlaceWall(queued))
| 680| 680| 					{
| 681| 681| 						if (queued)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 676| 676| 				if (ev.button == SDL_BUTTON_LEFT)
| 677| 677| 				{
| 678| 678| 					var queued = Engine.HotkeyIsPressed("session.queue");
| 679|    |-					if (tryPlaceWall(queued))
|    | 679|+				if (tryPlaceWall(queued))
| 680| 680| 					{
| 681| 681| 						if (queued)
| 682| 682| 						{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 677| 677| 				{
| 678| 678| 					var queued = Engine.HotkeyIsPressed("session.queue");
| 679| 679| 					if (tryPlaceWall(queued))
| 680|    |-					{
|    | 680|+					
| 681| 681| 						if (queued)
| 682| 682| 						{
| 683| 683| 							// continue building, just set a new starting position where we left off
| 691| 691| 							placementSupport.Reset();
| 692| 692| 							inputState = INPUT_NORMAL;
| 693| 693| 						}
| 694|    |-					}
|    | 694|+					
| 695| 695| 					else
| 696| 696| 						placementSupport.tooltipMessage = translate("Cannot build wall here!");
| 697| 697| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 677| 677| 				{
| 678| 678| 					var queued = Engine.HotkeyIsPressed("session.queue");
| 679| 679| 					if (tryPlaceWall(queued))
| 680|    |-					{
|    | 680|+				{
| 681| 681| 						if (queued)
| 682| 682| 						{
| 683| 683| 							// continue building, just set a new starting position where we left off
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 678| 678| 					var queued = Engine.HotkeyIsPressed("session.queue");
| 679| 679| 					if (tryPlaceWall(queued))
| 680| 680| 					{
| 681|    |-						if (queued)
|    | 681|+					if (queued)
| 682| 682| 						{
| 683| 683| 							// continue building, just set a new starting position where we left off
| 684| 684| 							placementSupport.position = placementSupport.wallEndPosition;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 679| 679| 					if (tryPlaceWall(queued))
| 680| 680| 					{
| 681| 681| 						if (queued)
| 682|    |-						{
|    | 682|+					{
| 683| 683| 							// continue building, just set a new starting position where we left off
| 684| 684| 							placementSupport.position = placementSupport.wallEndPosition;
| 685| 685| 							placementSupport.wallEndPosition = undefined;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 680| 680| 					{
| 681| 681| 						if (queued)
| 682| 682| 						{
| 683|    |-							// continue building, just set a new starting position where we left off
|    | 683|+						// continue building, just set a new starting position where we left off
| 684| 684| 							placementSupport.position = placementSupport.wallEndPosition;
| 685| 685| 							placementSupport.wallEndPosition = undefined;
| 686| 686| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 681| 681| 						if (queued)
| 682| 682| 						{
| 683| 683| 							// continue building, just set a new starting position where we left off
| 684|    |-							placementSupport.position = placementSupport.wallEndPosition;
|    | 684|+						placementSupport.position = placementSupport.wallEndPosition;
| 685| 685| 							placementSupport.wallEndPosition = undefined;
| 686| 686| 
| 687| 687| 							inputState = INPUT_BUILDING_WALL_CLICK;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 682| 682| 						{
| 683| 683| 							// continue building, just set a new starting position where we left off
| 684| 684| 							placementSupport.position = placementSupport.wallEndPosition;
| 685|    |-							placementSupport.wallEndPosition = undefined;
|    | 685|+						placementSupport.wallEndPosition = undefined;
| 686| 686| 
| 687| 687| 							inputState = INPUT_BUILDING_WALL_CLICK;
| 688| 688| 						}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 684| 684| 							placementSupport.position = placementSupport.wallEndPosition;
| 685| 685| 							placementSupport.wallEndPosition = undefined;
| 686| 686| 
| 687|    |-							inputState = INPUT_BUILDING_WALL_CLICK;
|    | 687|+						inputState = INPUT_BUILDING_WALL_CLICK;
| 688| 688| 						}
| 689| 689| 						else
| 690| 690| 						{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 685| 685| 							placementSupport.wallEndPosition = undefined;
| 686| 686| 
| 687| 687| 							inputState = INPUT_BUILDING_WALL_CLICK;
| 688|    |-						}
|    | 688|+					}
| 689| 689| 						else
| 690| 690| 						{
| 691| 691| 							placementSupport.Reset();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 686| 686| 
| 687| 687| 							inputState = INPUT_BUILDING_WALL_CLICK;
| 688| 688| 						}
| 689|    |-						else
|    | 689|+					else
| 690| 690| 						{
| 691| 691| 							placementSupport.Reset();
| 692| 692| 							inputState = INPUT_NORMAL;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 687| 687| 							inputState = INPUT_BUILDING_WALL_CLICK;
| 688| 688| 						}
| 689| 689| 						else
| 690|    |-						{
|    | 690|+					{
| 691| 691| 							placementSupport.Reset();
| 692| 692| 							inputState = INPUT_NORMAL;
| 693| 693| 						}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 688| 688| 						}
| 689| 689| 						else
| 690| 690| 						{
| 691|    |-							placementSupport.Reset();
|    | 691|+						placementSupport.Reset();
| 692| 692| 							inputState = INPUT_NORMAL;
| 693| 693| 						}
| 694| 694| 					}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 689| 689| 						else
| 690| 690| 						{
| 691| 691| 							placementSupport.Reset();
| 692|    |-							inputState = INPUT_NORMAL;
|    | 692|+						inputState = INPUT_NORMAL;
| 693| 693| 						}
| 694| 694| 					}
| 695| 695| 					else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 690| 690| 						{
| 691| 691| 							placementSupport.Reset();
| 692| 692| 							inputState = INPUT_NORMAL;
| 693|    |-						}
|    | 693|+					}
| 694| 694| 					}
| 695| 695| 					else
| 696| 696| 						placementSupport.tooltipMessage = translate("Cannot build wall here!");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 691| 691| 							placementSupport.Reset();
| 692| 692| 							inputState = INPUT_NORMAL;
| 693| 693| 						}
| 694|    |-					}
|    | 694|+				}
| 695| 695| 					else
| 696| 696| 						placementSupport.tooltipMessage = translate("Cannot build wall here!");
| 697| 697| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 692| 692| 							inputState = INPUT_NORMAL;
| 693| 693| 						}
| 694| 694| 					}
| 695|    |-					else
|    | 695|+				else
| 696| 696| 						placementSupport.tooltipMessage = translate("Cannot build wall here!");
| 697| 697| 
| 698| 698| 					updateBuildingPlacementPreview();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 693| 693| 						}
| 694| 694| 					}
| 695| 695| 					else
| 696|    |-						placementSupport.tooltipMessage = translate("Cannot build wall here!");
|    | 696|+					placementSupport.tooltipMessage = translate("Cannot build wall here!");
| 697| 697| 
| 698| 698| 					updateBuildingPlacementPreview();
| 699| 699| 					return true;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 695| 695| 					else
| 696| 696| 						placementSupport.tooltipMessage = translate("Cannot build wall here!");
| 697| 697| 
| 698|    |-					updateBuildingPlacementPreview();
|    | 698|+				updateBuildingPlacementPreview();
| 699| 699| 					return true;
| 700| 700| 				}
| 701| 701| 				else if (ev.button == SDL_BUTTON_RIGHT)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 696| 696| 						placementSupport.tooltipMessage = translate("Cannot build wall here!");
| 697| 697| 
| 698| 698| 					updateBuildingPlacementPreview();
| 699|    |-					return true;
|    | 699|+				return true;
| 700| 700| 				}
| 701| 701| 				else if (ev.button == SDL_BUTTON_RIGHT)
| 702| 702| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 697| 697| 
| 698| 698| 					updateBuildingPlacementPreview();
| 699| 699| 					return true;
| 700|    |-				}
|    | 700|+			}
| 701| 701| 				else if (ev.button == SDL_BUTTON_RIGHT)
| 702| 702| 				{
| 703| 703| 					// reset to normal input mode
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 698| 698| 					updateBuildingPlacementPreview();
| 699| 699| 					return true;
| 700| 700| 				}
| 701|    |-				else if (ev.button == SDL_BUTTON_RIGHT)
|    | 701|+			else if (ev.button == SDL_BUTTON_RIGHT)
| 702| 702| 				{
| 703| 703| 					// reset to normal input mode
| 704| 704| 					placementSupport.Reset();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 699| 699| 					return true;
| 700| 700| 				}
| 701| 701| 				else if (ev.button == SDL_BUTTON_RIGHT)
| 702|    |-				{
|    | 702|+			{
| 703| 703| 					// reset to normal input mode
| 704| 704| 					placementSupport.Reset();
| 705| 705| 					updateBuildingPlacementPreview();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 700| 700| 				}
| 701| 701| 				else if (ev.button == SDL_BUTTON_RIGHT)
| 702| 702| 				{
| 703|    |-					// reset to normal input mode
|    | 703|+				// reset to normal input mode
| 704| 704| 					placementSupport.Reset();
| 705| 705| 					updateBuildingPlacementPreview();
| 706| 706| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 701| 701| 				else if (ev.button == SDL_BUTTON_RIGHT)
| 702| 702| 				{
| 703| 703| 					// reset to normal input mode
| 704|    |-					placementSupport.Reset();
|    | 704|+				placementSupport.Reset();
| 705| 705| 					updateBuildingPlacementPreview();
| 706| 706| 
| 707| 707| 					inputState = INPUT_NORMAL;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 702| 702| 				{
| 703| 703| 					// reset to normal input mode
| 704| 704| 					placementSupport.Reset();
| 705|    |-					updateBuildingPlacementPreview();
|    | 705|+				updateBuildingPlacementPreview();
| 706| 706| 
| 707| 707| 					inputState = INPUT_NORMAL;
| 708| 708| 					return true;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 704| 704| 					placementSupport.Reset();
| 705| 705| 					updateBuildingPlacementPreview();
| 706| 706| 
| 707|    |-					inputState = INPUT_NORMAL;
|    | 707|+				inputState = INPUT_NORMAL;
| 708| 708| 					return true;
| 709| 709| 				}
| 710| 710| 				break;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 705| 705| 					updateBuildingPlacementPreview();
| 706| 706| 
| 707| 707| 					inputState = INPUT_NORMAL;
| 708|    |-					return true;
|    | 708|+				return true;
| 709| 709| 				}
| 710| 710| 				break;
| 711| 711| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 706| 706| 
| 707| 707| 					inputState = INPUT_NORMAL;
| 708| 708| 					return true;
| 709|    |-				}
|    | 709|+			}
| 710| 710| 				break;
| 711| 711| 		}
| 712| 712| 		break;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 707| 707| 					inputState = INPUT_NORMAL;
| 708| 708| 					return true;
| 709| 709| 				}
| 710|    |-				break;
|    | 710|+			break;
| 711| 711| 		}
| 712| 712| 		break;
| 713| 713| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 717| 717| 		case "mousemotion":
| 718| 718| 			let maxDragDelta = 16;
| 719| 719| 			if (g_DragStart.distanceTo(ev) >= maxDragDelta)
| 720|    |-			{
|    | 720|+			
| 721| 721| 				// Rotate in the direction of the mouse
| 722| 722| 				placementSupport.angle = placementSupport.position.horizAngleTo(Engine.GetTerrainAtScreenPoint(ev.x, ev.y));
| 723|    |-			}
|    | 723|+			
| 724| 724| 			else
| 725| 725| 			{
| 726| 726| 				// If the mouse is near the center, snap back to the default orientation
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 722| 722| 				placementSupport.angle = placementSupport.position.horizAngleTo(Engine.GetTerrainAtScreenPoint(ev.x, ev.y));
| 723| 723| 			}
| 724| 724| 			else
| 725|    |-			{
|    | 725|+			
| 726| 726| 				// If the mouse is near the center, snap back to the default orientation
| 727| 727| 				placementSupport.SetDefaultAngle();
| 728|    |-			}
|    | 728|+			
| 729| 729| 
| 730| 730| 			var snapData = Engine.GuiInterfaceCall("GetFoundationSnapData", {
| 731| 731| 				"template": placementSupport.template,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 748| 748| 				// If shift is down, let the player continue placing another of the same building
| 749| 749| 				var queued = Engine.HotkeyIsPressed("session.queue");
| 750| 750| 				if (tryPlaceBuilding(queued))
| 751|    |-				{
|    | 751|+				
| 752| 752| 					if (queued)
| 753| 753| 						inputState = INPUT_BUILDING_PLACEMENT;
| 754| 754| 					else
| 755| 755| 						inputState = INPUT_NORMAL;
| 756|    |-				}
|    | 756|+				
| 757| 757| 				else
| 758| 758| 				{
| 759| 759| 					inputState = INPUT_BUILDING_PLACEMENT;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 755| 755| 						inputState = INPUT_NORMAL;
| 756| 756| 				}
| 757| 757| 				else
| 758|    |-				{
|    | 758|+				
| 759| 759| 					inputState = INPUT_BUILDING_PLACEMENT;
| 760|    |-				}
|    | 760|+				
| 761| 761| 				return true;
| 762| 762| 			}
| 763| 763| 			break;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 796| 796| 
| 797| 797| 	// Handle the time-warp testing features, restricted to single-player
| 798| 798| 	if (!g_IsNetworked && Engine.GetGUIObjectByName("devTimeWarp").checked)
| 799|    |-	{
|    | 799|+	
| 800| 800| 		if (ev.type == "hotkeydown" && ev.hotkey == "session.timewarp.fastforward")
| 801| 801| 			Engine.SetSimRate(20.0);
| 802| 802| 		else if (ev.type == "hotkeyup" && ev.hotkey == "session.timewarp.fastforward")
| 803| 803| 			Engine.SetSimRate(1.0);
| 804| 804| 		else if (ev.type == "hotkeyup" && ev.hotkey == "session.timewarp.rewind")
| 805| 805| 			Engine.RewindTimeWarp();
| 806|    |-	}
|    | 806|+	
| 807| 807| 
| 808| 808| 	if (ev.hotkey == "session.highlightguarding")
| 809| 809| 	{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 855| 855| 			break;
| 856| 856| 
| 857| 857| 		case "hotkeydown":
| 858|    |-				if (ev.hotkey.indexOf("selection.group.") == 0)
|    | 858|+			if (ev.hotkey.indexOf("selection.group.") == 0)
| 859| 859| 				{
| 860| 860| 					let now = Date.now();
| 861| 861| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 856| 856| 
| 857| 857| 		case "hotkeydown":
| 858| 858| 				if (ev.hotkey.indexOf("selection.group.") == 0)
| 859|    |-				{
|    | 859|+			{
| 860| 860| 					let now = Date.now();
| 861| 861| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 862| 862| 					{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 857| 857| 		case "hotkeydown":
| 858| 858| 				if (ev.hotkey.indexOf("selection.group.") == 0)
| 859| 859| 				{
| 860|    |-					let now = Date.now();
|    | 860|+				let now = Date.now();
| 861| 861| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 862| 862| 					{
| 863| 863| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 858| 858| 				if (ev.hotkey.indexOf("selection.group.") == 0)
| 859| 859| 				{
| 860| 860| 					let now = Date.now();
| 861|    |-					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
|    | 861|+				if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 862| 862| 					{
| 863| 863| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 864| 864| 						{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 859| 859| 				{
| 860| 860| 					let now = Date.now();
| 861| 861| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 862|    |-					{
|    | 862|+				{
| 863| 863| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 864| 864| 						{
| 865| 865| 							var sptr = ev.hotkey.split(".");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 860| 860| 					let now = Date.now();
| 861| 861| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 862| 862| 					{
| 863|    |-						if (ev.hotkey.indexOf("selection.group.select.") == 0)
|    | 863|+					if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 864| 864| 						{
| 865| 865| 							var sptr = ev.hotkey.split(".");
| 866| 866| 							performGroup("snap", sptr[3]);
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 861| 861| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 862| 862| 					{
| 863| 863| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 864|    |-						{
|    | 864|+					{
| 865| 865| 							var sptr = ev.hotkey.split(".");
| 866| 866| 							performGroup("snap", sptr[3]);
| 867| 867| 						}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 862| 862| 					{
| 863| 863| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 864| 864| 						{
| 865|    |-							var sptr = ev.hotkey.split(".");
|    | 865|+						var sptr = ev.hotkey.split(".");
| 866| 866| 							performGroup("snap", sptr[3]);
| 867| 867| 						}
| 868| 868| 					}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 863| 863| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 864| 864| 						{
| 865| 865| 							var sptr = ev.hotkey.split(".");
| 866|    |-							performGroup("snap", sptr[3]);
|    | 866|+						performGroup("snap", sptr[3]);
| 867| 867| 						}
| 868| 868| 					}
| 869| 869| 					else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 864| 864| 						{
| 865| 865| 							var sptr = ev.hotkey.split(".");
| 866| 866| 							performGroup("snap", sptr[3]);
| 867|    |-						}
|    | 867|+					}
| 868| 868| 					}
| 869| 869| 					else
| 870| 870| 					{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 865| 865| 							var sptr = ev.hotkey.split(".");
| 866| 866| 							performGroup("snap", sptr[3]);
| 867| 867| 						}
| 868|    |-					}
|    | 868|+				}
| 869| 869| 					else
| 870| 870| 					{
| 871| 871| 						var sptr = ev.hotkey.split(".");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 866| 866| 							performGroup("snap", sptr[3]);
| 867| 867| 						}
| 868| 868| 					}
| 869|    |-					else
|    | 869|+				else
| 870| 870| 					{
| 871| 871| 						var sptr = ev.hotkey.split(".");
| 872| 872| 						performGroup(sptr[2], sptr[3]);
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 867| 867| 						}
| 868| 868| 					}
| 869| 869| 					else
| 870|    |-					{
|    | 870|+				{
| 871| 871| 						var sptr = ev.hotkey.split(".");
| 872| 872| 						performGroup(sptr[2], sptr[3]);
| 873| 873| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 868| 868| 					}
| 869| 869| 					else
| 870| 870| 					{
| 871|    |-						var sptr = ev.hotkey.split(".");
|    | 871|+					var sptr = ev.hotkey.split(".");
| 872| 872| 						performGroup(sptr[2], sptr[3]);
| 873| 873| 
| 874| 874| 						doublePressTimer = now;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 869| 869| 					else
| 870| 870| 					{
| 871| 871| 						var sptr = ev.hotkey.split(".");
| 872|    |-						performGroup(sptr[2], sptr[3]);
|    | 872|+					performGroup(sptr[2], sptr[3]);
| 873| 873| 
| 874| 874| 						doublePressTimer = now;
| 875| 875| 						prevHotkey = ev.hotkey;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 871| 871| 						var sptr = ev.hotkey.split(".");
| 872| 872| 						performGroup(sptr[2], sptr[3]);
| 873| 873| 
| 874|    |-						doublePressTimer = now;
|    | 874|+					doublePressTimer = now;
| 875| 875| 						prevHotkey = ev.hotkey;
| 876| 876| 					}
| 877| 877| 				}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 872| 872| 						performGroup(sptr[2], sptr[3]);
| 873| 873| 
| 874| 874| 						doublePressTimer = now;
| 875|    |-						prevHotkey = ev.hotkey;
|    | 875|+					prevHotkey = ev.hotkey;
| 876| 876| 					}
| 877| 877| 				}
| 878| 878| 				break;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 873| 873| 
| 874| 874| 						doublePressTimer = now;
| 875| 875| 						prevHotkey = ev.hotkey;
| 876|    |-					}
|    | 876|+				}
| 877| 877| 				}
| 878| 878| 				break;
| 879| 879| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 874| 874| 						doublePressTimer = now;
| 875| 875| 						prevHotkey = ev.hotkey;
| 876| 876| 					}
| 877|    |-				}
|    | 877|+			}
| 878| 878| 				break;
| 879| 879| 		}
| 880| 880| 		break;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
| 875| 875| 						prevHotkey = ev.hotkey;
| 876| 876| 					}
| 877| 877| 				}
| 878|    |-				break;
|    | 878|+			break;
| 879| 879| 		}
| 880| 880| 		break;
| 881| 881| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|1043|1043| 			placementSupport.position = Engine.GetTerrainAtScreenPoint(ev.x, ev.y);
|1044|1044| 
|1045|1045| 			if (placementSupport.mode === "wall")
|1046|    |-			{
|    |1046|+			
|1047|1047| 				// Including only the on-screen towers in the next snap candidate list is sufficient here, since the user is
|1048|1048| 				// still selecting a starting point (which must necessarily be on-screen). (The update of the snap entities
|1049|1049| 				// itself happens in the call to updateBuildingPlacementPreview below).
|1050|1050| 				placementSupport.wallSnapEntitiesIncludeOffscreen = false;
|1051|    |-			}
|    |1051|+			
|1052|1052| 			else
|1053|1053| 			{
|1054|1054| 				// cancel if not enough resources
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|1315|1315| 	if (templateData.attack &&
|1316|1316| 		templateData.attack.Ranged &&
|1317|1317| 		templateData.attack.Ranged.maxRange)
|1318|    |-	{
|    |1318|+	
|1319|1319| 		// add attack information to display a good tooltip
|1320|1320| 		placementSupport.attack = templateData.attack;
|1321|    |-	}
|    |1321|+	
|1322|1322| }
|1323|1323| 
|1324|1324| // Batch training:
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|1399|1399| 	if (Engine.HotkeyIsPressed("session.batchtrain") && (canBeAddedCount == undefined || canBeAddedCount > 1))
|1400|1400| 	{
|1401|1401| 		if (inputState == INPUT_BATCHTRAINING)
|1402|    |-		{
|    |1402|+		
|1403|1403| 			// Check if we are training in the same building(s) as the last batch
|1404|1404| 			// NOTE: We just check if the arrays are the same and if the order is the same
|1405|1405| 			// If the order changed, we have a new selection and we should create a new batch.
|1432|1432| 			else if (!decrement)
|1433|1433| 				flushTrainingBatch();
|1434|1434| 				// fall through to create the new batch
|1435|    |-		}
|    |1435|+		
|1436|1436| 
|1437|1437| 		// Don't start a new batch if decrementing or unable to afford it.
|1438|1438| 		if (decrement || Engine.GuiInterfaceCall("GetNeededResources", { "cost":
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|1431|1431| 			// Otherwise start a new one
|1432|1432| 			else if (!decrement)
|1433|1433| 				flushTrainingBatch();
|1434|    |-				// fall through to create the new batch
|    |1434|+			// fall through to create the new batch
|1435|1435| 		}
|1436|1436| 
|1437|1437| 		// Don't start a new batch if decrementing or unable to afford it.
|    | [NORMAL] ESLintBear (space-in-parens):
|    | There should be no spaces inside this paren.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|1509|1509| 		g_BatchTrainingEntityAllowedCount < batchedSize * appropriateBuildings.length)
|1510|1510| 	{
|1511|1511| 		// Train as many full batches as we can
|1512|    |-		let buildingsCountToTrainFullBatch = Math.floor( g_BatchTrainingEntityAllowedCount / batchedSize);
|    |1512|+		let buildingsCountToTrainFullBatch = Math.floor(g_BatchTrainingEntityAllowedCount / batchedSize);
|1513|1513| 		Engine.PostNetworkCommand({
|1514|1514| 			"type": "train",
|1515|1515| 			"entities": appropriateBuildings.slice(0, buildingsCountToTrainFullBatch),
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/input.js
|1588|1588| 	var selectall = Engine.HotkeyIsPressed("selection.offscreen");
|1589|1589| 
|1590|1590| 	// Reset the last idle unit, etc., if the selection type has changed.
|1591|    |-	if (selectall || classes.length != lastIdleClasses.length || !classes.every((v,i) => v === lastIdleClasses[i]))
|    |1591|+	if (selectall || classes.length != lastIdleClasses.length || !classes.every((v, i) => v === lastIdleClasses[i]))
|1592|1592| 		resetIdleUnit();
|1593|1593| 	lastIdleClasses = classes;
|1594|1594| 

binaries/data/mods/public/gui/session/input.js
| 233| »   »   var·entState·=·GetEntityState(ent);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'entState' is already declared in the upper scope.

binaries/data/mods/public/gui/session/input.js
| 240| »   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
| 254| »   var·actionInfo·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'actionInfo' to undefined.

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/gui/session/input.js
|1030| »   »   »   »   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
|1039| »   »   switch·(ev.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

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

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

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

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

binaries/data/mods/public/gui/session/input.js
| 268| »   for·(var·action·of·actions)
|    | [NORMAL] JSHintBear:
|    | 'action' is already defined.

binaries/data/mods/public/gui/session/input.js
| 271| »   »   »   var·r·=·g_UnitActions[action].hotkeyActionCheck(target,·selection);
|    | [NORMAL] JSHintBear:
|    | 'r' is already defined.

binaries/data/mods/public/gui/session/input.js
| 276| »   for·(var·action·of·actions)
|    | [NORMAL] JSHintBear:
|    | 'action' is already defined.

binaries/data/mods/public/gui/session/input.js
| 279| »   »   »   var·r·=·g_UnitActions[action].actionCheck(target,·selection);
|    | [NORMAL] JSHintBear:
|    | 'r' is already defined.

binaries/data/mods/public/gui/session/input.js
| 486| »   »   &&·(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
| 518| »   »   »   »   var·rect·=·updateBandbox(bandbox,·ev,·true);
|    | [NORMAL] JSHintBear:
|    | 'rect' is already defined.

binaries/data/mods/public/gui/session/input.js
| 521| »   »   »   »   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
| 678| »   »   »   »   »   var·queued·=·Engine.HotkeyIsPressed("session.queue");
|    | [NORMAL] JSHintBear:
|    | 'queued' is already defined.

binaries/data/mods/public/gui/session/input.js
| 718| »   »   »   let·maxDragDelta·=·16;
|    | [MAJOR] JSHintBear:
|    | 'maxDragDelta' has already been declared.

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

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

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

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

binaries/data/mods/public/gui/session/input.js
| 937| »   »   »   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/differential/1244/display/redirect

@elexis I'm inviting you to look at this, from playing around with it it feels much nicer to me.

I'm switching from an FSM to a non-deterministic state machine so we could be in multiple states at once, but I doubt this is really a problem at the moment and I don't think we need a 'full' SM either. Regardless we could keep the input_state global variable and update that instead, it doesn't actually change much.

I'm switching from an FSM to a non-deterministic state machine so we could be in multiple states at once

Last time I checked, an automaton is always in exactly one state at a time, but a specific word that an NDA processes can result in one of multiple states, otherwise it would be a deterministic one.

Tributing bugfix here D1191
Someone else reworking input.js FSM here D1786
GUI object-orientation recommendation #5387

About creating new files, Im skeptical if they are 120 lines short, since the other files are couple of thousand lines long. But if it becomes homogeneous and grouped wisely maybe. (i.e. 70 files with 120 lines instead of one file with 120 lines and the others with 1000-5000 lines or whatever the numbers are)

binaries/data/mods/public/gui/session/inputs/tributing.js
49

this.hidden[player]

128

Prototype is less complex than a function that returns functions

131

dont hide it
and why define it in the file that never uses it rather than the only file with a reference to it

binaries/data/mods/public/gui/session/menu.js
390

undefined unless you need to distinguish null from undefined

wraitii marked 3 inline comments as not done.Apr 21 2019, 5:06 PM

About creating new files, Im skeptical if they are 120 lines short, since the other files are couple of thousand lines long

Well the idea is that one would move all input states to their own file, which might range 100-500 lines long each I guess.

Last time I checked, an automaton is always in exactly one state at a time, but a specific word that an NDA processes can result in one of multiple states, otherwise it would be a deterministic one.

It appears an NDA can result in multiple states - not an expert then again.

binaries/data/mods/public/gui/session/inputs/tributing.js
128

I wasn't sure how to extend a prototype easily.

It appears an NDA can result in multiple states

For the deterministic automaton there is at most one transition for the current character of the word that the automaton processes.
For the non-deterministic automaton, there are zero or more states that follow for a any given character.
But every transition transitions between two states of the automaton.

g_InputStates seems like the state of a deterministic automaton, because for every userinput, the next state is computed deterministically?

Imarok added a subscriber: Imarok.Apr 24 2019, 10:32 PM

not an expert then again.

That what elexis said is correct.
But let me add that you can convert any NDA in a deterministic automaton. So it is mostly a matter of how you define the state.
For input.js we should definitely aim for a strictly defined finite deterministic automaton (That's what we already have in place) with defined entry and leave functions (That's what we currently don't have → buugs).

Stan added inline comments.Apr 24 2019, 10:44 PM
binaries/data/mods/public/gui/session/menu.js
390

one could also use delete no ?