Page MenuHomeWildfire Games

Add an experience status bar
ClosedPublic

Authored by Imarok on Apr 20 2018, 4:36 PM.

Details

Summary

Adds a small experience status bar above the healthbar. Don't show the bar if the unit has no xp or can't have any.
Pictures:

Test Plan

Select a unit and kill some deer and watch how the bar grows. Also test a rank up.

Diff Detail

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

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
ffffffff added a comment.EditedApr 20 2018, 4:52 PM

tx

below health bar seems very fine

vladislavbelov added inline comments.
binaries/data/mods/public/simulation/components/StatusBars.js
29

Why not a full name? ExperienceBar, it's even shorter than ResourceSupplyBar and it saves the naming.

Imarok updated this revision to Diff 6440.Apr 20 2018, 9:49 PM

Experience bar now below all other bars. Xp →Experience

Imarok marked an inline comment as done.Apr 20 2018, 9:50 PM
Imarok updated this revision to Diff 6441.Apr 20 2018, 9:51 PM

Remove multispace

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

Linter detected issues:
Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/components/Promotion.js
| 155| »   »   while·(true)
|    | [NORMAL] ESLintBear (no-constant-condition):
|    | Unexpected constant condition.
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'cmpPromotion'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/StatusBars.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/StatusBars.js
| 173| 173| 	if (!cmpPromotion || !cmpPromotion.GetCurrentXp() || !cmpPromotion.GetRequiredXp())
| 174| 174| 		return 0;
| 175| 175| 
| 176|    |-	return this.AddBar(cmpOverlayRenderer, yoffset, "pack", cmpPromotion.GetCurrentXp() /  cmpPromotion.GetRequiredXp(), 2/3);
|    | 176|+	return this.AddBar(cmpOverlayRenderer, yoffset, "pack", cmpPromotion.GetCurrentXp() / cmpPromotion.GetRequiredXp(), 2/3);
| 177| 177| };
| 178| 178| 
| 179| 179| StatusBars.prototype.AddPackBar = function(cmpOverlayRenderer, yoffset)

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

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

Linter detected issues:
Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/components/Promotion.js
| 155| »   »   while·(true)
|    | [NORMAL] ESLintBear (no-constant-condition):
|    | Unexpected constant condition.

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

workx for me pretty noice

bb accepted this revision.Apr 21 2018, 10:57 PM
bb added a subscriber: bb.

One should consider crowdyness for these stuff, maybe at some point we need to push the bars in the option menu.

In D1460#59804, @Imarok wrote:

(I will copy the bar icons, so that one can change the look of the pack and the xp bar independently, as soon as this gets accepted)

Only the bg, as we already have a fg easter egg (there seems to be some color difference between the health bar in selectionpanels and statusbars, maybe nice to sync it, but out of scope)

binaries/data/mods/public/simulation/components/StatusBars.js
143

ack

binaries/data/mods/public/simulation/components/interfaces/Promotion.js
4

one could pass the amount it changed, but as it is unused now: don't add dead code

This revision is now accepted and ready to land.Apr 21 2018, 10:57 PM
elexis added a subscriber: elexis.Apr 21 2018, 11:14 PM

Looks like a valuable feature.
If it's getting crowded, this could be made optional.

Code that can be possibly performance heavy should be examined.
If there are 1000 units fighting, there will be thousands of messages sent in few turns.
But it seems irreducible and the subscribed component is only updated for selected units afaics.
HealthChanged also seems to occur more often than we would need to regenerate sprites.
Perhaps we should regenerate the sprites of an entity at most twice per second, even if it got hit in the head 5 times and changed experience points in the same turn.
(Only regenerating one of the sprites is also thinkable but not as important as capping the regenrate)
So it would be good to at least check once that we don't add a big performance regression unwittingly.
But since this only gathers X/Y positions and cmpOverlayRenderer doesn't do much either, I suspect this won't be a problem.

ffffffff added a comment.EditedApr 22 2018, 2:09 AM

it's already crowded imo. tab anyway.

maybe we should put rank and aura icons next to each other, as they are atm i guess above each other. maybe this helps

or we may make bars besides health bar smaller in thickness.

Imarok added a comment.Jan 3 2019, 1:39 AM
In D1460#59918, @elexis wrote:

So it would be good to at least check once that we don't add a big performance regression unwittingly.

Any idea on how to do that? I've never done such thing ;)

Since we want to measure the simulation impact of the new message, one can do so with a non-visual replay or a fixed seed game launched from commandline.
One can even use the profiler(s) I suppose.
(Otherwise if one wanted to measure GUI effects one can measure the microseconds with that JS function in JSInterface_Debug.cpp and select as many ents as possible.)

Also fgod contained this patch I think, so it should be well tested. (But that doesn't tell us the impact of the performance, only that it's not a gamebreaking one.)

Nescio added a subscriber: Nescio.Jan 3 2019, 11:33 AM

The idea is interesting, but I'm not sure if it's an improvement to display it by default; experience is not as important as health; perhaps it could be made an optional feature?

I think the simplest would be to measure the total runtime of a non-visual replay with and without the patch (for example using time on linux).
Note that this can also have a visual FPS impact, but that's harder to measure.

I feel a bit stupid.
That bar is displayed when you click on a unit? But currently, there is already such a bar at another place isn't it?
Or is it relevant only for group selection of units?

Silier added a subscriber: Silier.Jan 3 2019, 12:02 PM

I think there is side bar on the left on unit picture when selected and this one is above the head of unit.

lyv added a subscriber: lyv.Jan 3 2019, 12:03 PM

Yes there is. I assume this is coming from the same roots as the health or capture bar.

Imarok added a comment.Jan 8 2019, 8:27 PM

I think the simplest would be to measure the total runtime of a non-visual replay with and without the patch (for example using time on linux).

But doesn't that depend on my current CPU load?

Imarok added a comment.EditedJan 8 2019, 8:37 PM

I've run a replay of "Combat Demo(Huge)":

without the patch:
real 1m0.432s user 1m6.840s sys 0m0.268s
real 0m59.425s user 1m5.644s sys 0m0.216s
with the patch:
real 0m59.856s user 1m6.280s sys 0m0.228s
real 1m0.084s user 1m6.448s sys 0m0.216s

So there seems to be no apparent performance difference.

About the performance:
The profiler suggestion was useless I guess because only C++ events are measured. (But creating a profile.txt with a nonvisual replay and showing it in the webbrowser is something handy and easy for the relevant next sim patch. https://trac.wildfiregames.com/wiki/EngineProfiling#Simulationreplaymode example https://trac.wildfiregames.com/attachment/ticket/5099/graph.png)

Was that a visual or nonvisual replay?
Does PostMessage skip sending messages if there are no subscribers?
If so, the performance would correlate with the number of entities that have bars currently displayed (either selected units or all units if tab pressed), (and a test without visible bars would not measure the slowest part of the diff).

options.json:
As the experience information is a bit verbose, shouldn't there be an options.json entry (similar to the range overlays and extended tooltips)?

No other issue that comes to my mind (we had(have?) a status bar bug with miraged entities and in observermode, and a bug with incorrectly aligned status bar positions depending on which status bars were visible).

binaries/data/mods/public/simulation/components/StatusBars.js
139

About the default:
defaults are ok if they are the most straight forward option - in some cases defaults can more obfuscate than help, when each caller has a different number of arguments, or when defaults aren't the inherently expected value by the user reading the call, or when there are many default arguments (rmgen-common) and one always has to read 2 lines (caller and function header) to determine with which values the function is called (instead of only the caller line). So IMO default values are a bit of an anti-pattern. At last, I saw only 2 default arguments (didn't search precisely) in simulation/components/. There are only 3 calls to this function, so an easy move of the value to the caller.

About the semantics of the heightMultiplier argument:
it's a counterintuitive that the simulation would store how many pixels the GUI should use.
But that aspect relates to the entire component actually and it looks like a rabbithole one could spend some months with.)

I wonder if the not-only-simulation template shouldn't specify the size of the three bars, rather than hardcoding the 2/3*healthBarSize here for every unit while every unit can change the number of the health bar size individually? (Then again not convinced that templates should store data for the pyrogenesis GUI that a second GUI may want to do differently, meh)

Imarok added a comment.EditedJan 12 2019, 5:40 PM
In D1460#69897, @elexis wrote:

About the performance:
Was that a visual or nonvisual replay?

Just as you proposed. So nonvisual.

Does PostMessage skip sending messages if there are no subscribers?
If so, the performance would correlate with the number of entities that have bars currently displayed (either selected units or all units if tab pressed), (and a test without visible bars would not measure the slowest part of the diff).

Not sure how our simulation determines if there is a subscriber, but all StatusBars get initialized as soon as the entity of that unit is created.

options.json:
As the experience information is a bit verbose, shouldn't there be an options.json entry (similar to the range overlays and extended tooltips)?

Hmm, yeah could be needed. But on the other side we shouldn't create too much options ;)

Edit: Just investigated further: We definitely send the message. Even in non-visual mode.

Imarok marked an inline comment as done.Jan 12 2019, 5:42 PM
Imarok added inline comments.
binaries/data/mods/public/simulation/components/StatusBars.js
139

We have 4 function calls. 3 with the default argument, so I'd say the default is legit. But if you insist, I can change that...

Imarok updated this revision to Diff 7325.Jan 13 2019, 1:15 PM

early return

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [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
| 797| 797| 
| 798| 798| 	// Handle the time-warp testing features, restricted to single-player
| 799| 799| 	if (!g_IsNetworked && Engine.GetGUIObjectByName("devTimeWarp").checked)
| 800|    |-	{
|    | 800|+	
| 801| 801| 		if (ev.type == "hotkeydown" && ev.hotkey == "session.timewarp.fastforward")
| 802| 802| 			Engine.SetSimRate(20.0);
| 803| 803| 		else if (ev.type == "hotkeyup" && ev.hotkey == "session.timewarp.fastforward")
| 804| 804| 			Engine.SetSimRate(1.0);
| 805| 805| 		else if (ev.type == "hotkeyup" && ev.hotkey == "session.timewarp.rewind")
| 806| 806| 			Engine.RewindTimeWarp();
| 807|    |-	}
|    | 807|+	
| 808| 808| 
| 809| 809| 	if (ev.hotkey == "session.highlightguarding")
| 810| 810| 	{
|    | [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| 			break;
| 857| 857| 
| 858| 858| 		case "hotkeydown":
| 859|    |-				if (ev.hotkey.indexOf("selection.group.") == 0)
|    | 859|+			if (ev.hotkey.indexOf("selection.group.") == 0)
| 860| 860| 				{
| 861| 861| 					let now = Date.now();
| 862| 862| 					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
| 857| 857| 
| 858| 858| 		case "hotkeydown":
| 859| 859| 				if (ev.hotkey.indexOf("selection.group.") == 0)
| 860|    |-				{
|    | 860|+			{
| 861| 861| 					let now = Date.now();
| 862| 862| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 863| 863| 					{
|    | [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| 		case "hotkeydown":
| 859| 859| 				if (ev.hotkey.indexOf("selection.group.") == 0)
| 860| 860| 				{
| 861|    |-					let now = Date.now();
|    | 861|+				let now = Date.now();
| 862| 862| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 863| 863| 					{
| 864| 864| 						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
| 859| 859| 				if (ev.hotkey.indexOf("selection.group.") == 0)
| 860| 860| 				{
| 861| 861| 					let now = Date.now();
| 862|    |-					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
|    | 862|+				if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 863| 863| 					{
| 864| 864| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 865| 865| 						{
|    | [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
| 860| 860| 				{
| 861| 861| 					let now = Date.now();
| 862| 862| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 863|    |-					{
|    | 863|+				{
| 864| 864| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 865| 865| 						{
| 866| 866| 							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
| 861| 861| 					let now = Date.now();
| 862| 862| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 863| 863| 					{
| 864|    |-						if (ev.hotkey.indexOf("selection.group.select.") == 0)
|    | 864|+					if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 865| 865| 						{
| 866| 866| 							var sptr = ev.hotkey.split(".");
| 867| 867| 							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
| 862| 862| 					if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey)
| 863| 863| 					{
| 864| 864| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 865|    |-						{
|    | 865|+					{
| 866| 866| 							var sptr = ev.hotkey.split(".");
| 867| 867| 							performGroup("snap", sptr[3]);
| 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| 					{
| 864| 864| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 865| 865| 						{
| 866|    |-							var sptr = ev.hotkey.split(".");
|    | 866|+						var sptr = ev.hotkey.split(".");
| 867| 867| 							performGroup("snap", sptr[3]);
| 868| 868| 						}
| 869| 869| 					}
|    | [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
| 864| 864| 						if (ev.hotkey.indexOf("selection.group.select.") == 0)
| 865| 865| 						{
| 866| 866| 							var sptr = ev.hotkey.split(".");
| 867|    |-							performGroup("snap", sptr[3]);
|    | 867|+						performGroup("snap", sptr[3]);
| 868| 868| 						}
| 869| 869| 					}
| 870| 870| 					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
| 865| 865| 						{
| 866| 866| 							var sptr = ev.hotkey.split(".");
| 867| 867| 							performGroup("snap", sptr[3]);
| 868|    |-						}
|    | 868|+					}
| 869| 869| 					}
| 870| 870| 					else
| 871| 871| 					{
|    | [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| 							var sptr = ev.hotkey.split(".");
| 867| 867| 							performGroup("snap", sptr[3]);
| 868| 868| 						}
| 869|    |-					}
|    | 869|+				}
| 870| 870| 					else
| 871| 871| 					{
| 872| 872| 						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
| 867| 867| 							performGroup("snap", sptr[3]);
| 868| 868| 						}
| 869| 869| 					}
| 870|    |-					else
|    | 870|+				else
| 871| 871| 					{
| 872| 872| 						var sptr = ev.hotkey.split(".");
| 873| 873| 						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
| 868| 868| 						}
| 869| 869| 					}
| 870| 870| 					else
| 871|    |-					{
|    | 871|+				{
| 872| 872| 						var sptr = ev.hotkey.split(".");
| 873| 873| 						performGroup(sptr[2], sptr[3]);
| 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| 					}
| 870| 870| 					else
| 871| 871| 					{
| 872|    |-						var sptr = ev.hotkey.split(".");
|    | 872|+					var sptr = ev.hotkey.split(".");
| 873| 873| 						performGroup(sptr[2], sptr[3]);
| 874| 874| 
| 875| 875| 						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
| 870| 870| 					else
| 871| 871| 					{
| 872| 872| 						var sptr = ev.hotkey.split(".");
| 873|    |-						performGroup(sptr[2], sptr[3]);
|    | 873|+					performGroup(sptr[2], sptr[3]);
| 874| 874| 
| 875| 875| 						doublePressTimer = now;
| 876| 876| 						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
| 872| 872| 						var sptr = ev.hotkey.split(".");
| 873| 873| 						performGroup(sptr[2], sptr[3]);
| 874| 874| 
| 875|    |-						doublePressTimer = now;
|    | 875|+					doublePressTimer = now;
| 876| 876| 						prevHotkey = ev.hotkey;
| 877| 877| 					}
| 878| 878| 				}
|    | [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
| 873| 873| 						performGroup(sptr[2], sptr[3]);
| 874| 874| 
| 875| 875| 						doublePressTimer = now;
| 876|    |-						prevHotkey = ev.hotkey;
|    | 876|+					prevHotkey = ev.hotkey;
| 877| 877| 					}
| 878| 878| 				}
| 879| 879| 				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
| 874| 874| 
| 875| 875| 						doublePressTimer = now;
| 876| 876| 						prevHotkey = ev.hotkey;
| 877|    |-					}
|    | 877|+				}
| 878| 878| 				}
| 879| 879| 				break;
| 880| 880| 		}
|    | [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| 						doublePressTimer = now;
| 876| 876| 						prevHotkey = ev.hotkey;
| 877| 877| 					}
| 878|    |-				}
|    | 878|+			}
| 879| 879| 				break;
| 880| 880| 		}
| 881| 881| 		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
| 876| 876| 						prevHotkey = ev.hotkey;
| 877| 877| 					}
| 878| 878| 				}
| 879|    |-				break;
|    | 879|+			break;
| 880| 880| 		}
| 881| 881| 		break;
| 882| 882| 
|    | [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
|1044|1044| 			placementSupport.position = Engine.GetTerrainAtScreenPoint(ev.x, ev.y);
|1045|1045| 
|1046|1046| 			if (placementSupport.mode === "wall")
|1047|    |-			{
|    |1047|+			
|1048|1048| 				// Including only the on-screen towers in the next snap candidate list is sufficient here, since the user is
|1049|1049| 				// still selecting a starting point (which must necessarily be on-screen). (The update of the snap entities
|1050|1050| 				// itself happens in the call to updateBuildingPlacementPreview below).
|1051|1051| 				placementSupport.wallSnapEntitiesIncludeOffscreen = false;
|1052|    |-			}
|    |1052|+			
|1053|1053| 			else
|1054|1054| 			{
|1055|1055| 				// 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
|1320|1320| 	if (templateData.attack &&
|1321|1321| 		templateData.attack.Ranged &&
|1322|1322| 		templateData.attack.Ranged.maxRange)
|1323|    |-	{
|    |1323|+	
|1324|1324| 		// add attack information to display a good tooltip
|1325|1325| 		placementSupport.attack = templateData.attack;
|1326|    |-	}
|    |1326|+	
|1327|1327| }
|1328|1328| 
|1329|1329| // Batch training:
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /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
|1338|1338| function OnTrainMouseWheel(dir)
|1339|1339| {
|1340|1340| 	if (!Engine.HotkeyIsPressed("session.batchtrain"))
|1341|    |-	return;
|    |1341|+		return;
|1342|1342| 
|1343|1343| 	g_BatchSize += dir / Engine.ConfigDB_GetValue("user", "gui.session.scrollbatchratio");
|1344|1344| 	if (g_BatchSize < 1 || !Number.isFinite(g_BatchSize))
|    | [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
|1408|1408| 	if (Engine.HotkeyIsPressed("session.batchtrain") && (canBeAddedCount == undefined || canBeAddedCount > 1))
|1409|1409| 	{
|1410|1410| 		if (inputState == INPUT_BATCHTRAINING)
|1411|    |-		{
|    |1411|+		
|1412|1412| 			// Check if we are training in the same building(s) as the last batch
|1413|1413| 			// NOTE: We just check if the arrays are the same and if the order is the same
|1414|1414| 			// If the order changed, we have a new selection and we should create a new batch.
|1441|1441| 			else if (!decrement)
|1442|1442| 				flushTrainingBatch();
|1443|1443| 				// fall through to create the new batch
|1444|    |-		}
|    |1444|+		
|1445|1445| 
|1446|1446| 		// Don't start a new batch if decrementing or unable to afford it.
|1447|1447| 		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
|1440|1440| 			// Otherwise start a new one
|1441|1441| 			else if (!decrement)
|1442|1442| 				flushTrainingBatch();
|1443|    |-				// fall through to create the new batch
|    |1443|+			// fall through to create the new batch
|1444|1444| 		}
|1445|1445| 
|1446|1446| 		// 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
|1518|1518| 		g_BatchTrainingEntityAllowedCount < batchedSize * appropriateBuildings.length)
|1519|1519| 	{
|1520|1520| 		// Train as many full batches as we can
|1521|    |-		let buildingsCountToTrainFullBatch = Math.floor( g_BatchTrainingEntityAllowedCount / batchedSize);
|    |1521|+		let buildingsCountToTrainFullBatch = Math.floor(g_BatchTrainingEntityAllowedCount / batchedSize);
|1522|1522| 		Engine.PostNetworkCommand({
|1523|1523| 			"type": "train",
|1524|1524| 			"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
|1597|1597| 	var selectall = Engine.HotkeyIsPressed("selection.offscreen");
|1598|1598| 
|1599|1599| 	// Reset the last idle unit, etc., if the selection type has changed.
|1600|    |-	if (selectall || classes.length != lastIdleClasses.length || !classes.every((v,i) => v === lastIdleClasses[i]))
|    |1600|+	if (selectall || classes.length != lastIdleClasses.length || !classes.every((v, i) => v === lastIdleClasses[i]))
|1601|1601| 		resetIdleUnit();
|1602|1602| 	lastIdleClasses = classes;
|1603|1603| 

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
| 825| »   switch·(inputState)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

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

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

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

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

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

binaries/data/mods/public/gui/session/input.js
|1548| »   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
| 872| »   »   »   »   »   »   var·sptr·=·ev.hotkey.split(".");
|    | [NORMAL] JSHintBear:
|    | 'sptr' is already defined.

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

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

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

binaries/data/mods/public/gui/session/input.js
|1180| »   if·(!ev.button·==·SDL_BUTTON_RIGHT)
|    | [NORMAL] JSHintBear:
|    | Confusing use of '!'.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/953/

Imarok updated this revision to Diff 7331.Jan 13 2019, 6:01 PM

Revert the upload, was the wrong differential

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

Linter detected issues:
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/components/Promotion.js
| 155| »   »   while·(true)
|    | [NORMAL] ESLintBear (no-constant-condition):
|    | Unexpected constant condition.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/955/

I guess at most 400 units change experience simultaneously, unlikely all of them being selected simultaneously, which means it would be 400 non-global messages that in most cases would just hit the early return.
Perhaps it would be more efficient to just update the status bars once per GUI second rather than possibly multiple times per turn.
Perhaps it's not necessary, perhaps it is and we won't find out until years later when the feature is extended or is used in a new context.
I suppose the AI is not receiving this message because IIRC it only receives those that it explicitly copies.
Conclusively, I talk empty phrases, you decide.

binaries/data/mods/public/simulation/components/StatusBars.js
139

But if you insist, I can change that...

If I would insist I would have had clicked on requested changes.

I don't care about these 3 lines, but the recognition of the possible disadvantages of default arguments that do not occur before the pattern was already extensively used.

At least in rmgen there were a load of problems because defaults that are expected by the users were used, then it accumulated into an unreadable mess. These are only two cases #4989, rP21728, another one was the hardcoding of the tileclasses like clWood in the placement helper functions (which broke maps that wanted to not use the exact same variable names or didn't use some tileclasses).

Maybe there is a reason that there are almost no default argumens in the simulation, but maybe it's just coincidence...

Other than that there is still the point that if the template is supposed to determine the position and size of the health status bar, it seems contradictory that the simulation code and not the template would determine the position and size of the other status bar.

(I personally don't insist or really care about that either though)

lyv added a comment.Jan 20 2019, 5:02 PM

I suppose the AI is not receiving this message because IIRC it only receives those that it explicitly copies.

AIInterface.js listens to the events and pass them on.

Imarok planned changes to this revision.Jan 26 2019, 4:18 PM

Adding an option for this is a good idea.
Will do so as soon as i have time for it.

Imarok updated this revision to Diff 7448.Feb 4 2019, 8:58 PM

Add a option to disable the experience status bar

This revision is now accepted and ready to land.Feb 4 2019, 8:58 PM
Vulcan added a comment.Feb 4 2019, 9:01 PM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 397| 397| 				// Players see colors depending on diplomacy
| 398| 398| 				g_DisplayedPlayerColors[i] =
| 399| 399| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 400|    |-					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
|    | 400|+						g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 401| 401| 					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 402| 402| 					getDiplomacyColor("enemy");
| 403| 403| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 398| 398| 				g_DisplayedPlayerColors[i] =
| 399| 399| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 400| 400| 					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 401|    |-					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
|    | 401|+							g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 402| 402| 					getDiplomacyColor("enemy");
| 403| 403| 
| 404| 404| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 399| 399| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 400| 400| 					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 401| 401| 					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 402|    |-					getDiplomacyColor("enemy");
|    | 402|+								getDiplomacyColor("enemy");
| 403| 403| 
| 404| 404| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
| 405| 405| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 655| 655| 					"civ": setStringTags(g_CivData[g_Players[g_ViewedPlayer].civ].Name, { "font": "sans-bold-stroke-14" }),
| 656| 656| 					"hotkey_civinfo": colorizeHotkey("%(hotkey)s", "civinfo"),
| 657| 657| 					"hotkey_structree": colorizeHotkey("%(hotkey)s", "structree")
| 658|    |-			});
|    | 658|+				});
| 659| 659| 	}
| 660| 660| 
| 661| 661| 	// Following gaia can be interesting on scripted maps
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1239|1239| 
|1240|1240| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1241|1241| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1242|    |-		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|    |1242|+			"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1243|1243| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1244|1244| 	});
|1245|1245| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1240|1240| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1241|1241| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1242|1242| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1243|    |-		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|    |1243|+			"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1244|1244| 	});
|1245|1245| 
|1246|1246| 	let resCodes = g_ResourceData.GetCodes();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1241|1241| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1242|1242| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1243|1243| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1244|    |-	});
|    |1244|+		});
|1245|1245| 
|1246|1246| 	let resCodes = g_ResourceData.GetCodes();
|1247|1247| 	for (let r = 0; r < resCodes.length; ++r)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1733|1733| 	for (let rct of resourcesCounterTypes)
|1734|1734| 		for (let rt of resourcesTypes)
|1735|1735| 			reportObject[rt + rct.substr(9)] = playerStatistics[rct][rt];
|1736|    |-			// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|    |1736|+	// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|1737|1737| 
|1738|1738| 	reportObject.vegetarianFoodGathered = playerStatistics.resourcesGathered.vegetarianFood;
|1739|1739| 	for (let type of unitsClasses)

binaries/data/mods/public/gui/session/session.js
|1067| »   let·getPanelEntNameTooltip·=·panelEntState·=>·"[font=\"sans-bold-16\"]"·+·template.name.specific·+·"[/font]";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'panelEntState' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1142| »   »   button.onpress·=·(function(i)·{·return·function()·{·performGroup((Engine.HotkeyIsPressed("selection.add")·?·"add"·:·"select"),·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1143| »   »   button.ondoublepress·=·(function(i)·{·return·function()·{·performGroup("snap",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1144| »   »   button.onpressright·=·(function(i)·{·return·function()·{·performGroup("breakUp",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/Promotion.js
| 155| »   »   while·(true)
|    | [NORMAL] ESLintBear (no-constant-condition):
|    | Unexpected constant condition.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|  66|  66| 		let phase = "";
|  67|  67| 		let cmpTechnologyManager = QueryPlayerIDInterface(i, IID_TechnologyManager);
|  68|  68| 		if (cmpTechnologyManager)
|  69|    |-		{
|    |  69|+		
|  70|  70| 			if (cmpTechnologyManager.IsTechnologyResearched("phase_city"))
|  71|  71| 				phase = "city";
|  72|  72| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_town"))
|  73|  73| 				phase = "town";
|  74|  74| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_village"))
|  75|  75| 				phase = "village";
|  76|    |-		}
|    |  76|+		
|  77|  77| 
|  78|  78| 		// store player ally/neutral/enemy data as arrays
|  79|  79| 		let allies = [];
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 410| 410| 			ret.attack[type].elevationBonus = range.elevationBonus;
| 411| 411| 
| 412| 412| 			if (cmpUnitAI && cmpPosition && cmpPosition.IsInWorld())
| 413|    |-			{
|    | 413|+			
| 414| 414| 				// For units, take the range in front of it, no spread. So angle = 0
| 415| 415| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 416|    |-			}
|    | 416|+			
| 417| 417| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 418| 418| 			{
| 419| 419| 				// For buildings, take the average elevation around it. So angle = 2*pi
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 415| 415| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 416| 416| 			}
| 417| 417| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 418|    |-			{
|    | 418|+			
| 419| 419| 				// For buildings, take the average elevation around it. So angle = 2*pi
| 420| 420| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 421|    |-			}
|    | 421|+			
| 422| 422| 			else
| 423| 423| 			{
| 424| 424| 				// not in world, set a default?
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 420| 420| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 421| 421| 			}
| 422| 422| 			else
| 423|    |-			{
|    | 423|+			
| 424| 424| 				// not in world, set a default?
| 425| 425| 				ret.attack[type].elevationAdaptedRange = ret.attack.maxRange;
| 426|    |-			}
|    | 426|+			
| 427| 427| 		}
| 428| 428| 	}
| 429| 429| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 791| 791| 		updateEntityColor(data.showAllStatusBars && (i == player || player == -1) ?
| 792| 792| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer, IID_StatusBars] :
| 793| 793| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer],
| 794|    |-			cmpRangeManager.GetEntitiesByPlayer(i));
|    | 794|+		cmpRangeManager.GetEntitiesByPlayer(i));
| 795| 795| 	}
| 796| 796| 	updateEntityColor([IID_Selectable, IID_StatusBars], data.selected);
| 797| 797| 	Engine.QueryInterface(SYSTEM_ENTITY, IID_TerritoryManager).UpdateColors();
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1310|1310| 		}
|1311|1311| 	}
|1312|1312| 	else
|1313|    |-	{
|    |1313|+	
|1314|1314| 		// Didn't snap to an existing entity, add the starting tower manually. To prevent odd-looking rotation jumps
|1315|1315| 		// when shift-clicking to build a wall, reuse the placement angle that was last seen on a validly positioned
|1316|1316| 		// wall piece.
|1331|1331| 			"pos": start.pos,
|1332|1332| 			"angle": previewEntities.length > 0 ? previewEntities[0].angle : this.placementWallLastAngle
|1333|1333| 		});
|1334|    |-	}
|    |1334|+	
|1335|1335| 
|1336|1336| 	if (end.pos)
|1337|1337| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1334|1334| 	}
|1335|1335| 
|1336|1336| 	if (end.pos)
|1337|    |-	{
|    |1337|+	
|1338|1338| 		// Analogous to the starting side case above
|1339|1339| 		if (end.snappedEnt && end.snappedEnt != INVALID_ENTITY)
|1340|1340| 		{
|1372|1372| 				"pos": end.pos,
|1373|1373| 				"angle": previewEntities.length > 0 ? previewEntities[previewEntities.length-1].angle : this.placementWallLastAngle
|1374|1374| 			});
|1375|    |-	}
|    |1375|+	
|1376|1376| 
|1377|1377| 	let cmpTerrain = Engine.QueryInterface(SYSTEM_ENTITY, IID_Terrain);
|1378|1378| 	if (!cmpTerrain)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1550|1550| 
|1551|1551| 		let cmpVisual = Engine.QueryInterface(ent, IID_Visual);
|1552|1552| 		if (cmpVisual)
|1553|    |-		{
|    |1553|+		
|1554|1554| 			if (!allPiecesValid || !canAfford)
|1555|1555| 				cmpVisual.SetShadingColor(1.4, 0.4, 0.4, 1);
|1556|1556| 			else
|1557|1557| 				cmpVisual.SetShadingColor(1, 1, 1, 1);
|1558|    |-		}
|    |1558|+		
|1559|1559| 
|1560|1560| 		++entPool.numUsed;
|1561|1561| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1624|1624| 			{
|1625|1625| 				minDist2 = dist2;
|1626|1626| 				minDistEntitySnapData = {
|1627|    |-						"x": pos.x,
|    |1627|+					"x": pos.x,
|1628|1628| 						"z": pos.z,
|1629|1629| 						"angle": cmpPosition.GetRotation().y,
|1630|1630| 						"ent": ent
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1625|1625| 				minDist2 = dist2;
|1626|1626| 				minDistEntitySnapData = {
|1627|1627| 						"x": pos.x,
|1628|    |-						"z": pos.z,
|    |1628|+					"z": pos.z,
|1629|1629| 						"angle": cmpPosition.GetRotation().y,
|1630|1630| 						"ent": ent
|1631|1631| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1626|1626| 				minDistEntitySnapData = {
|1627|1627| 						"x": pos.x,
|1628|1628| 						"z": pos.z,
|1629|    |-						"angle": cmpPosition.GetRotation().y,
|    |1629|+					"angle": cmpPosition.GetRotation().y,
|1630|1630| 						"ent": ent
|1631|1631| 				};
|1632|1632| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1627|1627| 						"x": pos.x,
|1628|1628| 						"z": pos.z,
|1629|1629| 						"angle": cmpPosition.GetRotation().y,
|1630|    |-						"ent": ent
|    |1630|+					"ent": ent
|1631|1631| 				};
|1632|1632| 			}
|1633|1633| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1772|1772| 			result.gain = cmpEntityTrader.GetGoods().amount;
|1773|1773| 	}
|1774|1774| 	else if (data.target === secondMarket)
|1775|    |-	{
|    |1775|+	
|1776|1776| 		result = {
|1777|1777| 			"type": "is second",
|1778|1778| 			"gain": cmpEntityTrader.GetGoods().amount,
|1779|1779| 		};
|1780|    |-	}
|    |1780|+	
|1781|1781| 	else if (!firstMarket)
|1782|1782| 	{
|1783|1783| 		result = { "type": "set first" };
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1779|1779| 		};
|1780|1780| 	}
|1781|1781| 	else if (!firstMarket)
|1782|    |-	{
|    |1782|+	
|1783|1783| 		result = { "type": "set first" };
|1784|    |-	}
|    |1784|+	
|1785|1785| 	else if (!secondMarket)
|1786|1786| 	{
|1787|1787| 		result = {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1783|1783| 		result = { "type": "set first" };
|1784|1784| 	}
|1785|1785| 	else if (!secondMarket)
|1786|    |-	{
|    |1786|+	
|1787|1787| 		result = {
|1788|1788| 			"type": "set second",
|1789|1789| 			"gain": cmpEntityTrader.CalculateGain(firstMarket, data.target),
|1790|1790| 		};
|1791|    |-	}
|    |1791|+	
|1792|1792| 	else
|1793|1793| 	{
|1794|1794| 		// Else both markets are not null and target is different from them
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1790|1790| 		};
|1791|1791| 	}
|1792|1792| 	else
|1793|    |-	{
|    |1793|+	
|1794|1794| 		// Else both markets are not null and target is different from them
|1795|1795| 		result = { "type": "set first" };
|1796|    |-	}
|    |1796|+	
|1797|1797| 	return result;
|1798|1798| };
|1799|1799| 
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1037/

elexis added inline comments.Feb 4 2019, 10:02 PM
binaries/data/mods/public/simulation/components/GuiInterface.js
854

(Can consider passing cmd directly. I think this might even be faster as it can prevent allocating 3 temp bools (at least I recall that's how some rmgen scripts became faster by passing the same Vector2D instance instead of copying the Vector2D variables to an x and y argument).
Guess it won't be called that often that it's significant.)

binaries/data/mods/public/simulation/components/StatusBars.js
169

Still think that yoffset and the hardcoded 2/3 is a workaround / hack.

Why does the StatusBars template specify the BarWidth, BarHeight, HeightOffset of the one bar but not of the other bar that uses a different BarHeight and HeightOffset?

If we do a filesearch for <StatusBars>, we see that 74 templates specify different numbers.
So I wonder if we need 74 different numbers to tune the Status bars, why is there freedom to specify one status bar but not the other bar near it?
But there are only two templates that have Promotion if I'm not mistaken, template_unit and template_unit_cavalry.
So providng consistent support would be extending the Schema by the Offset and Size or whatever and specify that 2/3 thing in the XML file of these two templates.

That the same hack was used for Capture bars doesn't bring us closer to fixing it if we keep adding to the workarounds but only makes it more work to fix for later, no? If you commit it I won't raise a concern, but the clean implementation is different from what I've seen so far.

I guess it should be

<StatusBars>
 <HealthBar>
    <BarWidth>...
    <BarHeight>...
    <HeightOffset>...
 </HealthBar
 <CaptureBar>...

...

</StatusBars>

Cleaning that however would require touching of all templates with StatusBars. That's what one can refer to when picking a reason not to do it now.

Imarok added inline comments.Mar 3 2019, 12:17 PM
binaries/data/mods/public/simulation/components/StatusBars.js
169

The template specifies the general size and position of all status bars above that entity.
I don't see a usecase for a template changing the internals of status bar positioning.
If you see one, feel free to create a ticket/revision, where we can talk about that.

Imarok added inline comments.Mar 3 2019, 12:28 PM
binaries/data/mods/public/simulation/components/GuiInterface.js
854

I thought it would be a general convention that GuiInterface doesn't execute a simulation function by just passing cmd, to check and ensure the correct format of cmd.

elexis added inline comments.Mar 3 2019, 2:14 PM
binaries/data/mods/public/simulation/components/GuiInterface.js
854

Probably

binaries/data/mods/public/simulation/components/StatusBars.js
14

^

169

StatusBars.prototype.Schema doesn't actually define what it should be.

The point is that the 2/3 number of the bars is considerably not an internal logic constant with inherent universal truth to it, but as much as a userchosen number like the other user chosen magic numbers that depend on the specific entity and are expressed in the template.

The benefit of hardcoding the 2/3 is that one doesn't have to specify it in templates, which can make it less error prone, easier to manage; but perhaps there are some entities for which 2/3 isn't the best number? For example some entities have smaller status bars, the numbers were specified for health bars. Someone could have chosen a number that is so small that it's just right for health bars, but 2/3 * healthbar size would be too small for the template authors taste.

2/3 just smells like a magic number, and one that even obfuscates other hardcodings like the offset.

As mentioned there might be no relevant vanilla 0ad entities that are use cases, since mostly animals have different status bars from what I recall, and animals don't have experience bars. Perhaps we one can construct an example use case of an entity where the hardcoded layout fails.

The question is, why is the user granted the freedom to edit BarWidth, BarHeight and HeightOffset, but not the freedom to change the 2/3 and experience bar offset.
Just because the capture point status bar used the same principle of a fixed layout doesn't mean that it was inherently the best choice, or even a conscious choice, other than taking the path of quickest implementation (unless we have some trac or irc logs remaining of the reasoning).

StatusBars.prototype.Schema should receive the definition of that, so that we actually start documenting what the properties are supposed to change.

So if you as the author and commiter decides for the fixed layout, BarWidth, BarHeight would relate to the size of the Health and Capture bar, and should state that the experience bar is scaled down proportionally, and HeightOffset being the vertical distance from the entities position (at the foot of the unit?)

Just as a mathmatical consequence of the patch, adding a new experience bar of the size 2/3*BarWidth below the HeightOffset might make it possible for one entity to have it's head overlap with the newly added status bar. So one should check that this doesn't happen with the vanilla entities, but then again I think none of the entities were affected because animals don't have experience bars, and most of the bars of units are probably far enough away (one could ensure).

Anyway, your choice as the author and committer to disregard those mere 3 bytes in the file that would take some time to get rid of, which can still be done by the hypothetical future 2/3 editor.

Imarok added inline comments.Mar 3 2019, 3:12 PM
binaries/data/mods/public/simulation/components/StatusBars.js
169

The Schema properties are used to set the size of a usual bar. I see no problem in always scaling the experience bar to 67% the size of a normal bar.

Just as a mathmatical consequence of the patch, adding a new experience bar of the size 2/3*BarWidth below the HeightOffset might make it possible for one entity to have it's head overlap with the newly added status bar. So one should check that this doesn't happen with the vanilla entities, but then again I think none of the entities were affected because animals don't have experience bars, and most of the bars of units are probably far enough away (one could ensure).

The experience bar is added above HeightOffset

Imarok updated this revision to Diff 7510.Mar 3 2019, 3:13 PM

Add comments to the Schema

Vulcan added a comment.Mar 3 2019, 3:17 PM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 397| 397| 				// Players see colors depending on diplomacy
| 398| 398| 				g_DisplayedPlayerColors[i] =
| 399| 399| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 400|    |-					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
|    | 400|+						g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 401| 401| 					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 402| 402| 					getDiplomacyColor("enemy");
| 403| 403| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 398| 398| 				g_DisplayedPlayerColors[i] =
| 399| 399| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 400| 400| 					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 401|    |-					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
|    | 401|+							g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 402| 402| 					getDiplomacyColor("enemy");
| 403| 403| 
| 404| 404| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 399| 399| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 400| 400| 					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 401| 401| 					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 402|    |-					getDiplomacyColor("enemy");
|    | 402|+								getDiplomacyColor("enemy");
| 403| 403| 
| 404| 404| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
| 405| 405| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 655| 655| 					"civ": setStringTags(g_CivData[g_Players[g_ViewedPlayer].civ].Name, { "font": "sans-bold-stroke-14" }),
| 656| 656| 					"hotkey_civinfo": colorizeHotkey("%(hotkey)s", "civinfo"),
| 657| 657| 					"hotkey_structree": colorizeHotkey("%(hotkey)s", "structree")
| 658|    |-			});
|    | 658|+				});
| 659| 659| 	}
| 660| 660| 
| 661| 661| 	// Following gaia can be interesting on scripted maps
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1239|1239| 
|1240|1240| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1241|1241| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1242|    |-		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|    |1242|+			"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1243|1243| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1244|1244| 	});
|1245|1245| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1240|1240| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1241|1241| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1242|1242| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1243|    |-		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|    |1243|+			"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1244|1244| 	});
|1245|1245| 
|1246|1246| 	let resCodes = g_ResourceData.GetCodes();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1241|1241| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1242|1242| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1243|1243| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1244|    |-	});
|    |1244|+		});
|1245|1245| 
|1246|1246| 	let resCodes = g_ResourceData.GetCodes();
|1247|1247| 	for (let r = 0; r < resCodes.length; ++r)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1733|1733| 	for (let rct of resourcesCounterTypes)
|1734|1734| 		for (let rt of resourcesTypes)
|1735|1735| 			reportObject[rt + rct.substr(9)] = playerStatistics[rct][rt];
|1736|    |-			// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|    |1736|+	// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|1737|1737| 
|1738|1738| 	reportObject.vegetarianFoodGathered = playerStatistics.resourcesGathered.vegetarianFood;
|1739|1739| 	for (let type of unitsClasses)

binaries/data/mods/public/gui/session/session.js
|1067| »   let·getPanelEntNameTooltip·=·panelEntState·=>·"[font=\"sans-bold-16\"]"·+·template.name.specific·+·"[/font]";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'panelEntState' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1142| »   »   button.onpress·=·(function(i)·{·return·function()·{·performGroup((Engine.HotkeyIsPressed("selection.add")·?·"add"·:·"select"),·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1143| »   »   button.ondoublepress·=·(function(i)·{·return·function()·{·performGroup("snap",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1144| »   »   button.onpressright·=·(function(i)·{·return·function()·{·performGroup("breakUp",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|  66|  66| 		let phase = "";
|  67|  67| 		let cmpTechnologyManager = QueryPlayerIDInterface(i, IID_TechnologyManager);
|  68|  68| 		if (cmpTechnologyManager)
|  69|    |-		{
|    |  69|+		
|  70|  70| 			if (cmpTechnologyManager.IsTechnologyResearched("phase_city"))
|  71|  71| 				phase = "city";
|  72|  72| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_town"))
|  73|  73| 				phase = "town";
|  74|  74| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_village"))
|  75|  75| 				phase = "village";
|  76|    |-		}
|    |  76|+		
|  77|  77| 
|  78|  78| 		// store player ally/neutral/enemy data as arrays
|  79|  79| 		let allies = [];
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 410| 410| 			ret.attack[type].elevationBonus = range.elevationBonus;
| 411| 411| 
| 412| 412| 			if (cmpUnitAI && cmpPosition && cmpPosition.IsInWorld())
| 413|    |-			{
|    | 413|+			
| 414| 414| 				// For units, take the range in front of it, no spread. So angle = 0
| 415| 415| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 416|    |-			}
|    | 416|+			
| 417| 417| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 418| 418| 			{
| 419| 419| 				// For buildings, take the average elevation around it. So angle = 2*pi
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 415| 415| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 416| 416| 			}
| 417| 417| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 418|    |-			{
|    | 418|+			
| 419| 419| 				// For buildings, take the average elevation around it. So angle = 2*pi
| 420| 420| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 421|    |-			}
|    | 421|+			
| 422| 422| 			else
| 423| 423| 			{
| 424| 424| 				// not in world, set a default?
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 420| 420| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 421| 421| 			}
| 422| 422| 			else
| 423|    |-			{
|    | 423|+			
| 424| 424| 				// not in world, set a default?
| 425| 425| 				ret.attack[type].elevationAdaptedRange = ret.attack.maxRange;
| 426|    |-			}
|    | 426|+			
| 427| 427| 		}
| 428| 428| 	}
| 429| 429| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 791| 791| 		updateEntityColor(data.showAllStatusBars && (i == player || player == -1) ?
| 792| 792| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer, IID_StatusBars] :
| 793| 793| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer],
| 794|    |-			cmpRangeManager.GetEntitiesByPlayer(i));
|    | 794|+		cmpRangeManager.GetEntitiesByPlayer(i));
| 795| 795| 	}
| 796| 796| 	updateEntityColor([IID_Selectable, IID_StatusBars], data.selected);
| 797| 797| 	Engine.QueryInterface(SYSTEM_ENTITY, IID_TerritoryManager).UpdateColors();
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1310|1310| 		}
|1311|1311| 	}
|1312|1312| 	else
|1313|    |-	{
|    |1313|+	
|1314|1314| 		// Didn't snap to an existing entity, add the starting tower manually. To prevent odd-looking rotation jumps
|1315|1315| 		// when shift-clicking to build a wall, reuse the placement angle that was last seen on a validly positioned
|1316|1316| 		// wall piece.
|1331|1331| 			"pos": start.pos,
|1332|1332| 			"angle": previewEntities.length > 0 ? previewEntities[0].angle : this.placementWallLastAngle
|1333|1333| 		});
|1334|    |-	}
|    |1334|+	
|1335|1335| 
|1336|1336| 	if (end.pos)
|1337|1337| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1334|1334| 	}
|1335|1335| 
|1336|1336| 	if (end.pos)
|1337|    |-	{
|    |1337|+	
|1338|1338| 		// Analogous to the starting side case above
|1339|1339| 		if (end.snappedEnt && end.snappedEnt != INVALID_ENTITY)
|1340|1340| 		{
|1372|1372| 				"pos": end.pos,
|1373|1373| 				"angle": previewEntities.length > 0 ? previewEntities[previewEntities.length-1].angle : this.placementWallLastAngle
|1374|1374| 			});
|1375|    |-	}
|    |1375|+	
|1376|1376| 
|1377|1377| 	let cmpTerrain = Engine.QueryInterface(SYSTEM_ENTITY, IID_Terrain);
|1378|1378| 	if (!cmpTerrain)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1550|1550| 
|1551|1551| 		let cmpVisual = Engine.QueryInterface(ent, IID_Visual);
|1552|1552| 		if (cmpVisual)
|1553|    |-		{
|    |1553|+		
|1554|1554| 			if (!allPiecesValid || !canAfford)
|1555|1555| 				cmpVisual.SetShadingColor(1.4, 0.4, 0.4, 1);
|1556|1556| 			else
|1557|1557| 				cmpVisual.SetShadingColor(1, 1, 1, 1);
|1558|    |-		}
|    |1558|+		
|1559|1559| 
|1560|1560| 		++entPool.numUsed;
|1561|1561| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1624|1624| 			{
|1625|1625| 				minDist2 = dist2;
|1626|1626| 				minDistEntitySnapData = {
|1627|    |-						"x": pos.x,
|    |1627|+					"x": pos.x,
|1628|1628| 						"z": pos.z,
|1629|1629| 						"angle": cmpPosition.GetRotation().y,
|1630|1630| 						"ent": ent
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1625|1625| 				minDist2 = dist2;
|1626|1626| 				minDistEntitySnapData = {
|1627|1627| 						"x": pos.x,
|1628|    |-						"z": pos.z,
|    |1628|+					"z": pos.z,
|1629|1629| 						"angle": cmpPosition.GetRotation().y,
|1630|1630| 						"ent": ent
|1631|1631| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1626|1626| 				minDistEntitySnapData = {
|1627|1627| 						"x": pos.x,
|1628|1628| 						"z": pos.z,
|1629|    |-						"angle": cmpPosition.GetRotation().y,
|    |1629|+					"angle": cmpPosition.GetRotation().y,
|1630|1630| 						"ent": ent
|1631|1631| 				};
|1632|1632| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1627|1627| 						"x": pos.x,
|1628|1628| 						"z": pos.z,
|1629|1629| 						"angle": cmpPosition.GetRotation().y,
|1630|    |-						"ent": ent
|    |1630|+					"ent": ent
|1631|1631| 				};
|1632|1632| 			}
|1633|1633| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1772|1772| 			result.gain = cmpEntityTrader.GetGoods().amount;
|1773|1773| 	}
|1774|1774| 	else if (data.target === secondMarket)
|1775|    |-	{
|    |1775|+	
|1776|1776| 		result = {
|1777|1777| 			"type": "is second",
|1778|1778| 			"gain": cmpEntityTrader.GetGoods().amount,
|1779|1779| 		};
|1780|    |-	}
|    |1780|+	
|1781|1781| 	else if (!firstMarket)
|1782|1782| 	{
|1783|1783| 		result = { "type": "set first" };
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1779|1779| 		};
|1780|1780| 	}
|1781|1781| 	else if (!firstMarket)
|1782|    |-	{
|    |1782|+	
|1783|1783| 		result = { "type": "set first" };
|1784|    |-	}
|    |1784|+	
|1785|1785| 	else if (!secondMarket)
|1786|1786| 	{
|1787|1787| 		result = {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1783|1783| 		result = { "type": "set first" };
|1784|1784| 	}
|1785|1785| 	else if (!secondMarket)
|1786|    |-	{
|    |1786|+	
|1787|1787| 		result = {
|1788|1788| 			"type": "set second",
|1789|1789| 			"gain": cmpEntityTrader.CalculateGain(firstMarket, data.target),
|1790|1790| 		};
|1791|    |-	}
|    |1791|+	
|1792|1792| 	else
|1793|1793| 	{
|1794|1794| 		// Else both markets are not null and target is different from them
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1790|1790| 		};
|1791|1791| 	}
|1792|1792| 	else
|1793|    |-	{
|    |1793|+	
|1794|1794| 		// Else both markets are not null and target is different from them
|1795|1795| 		result = { "type": "set first" };
|1796|    |-	}
|    |1796|+	
|1797|1797| 	return result;
|1798|1798| };
|1799|1799| 
Executing section cli...

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

Imarok updated this revision to Diff 7511.Mar 3 2019, 3:17 PM

Fix the addded comments ^^

Vulcan added a comment.Mar 3 2019, 3:19 PM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|  66|  66| 		let phase = "";
|  67|  67| 		let cmpTechnologyManager = QueryPlayerIDInterface(i, IID_TechnologyManager);
|  68|  68| 		if (cmpTechnologyManager)
|  69|    |-		{
|    |  69|+		
|  70|  70| 			if (cmpTechnologyManager.IsTechnologyResearched("phase_city"))
|  71|  71| 				phase = "city";
|  72|  72| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_town"))
|  73|  73| 				phase = "town";
|  74|  74| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_village"))
|  75|  75| 				phase = "village";
|  76|    |-		}
|    |  76|+		
|  77|  77| 
|  78|  78| 		// store player ally/neutral/enemy data as arrays
|  79|  79| 		let allies = [];
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 410| 410| 			ret.attack[type].elevationBonus = range.elevationBonus;
| 411| 411| 
| 412| 412| 			if (cmpUnitAI && cmpPosition && cmpPosition.IsInWorld())
| 413|    |-			{
|    | 413|+			
| 414| 414| 				// For units, take the range in front of it, no spread. So angle = 0
| 415| 415| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 416|    |-			}
|    | 416|+			
| 417| 417| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 418| 418| 			{
| 419| 419| 				// For buildings, take the average elevation around it. So angle = 2*pi
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 415| 415| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 416| 416| 			}
| 417| 417| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 418|    |-			{
|    | 418|+			
| 419| 419| 				// For buildings, take the average elevation around it. So angle = 2*pi
| 420| 420| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 421|    |-			}
|    | 421|+			
| 422| 422| 			else
| 423| 423| 			{
| 424| 424| 				// not in world, set a default?
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 420| 420| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 421| 421| 			}
| 422| 422| 			else
| 423|    |-			{
|    | 423|+			
| 424| 424| 				// not in world, set a default?
| 425| 425| 				ret.attack[type].elevationAdaptedRange = ret.attack.maxRange;
| 426|    |-			}
|    | 426|+			
| 427| 427| 		}
| 428| 428| 	}
| 429| 429| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 791| 791| 		updateEntityColor(data.showAllStatusBars && (i == player || player == -1) ?
| 792| 792| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer, IID_StatusBars] :
| 793| 793| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer],
| 794|    |-			cmpRangeManager.GetEntitiesByPlayer(i));
|    | 794|+		cmpRangeManager.GetEntitiesByPlayer(i));
| 795| 795| 	}
| 796| 796| 	updateEntityColor([IID_Selectable, IID_StatusBars], data.selected);
| 797| 797| 	Engine.QueryInterface(SYSTEM_ENTITY, IID_TerritoryManager).UpdateColors();
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1310|1310| 		}
|1311|1311| 	}
|1312|1312| 	else
|1313|    |-	{
|    |1313|+	
|1314|1314| 		// Didn't snap to an existing entity, add the starting tower manually. To prevent odd-looking rotation jumps
|1315|1315| 		// when shift-clicking to build a wall, reuse the placement angle that was last seen on a validly positioned
|1316|1316| 		// wall piece.
|1331|1331| 			"pos": start.pos,
|1332|1332| 			"angle": previewEntities.length > 0 ? previewEntities[0].angle : this.placementWallLastAngle
|1333|1333| 		});
|1334|    |-	}
|    |1334|+	
|1335|1335| 
|1336|1336| 	if (end.pos)
|1337|1337| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1334|1334| 	}
|1335|1335| 
|1336|1336| 	if (end.pos)
|1337|    |-	{
|    |1337|+	
|1338|1338| 		// Analogous to the starting side case above
|1339|1339| 		if (end.snappedEnt && end.snappedEnt != INVALID_ENTITY)
|1340|1340| 		{
|1372|1372| 				"pos": end.pos,
|1373|1373| 				"angle": previewEntities.length > 0 ? previewEntities[previewEntities.length-1].angle : this.placementWallLastAngle
|1374|1374| 			});
|1375|    |-	}
|    |1375|+	
|1376|1376| 
|1377|1377| 	let cmpTerrain = Engine.QueryInterface(SYSTEM_ENTITY, IID_Terrain);
|1378|1378| 	if (!cmpTerrain)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1550|1550| 
|1551|1551| 		let cmpVisual = Engine.QueryInterface(ent, IID_Visual);
|1552|1552| 		if (cmpVisual)
|1553|    |-		{
|    |1553|+		
|1554|1554| 			if (!allPiecesValid || !canAfford)
|1555|1555| 				cmpVisual.SetShadingColor(1.4, 0.4, 0.4, 1);
|1556|1556| 			else
|1557|1557| 				cmpVisual.SetShadingColor(1, 1, 1, 1);
|1558|    |-		}
|    |1558|+		
|1559|1559| 
|1560|1560| 		++entPool.numUsed;
|1561|1561| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1624|1624| 			{
|1625|1625| 				minDist2 = dist2;
|1626|1626| 				minDistEntitySnapData = {
|1627|    |-						"x": pos.x,
|    |1627|+					"x": pos.x,
|1628|1628| 						"z": pos.z,
|1629|1629| 						"angle": cmpPosition.GetRotation().y,
|1630|1630| 						"ent": ent
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1625|1625| 				minDist2 = dist2;
|1626|1626| 				minDistEntitySnapData = {
|1627|1627| 						"x": pos.x,
|1628|    |-						"z": pos.z,
|    |1628|+					"z": pos.z,
|1629|1629| 						"angle": cmpPosition.GetRotation().y,
|1630|1630| 						"ent": ent
|1631|1631| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1626|1626| 				minDistEntitySnapData = {
|1627|1627| 						"x": pos.x,
|1628|1628| 						"z": pos.z,
|1629|    |-						"angle": cmpPosition.GetRotation().y,
|    |1629|+					"angle": cmpPosition.GetRotation().y,
|1630|1630| 						"ent": ent
|1631|1631| 				};
|1632|1632| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1627|1627| 						"x": pos.x,
|1628|1628| 						"z": pos.z,
|1629|1629| 						"angle": cmpPosition.GetRotation().y,
|1630|    |-						"ent": ent
|    |1630|+					"ent": ent
|1631|1631| 				};
|1632|1632| 			}
|1633|1633| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1772|1772| 			result.gain = cmpEntityTrader.GetGoods().amount;
|1773|1773| 	}
|1774|1774| 	else if (data.target === secondMarket)
|1775|    |-	{
|    |1775|+	
|1776|1776| 		result = {
|1777|1777| 			"type": "is second",
|1778|1778| 			"gain": cmpEntityTrader.GetGoods().amount,
|1779|1779| 		};
|1780|    |-	}
|    |1780|+	
|1781|1781| 	else if (!firstMarket)
|1782|1782| 	{
|1783|1783| 		result = { "type": "set first" };
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1779|1779| 		};
|1780|1780| 	}
|1781|1781| 	else if (!firstMarket)
|1782|    |-	{
|    |1782|+	
|1783|1783| 		result = { "type": "set first" };
|1784|    |-	}
|    |1784|+	
|1785|1785| 	else if (!secondMarket)
|1786|1786| 	{
|1787|1787| 		result = {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1783|1783| 		result = { "type": "set first" };
|1784|1784| 	}
|1785|1785| 	else if (!secondMarket)
|1786|    |-	{
|    |1786|+	
|1787|1787| 		result = {
|1788|1788| 			"type": "set second",
|1789|1789| 			"gain": cmpEntityTrader.CalculateGain(firstMarket, data.target),
|1790|1790| 		};
|1791|    |-	}
|    |1791|+	
|1792|1792| 	else
|1793|1793| 	{
|1794|1794| 		// Else both markets are not null and target is different from them
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1790|1790| 		};
|1791|1791| 	}
|1792|1792| 	else
|1793|    |-	{
|    |1793|+	
|1794|1794| 		// Else both markets are not null and target is different from them
|1795|1795| 		result = { "type": "set first" };
|1796|    |-	}
|    |1796|+	
|1797|1797| 	return result;
|1798|1798| };
|1799|1799| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 397| 397| 				// Players see colors depending on diplomacy
| 398| 398| 				g_DisplayedPlayerColors[i] =
| 399| 399| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 400|    |-					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
|    | 400|+						g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 401| 401| 					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 402| 402| 					getDiplomacyColor("enemy");
| 403| 403| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 398| 398| 				g_DisplayedPlayerColors[i] =
| 399| 399| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 400| 400| 					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 401|    |-					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
|    | 401|+							g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 402| 402| 					getDiplomacyColor("enemy");
| 403| 403| 
| 404| 404| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 399| 399| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 400| 400| 					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 401| 401| 					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 402|    |-					getDiplomacyColor("enemy");
|    | 402|+								getDiplomacyColor("enemy");
| 403| 403| 
| 404| 404| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
| 405| 405| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 655| 655| 					"civ": setStringTags(g_CivData[g_Players[g_ViewedPlayer].civ].Name, { "font": "sans-bold-stroke-14" }),
| 656| 656| 					"hotkey_civinfo": colorizeHotkey("%(hotkey)s", "civinfo"),
| 657| 657| 					"hotkey_structree": colorizeHotkey("%(hotkey)s", "structree")
| 658|    |-			});
|    | 658|+				});
| 659| 659| 	}
| 660| 660| 
| 661| 661| 	// Following gaia can be interesting on scripted maps
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1239|1239| 
|1240|1240| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1241|1241| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1242|    |-		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|    |1242|+			"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1243|1243| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1244|1244| 	});
|1245|1245| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1240|1240| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1241|1241| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1242|1242| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1243|    |-		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|    |1243|+			"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1244|1244| 	});
|1245|1245| 
|1246|1246| 	let resCodes = g_ResourceData.GetCodes();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1241|1241| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1242|1242| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1243|1243| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1244|    |-	});
|    |1244|+		});
|1245|1245| 
|1246|1246| 	let resCodes = g_ResourceData.GetCodes();
|1247|1247| 	for (let r = 0; r < resCodes.length; ++r)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1733|1733| 	for (let rct of resourcesCounterTypes)
|1734|1734| 		for (let rt of resourcesTypes)
|1735|1735| 			reportObject[rt + rct.substr(9)] = playerStatistics[rct][rt];
|1736|    |-			// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|    |1736|+	// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|1737|1737| 
|1738|1738| 	reportObject.vegetarianFoodGathered = playerStatistics.resourcesGathered.vegetarianFood;
|1739|1739| 	for (let type of unitsClasses)

binaries/data/mods/public/gui/session/session.js
|1067| »   let·getPanelEntNameTooltip·=·panelEntState·=>·"[font=\"sans-bold-16\"]"·+·template.name.specific·+·"[/font]";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'panelEntState' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1142| »   »   button.onpress·=·(function(i)·{·return·function()·{·performGroup((Engine.HotkeyIsPressed("selection.add")·?·"add"·:·"select"),·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1143| »   »   button.ondoublepress·=·(function(i)·{·return·function()·{·performGroup("snap",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1144| »   »   button.onpressright·=·(function(i)·{·return·function()·{·performGroup("breakUp",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.
Executing section cli...

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

Imarok added inline comments.Mar 3 2019, 3:21 PM
binaries/data/mods/public/simulation/components/StatusBars.js
14

Fine?

elexis added inline comments.Mar 3 2019, 3:22 PM
binaries/data/mods/public/simulation/components/StatusBars.js
14

HeightOffset missing, normal is undefined, also I suppose the experience bar is normal too

169

Then it might be wrong if there is negative HeightOffset somewhere, which I guess we don't have.

178

Forgot to mention that the 2/3rd could also be moved to a constant (at least Vladislav raises that point often in C++ code), (but then the other constants that are currently 1 could become editable too, and it could also be moved to the template)

Imarok added inline comments.Mar 3 2019, 3:28 PM
binaries/data/mods/public/simulation/components/StatusBars.js
14

I think I was updating the diff while you commented.

169

Don't get what you mean.

elexis added inline comments.Mar 3 2019, 4:05 PM
binaries/data/mods/public/simulation/components/StatusBars.js
14

"Height of a normal sized bar" doesn't tell us which of the three bars are refered to, so why not just refer to "size of the health and capture bar" and that "size of experiencebar" is scaled proportionally by a factor of 2/3, then everyone knows what's happening.

Would be good to have HeightOffset defined (at least we must know it's definition already in order to decide the correctness of the patch, so the only effort now is phrasing it).

169

That there is a mathmatical possibility that an entity template exists for which 2/3 is not the best, or even a wrong magic number. Vice versa a proof that none such number can exist for all HeightOffset values ("decimal") would be part of a verification of this patch.
I suppose all HeightOffset values in the current vanilla 0ad templates are greater than 0, so there'd be that verification for vanilla. But 2/3 could still be wrong for some future addition or mod, for example if the bars are set below the unit instead of above (negative HeightOffset). (Templates have the purpose to hold values that are specific to entities while code has the purpose to work indiscriminately to specific values.)

Imarok added inline comments.Mar 3 2019, 4:08 PM
binaries/data/mods/public/simulation/components/StatusBars.js
14

Imho that are internals irrelevant for the normal template editer.
Also if we are too specific, we always have to chnage the comment when we add a new bar or change the 2/3.

169

I still don't get what HeightOffset should have to do with 2/3 which is a BarHeight scaling.

Nescio removed a subscriber: Nescio.Mar 3 2019, 5:19 PM
This revision was automatically updated to reflect the committed changes.