Page MenuHomeWildfire Games

Resource name translation cleanup
ClosedPublic

Authored by elexis on Jun 10 2017, 3:49 AM.

Details

Summary

rP18964 removed most of common/l10n.js which was introduced by rP16127.
This file should be removed since it contains about 30 lines of code related to the tooltips code (so prepare this in this patch).

One thing that was unfortunate by rP18964 is that it removed the warning that was shown if someone tried to translate a resource code that doesn't exist.

Another thing I don't feel comfortable with is that the "firstWord" and "withinSentence" translation context is duplicated. A typo in there would cause a new translation, which should really be avoided.
The previous code from l10n.js warned about that too. The proposed patch will remove the duplication and even better, prevent the creation of such a translation context and cause a JS reference error instead in such a case.

That the untranslated strings are exposed in Resources.GetNames() is deplorable, as coders might assume that this is already translated or forget to translate this.
So all references to it are removed as far as possible (should we move those two tooltip.js functions to globalscripts/Resources.js so as to nuke those two occurances too?).
The GUIInterface reference is needed for the AI, which only needs it in the chatHelper.js which passes the translatable string to a place where it is translated (instead of just passing the resource code. Refs the markForTranslation being uncomfortable #3665), so whatever.
Speaking of #3665, Player.SubtractResourcesOrNotify should also not use these four hardcoded strings but just reuse getLocalizedResourceAmounts if it worked as one might wish.

The ResourceSupply.js warning seems redundant with the template validation.

Test Plan

Search for GetNames(), firstWord and withinSentence to check for completeness and check for typos in the calls to the two new functions.

Diff Detail

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

Event Timeline

elexis created this revision.Jun 10 2017, 3:49 AM
elexis edited the summary of this revision. (Show Details)Jun 10 2017, 3:55 AM
Vulcan added a subscriber: Vulcan.Jun 10 2017, 8:44 AM
Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/gui/summary/layout.js
| 105| »   »   »   »   "yStart":·34,
|    | [MAJOR] ESLintBear:
|    | Parsing error: Unexpected token "yStart"

binaries/data/mods/public/gui/summary/layout.js
| 105| »   »   »   »   "yStart":·34,
|    | [MAJOR] JSHintBear:
|    | Expected '}' to match '{' from line 102 and instead saw 'yStart'.

binaries/data/mods/public/gui/summary/layout.js
| 105| »   »   »   »   "yStart":·34,
|    | [MAJOR] JSHintBear:
|    | Expected ')' to match '(' from line 102 and instead saw ':'.

binaries/data/mods/public/gui/summary/layout.js
| 105| »   »   »   »   "yStart":·34,
|    | [NORMAL] JSHintBear:
|    | Expected ')' and instead saw '34'.

binaries/data/mods/public/gui/summary/layout.js
| 106| »   »   »   »   "width":·100
|    | [MAJOR] JSHintBear:
|    | Expected ']' to match '[' from line 100 and instead saw ':'.

binaries/data/mods/public/gui/summary/layout.js
| 106| »   »   »   »   "width":·100
|    | [MAJOR] JSHintBear:
|    | Expected '}' to match '{' from line 98 and instead saw '100'.

binaries/data/mods/public/gui/summary/layout.js
| 107| »   »   »   })),
|    | [MAJOR] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/summary/layout.js
| 107| »   »   »   })),
|    | [MAJOR] JSHintBear:
|    | Expected an identifier and instead saw ')'.

binaries/data/mods/public/gui/summary/layout.js
| 107| »   »   »   })),
|    | [NORMAL] JSHintBear:
|    | Expected an assignment or function call and instead saw an expression.

binaries/data/mods/public/gui/summary/layout.js
| 107| »   »   »   })),
|    | [MAJOR] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/summary/layout.js
| 107| »   »   »   })),
|    | [MAJOR] JSHintBear:
|    | Expected an identifier and instead saw ')'.

binaries/data/mods/public/gui/summary/layout.js
| 107| »   »   »   })),
|    | [MAJOR] JSHintBear:
|    | Expected an operator and instead saw ','.

binaries/data/mods/public/gui/summary/layout.js
| 107| »   »   »   })),
|    | [NORMAL] JSHintBear:
|    | Expected an assignment or function call and instead saw an expression.

binaries/data/mods/public/gui/summary/layout.js
| 107| »   »   »   })),
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/summary/layout.js
| 108| »   »   »   {·"identifier":·"total",·"caption":·translate("Total"),·"yStart":·34,·"width":·110·},
|    | [NORMAL] JSHintBear:
|    | Expected an assignment or function call and instead saw an expression.

binaries/data/mods/public/gui/summary/layout.js
| 108| »   »   »   {·"identifier":·"total",·"caption":·translate("Total"),·"yStart":·34,·"width":·110·},
|    | [MAJOR] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/summary/layout.js
| 108| »   »   »   {·"identifier":·"total",·"caption":·translate("Total"),·"yStart":·34,·"width":·110·},
|    | [MAJOR] JSHintBear:
|    | Expected '}' to match '{' from line 108 and instead saw ':'.

binaries/data/mods/public/gui/summary/layout.js
| 108| »   »   »   {·"identifier":·"total",·"caption":·translate("Total"),·"yStart":·34,·"width":·110·},
|    | [NORMAL] JSHintBear:
|    | Expected an assignment or function call and instead saw an expression.

binaries/data/mods/public/gui/summary/layout.js
| 108| »   »   »   {·"identifier":·"total",·"caption":·translate("Total"),·"yStart":·34,·"width":·110·},
|    | [MAJOR] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/summary/layout.js
| 108| »   »   »   {·"identifier":·"total",·"caption":·translate("Total"),·"yStart":·34,·"width":·110·},
|    | [MAJOR] JSHintBear:
|    | Unrecoverable syntax error. (29% scanned).

binaries/data/mods/public/simulation/components/ResourceSupply.js
|  84| »   »   »   »   return·diminishingReturns·==·1·?·1·:·(1.·-·Math.pow(diminishingReturns,·numGatherers))·/·(1.·-·diminishingReturns)·/·numGatherers;
|    | [NORMAL] JSHintBear:
|    | A trailing decimal point can be confused with a dot: '1.'.

binaries/data/mods/public/simulation/components/ResourceSupply.js
|  84| »   »   »   »   return·diminishingReturns·==·1·?·1·:·(1.·-·Math.pow(diminishingReturns,·numGatherers))·/·(1.·-·diminishingReturns)·/·numGatherers;
|    | [NORMAL] JSHintBear:
|    | A trailing decimal point can be confused with a dot: '1.'.

binaries/data/mods/public/gui/session/selection_details.js
| 395| »   »   let·setCaptureBarPart·=·function(playerID,·startSize)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'playerID' is already declared in the upper scope.

binaries/data/mods/public/gui/session/selection_details.js
| 360| »   »   »   capturePoints·=·entState.capturePoints.map((v,·i)·=>·v·+·capturePoints[i]);
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/session/selection_details.js
| 432| »   »   »   »   res·=>·totalCarrying[res]·!=·0).map(
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with '0'.

binaries/data/mods/public/gui/session/selection_details.js
| 441| »   »   »   »   res·=>·totalLoot[res]·!=·0).map(
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with '0'.

binaries/data/mods/public/gui/session/selection_details.js
| 468| »   if·(entStates.length·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/gui/common/tooltips.js
| 571| »   »   '[/color][/font]'·+·"·"·+
|    | [NORMAL] ESLintBear (no-useless-concat):
|    | Unexpected string concatenation of literals.

binaries/data/mods/public/gui/common/tooltips.js
| 402| »   »   let·[rate,·count]·=·types.reduce((sum,·t)·=>·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/common/tooltips.js
| 583| »   if·(walk·==·0·&&·run·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/gui/common/tooltips.js
| 583| »   if·(walk·==·0·&&·run·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '+'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/session.js
|1597|1597| 
|1598|1598| 		playerStatistics.economyScore += total + ",";
|1599|1599| 		playerStatistics.militaryScore += Math.round((player.sequences.enemyUnitsKilledValue[maxIndex] +
|1600|    |-			player.sequences.enemyBuildingsDestroyedValue[maxIndex]) / 10)  + ",";
|    |1600|+			player.sequences.enemyBuildingsDestroyedValue[maxIndex]) / 10) + ",";
|1601|1601| 		playerStatistics.totalScore += (total + Math.round((player.sequences.enemyUnitsKilledValue[maxIndex] +
|1602|1602| 			player.sequences.enemyBuildingsDestroyedValue[maxIndex]) / 10)) + ",";
|1603|1603| 

binaries/data/mods/public/gui/session/session.js
| 412| »   »   colorizeHotkey("%(hotkey)s"·+·"·",·"selection.idleworker")·+
|    | [NORMAL] ESLintBear (no-useless-concat):
|    | Unexpected string concatenation of literals.

binaries/data/mods/public/gui/session/session.js
| 432| »   »   let·panelEnt·=·g_PanelEntities.find(panelEnt·=>·panelEnt.slot·!==·undefined·&&·panelEnt.slot·==·slot);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'panelEnt' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
| 443| »   »   let·panelEnt·=·g_PanelEntities.find(panelEnt·=>·panelEnt.slot·!==·undefined·&&·panelEnt.slot·==·slot);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'panelEnt' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
| 958| »   »   let·panelEnt·=·g_PanelEntities.find(panelEnt·=>·ent·==·panelEnt.ent);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'panelEnt' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
| 987| »   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
|1063| »   »   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
|1064| »   »   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
|1065| »   »   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/gui/session/session.js
| 830| »   »   i·==·0·||
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/gui/session/session.js
| 832| »   »   g_GameAttributes.settings.PlayerData[i].AI·!=·"");
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with ''.

binaries/data/mods/public/gui/session/session.js
| 934| »   if·(direction·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/gui/session/session.js
| 958| »   »   let·panelEnt·=·g_PanelEntities.find(panelEnt·=>·ent·==·panelEnt.ent);
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loo

http://jw:8080/job/phabricator_lint/169/ for more details.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1528/ for more details.

s0600204 edited edge metadata.Jun 11 2017, 12:27 AM

Firstly, I agree with the intent of the revision. The changes make sense and result in code that's easier to comprehend. Great!

However, I'm not liking the idea suggested in the summary of tooltip/gui-specific functions possibly being added to the Globalscripts. And not just because, last I checked, the simulation context doesn't have access to the various Engine.Translate* functions (my point being that you'd be adding functions that cannot be used globally to a globally used object). The simulation has a helper file that extends the global Resources object, adding the two functions it uses to build xml schema. It's been a while since I properly looked at the Resources object, but I'm wondering if it's feasible to do a similar thing for the GUI?

Also, one of the downsides you mention of rP18964 is the loss of the warning if someone tries to use a resource code that doesn't exist. But I note that you haven't added it back in your changes (feeding an invalid resource code causes two user unfriendly warnings: "reference to undefined property" followed by "Script value conversion check failed").

binaries/data/mods/public/simulation/components/ResourceSupply.js
45 ↗(On Diff #2503)

Dates back to a version of the #3934 patch where disabling a resource could be achieved by setting enabled: false in the resource json file.

However, I'm not liking the idea suggested in the summary of tooltip/gui-specific functions possibly being added to the Globalscripts.

Just wanted to have that idea discussed.
Agree that the disadvantage of exposing translated strings to the simulation outweighs the advantage that we don't expose translatable strings anymore at all (hence it's not implemented in the proposed patch).

helper file that extends the global Resources object ... wondering if it's feasible to do a similar thing for the GUI

Should be possible, but for two translateWithContext proxy calls it doesn't seem worth the complexity

Also, one of the downsides you mention of rP18964 is the loss of the warning if someone tries to use a resource code that doesn't exist. But I note that you haven't added it back in your changes (feeding an invalid resource code causes two user unfriendly warnings: "reference to undefined property" followed by "Script value conversion check failed").

So it's actually added back without adding the code for it. If one adds a wrong resource in the templates, it will cause a validation error. Is it really worth to add the four lines of code for a rare case where someone called resourceNameWithinSentence or resourceNameFirstWord and not pass a template argument directly but a manipulated string?

binaries/data/mods/public/simulation/components/ResourceSupply.js
45 ↗(On Diff #2503)
s0600204 requested changes to this revision.Jun 11 2017, 4:01 AM
In D625#25612, @elexis wrote:

Just wanted to have that idea discussed.

Fair enough.

[...] for two translateWithContext proxy calls it doesn't seem worth the complexity

Agreed.

So it's actually added back without adding the code for it.

Well... without your changes applied it results in the same two warnings... so it's not really "added back". (Being pedantic, sorry.)

Is it really worth to add the four lines of code for a rare case where someone [...] not pass a template argument directly but a manipulated string?

Probably not, no.

binaries/data/mods/public/gui/summary/layout.js
104 ↗(On Diff #2503)
  1. Comma at end of line missing.
  2. You need to include common/tooltips.js in summary/summary.xml to gain access to this function.
157 ↗(On Diff #2503)

These both need to use res.code not res.name.

binaries/data/mods/public/simulation/components/ResourceSupply.js
45 ↗(On Diff #2503)

Most probably, yes. Ah well, these things slip through.

This revision now requires changes to proceed.Jun 11 2017, 4:01 AM
elexis updated this revision to Diff 2520.Jun 11 2017, 4:24 AM
elexis edited edge metadata.

Fix syntax errors pointed out by s0602004. Thanks for the review and testing!

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1534/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/components/ResourceSupply.js
|  84| »   »   »   »   return·diminishingReturns·==·1·?·1·:·(1.·-·Math.pow(diminishingReturns,·numGatherers))·/·(1.·-·diminishingReturns)·/·numGatherers;
|    | [NORMAL] JSHintBear:
|    | A trailing decimal point can be confused with a dot: '1.'.

binaries/data/mods/public/simulation/components/ResourceSupply.js
|  84| »   »   »   »   return·diminishingReturns·==·1·?·1·:·(1.·-·Math.pow(diminishingReturns,·numGatherers))·/·(1.·-·diminishingReturns)·/·numGatherers;
|    | [NORMAL] JSHintBear:
|    | A trailing decimal point can be confused with a dot: '1.'.

binaries/data/mods/public/gui/summary/layout.js
| 283| »   »   if·(rowPlayerObjectWidth·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/gui/session/selection_details.js
| 395| »   »   let·setCaptureBarPart·=·function(playerID,·startSize)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'playerID' is already declared in the upper scope.

binaries/data/mods/public/gui/session/selection_details.js
| 360| »   »   »   capturePoints·=·entState.capturePoints.map((v,·i)·=>·v·+·capturePoints[i]);
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/session/selection_details.js
| 432| »   »   »   »   res·=>·totalCarrying[res]·!=·0).map(
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with '0'.

binaries/data/mods/public/gui/session/selection_details.js
| 441| »   »   »   »   res·=>·totalLoot[res]·!=·0).map(
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with '0'.

binaries/data/mods/public/gui/session/selection_details.js
| 468| »   if·(entStates.length·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

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

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

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

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

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

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

binaries/data/mods/public/gui/session/menu.js
| 374| »   »   let·hasAllies·=·g_Players.filter(player·=>·player.isMutualAlly[g_ViewedPlayer]).length·>·1;
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/session/menu.js
| 432| »   »   button.onPress·=·(function(player,·stance)·{·return·function()·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/session/menu.js
| 464| »   »   button.onPress·=·(function(i,·resCode,·button)·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/session/menu.js
| 604| »   »   »   button[res].up.hidden·=·!controlsPlayer(g_ViewedPlayer)·||·res·==·currTradeSelection·||·proba[res]·==·100·||·proba[currTradeSelection]·==·0;
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/gui/session/menu.js
| 605| »   »   »   button[res].dn.hidden·=·!controlsPlayer(g_ViewedPlayer)·||·res·==·currTradeSelection·||·proba[res]·==·0·||·proba[currTradeSelection]·==·100;
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/gui/session/menu.js
| 654| »   »   buttonResource.onPress·=·(resource·=>·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/session/menu.js
| 669| »   »   buttonUp.onPress·=·(resource·=>·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/session/menu.js
| 679| »   »   buttonDn.onPress·=·(resource·=>·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/session/menu.js
|1009| »   »   »   »   g_IsObserver·||·player·==·0·||·player·==·g_ViewedPlayer·||
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '+'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/session.js
|1597|1597| 
|1598|1598| 		playerStatistics.economyScore += total + ",";
|1599|1599| 		playerStatistics.militaryScore += Math.round((player.sequences.enemyUnitsKilledValue[maxIndex] +
|1600|    |-			player.sequences.enemyBuildingsDestroyedValue[maxIndex]) / 10)  + ",";
|    |1600|+			player.sequences.enemyBuildingsDestroyedValue[maxIndex]) / 10) + ",";
|1601|1601| 		playerStatistics.totalScore += (total + Math.round((player.sequences.enemyUnitsKilledValue[maxIndex] +
|1602|1602| 			player.sequences.enemyBuildingsDestroyedValue[maxIndex]) / 10)) + ",";
|1603|1603| 

binaries/data/mods/public/gui/session/session.js
| 412| »   »   colorizeHotkey("%(hotkey)s"·+·"·",·"selection.idleworker")·+
|    | [NORMAL] ESLintBear (no-useless-concat):
|    | Unexpected string concatenation of literals.

binaries/data/mods/public/gui/session/session.js
| 432| »   »   let·panelEnt·=·g_PanelEntities.find(panelEnt·=>·panelEnt.slot·!==·undefined·&&·panelEnt.slot·==·slot);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'panelEnt' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
| 443| »   »   let·panelEnt·=·g_PanelEntities.find(panelEnt·=>·panelEnt.slot·!==·undefined·&&·panelEnt.slot·==·slot);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'panelEnt' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
| 958| »   »   let·panelEnt·=·g_PanelEntities.find(panelEnt·=>·ent·==·panelEnt.ent);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'panelEnt' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
| 987| »   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
|1063| »   »   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
|1064| »   »   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
|1065| »   »   button.onpressright·=·(function(i)·{·return·function()·{·performGroup("breakUp",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declar

http://jw:8080/job/phabricator_lint/174/ for more details.

s0600204 accepted this revision.Jun 11 2017, 10:20 PM
This revision is now accepted and ready to land.Jun 11 2017, 10:20 PM

Thanks for the review!

binaries/data/mods/public/gui/common/l10n.js
10 ↗(On Diff #2520)

Tested by bartering

binaries/data/mods/public/gui/session/menu.js
442 ↗(On Diff #2520)

Tested by tributing

binaries/data/mods/public/gui/session/selection_details.js
13 ↗(On Diff #2520)

Tested by clicking on a resource.
I wonder if we still need this function, but I guess we might. Mostly this treasure hack still needs to be removed.

binaries/data/mods/public/gui/session/session.js
1159 ↗(On Diff #2520)

Tested by hovering the resource counts in the session

binaries/data/mods/public/gui/summary/layout.js
104 ↗(On Diff #2503)

Tested by opening the summary screen

This revision was automatically updated to reflect the committed changes.