Page MenuHomeWildfire Games

Remove unused TemplateDataWithoutLocalization
ClosedPublic

Authored by mimo on Aug 24 2017, 7:00 PM.

Details

Summary

Old code now unused, and would be wrong if used as it is because it should be reset at each turn.

Test Plan

Check that nothing uses it

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

mimo created this revision.Aug 24 2017, 7:01 PM
Vulcan added a subscriber: Vulcan.Aug 24 2017, 7:49 PM

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/1910/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...
|    | [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
|1631|1631| 
|1632|1632| 		playerStatistics.economyScore += total + ",";
|1633|1633| 		playerStatistics.militaryScore += Math.round((player.sequences.enemyUnitsKilledValue[maxIndex] +
|1634|    |-			player.sequences.enemyBuildingsDestroyedValue[maxIndex]) / 10)  + ",";
|    |1634|+			player.sequences.enemyBuildingsDestroyedValue[maxIndex]) / 10) + ",";
|1635|1635| 		playerStatistics.totalScore += (total + Math.round((player.sequences.enemyUnitsKilledValue[maxIndex] +
|1636|1636| 			player.sequences.enemyBuildingsDestroyedValue[maxIndex]) / 10)) + ",";
|1637|1637| 

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

binaries/data/mods/public/gui/session/session.js
| 426| »   »   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
| 437| »   »   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
| 983| »   »   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
|1012| »   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
|1088| »   »   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
|1089| »   »   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
|1090| »   »   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
| 847| »   »   i·==·0·||
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

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

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

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

binaries/data/mods/public/gui/session/session.js
|1087| »   »   button.hidden·=·g_Groups.groups[i].getTotalCount()·==·0;
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/gui/session/session.js
|1088| »   »   button.onpress·=·(function(i)·{·return·function()·{·performGroup((Engine.HotkeyIsPressed("selection.add")·?·"add"·:·"select"),·i);·};·})(i);
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/session/session.js
|1089| »   »   button.ondoublepress·=·(function(i)·{·return·function()·{·performGroup("snap",·i);·};·})(i);
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/session/session.js
|1090| »   »   button.onpressright·=·(function(i)·{·return·function()·{·performGroup("breakUp",·i);·};·})(i);
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/session/session.js
|1095| »   »   »   let·icon·=·GetTemplateData(GetEntityState(g_Groups.groups[i].getEntsGrouped().reduce((pre,·cur)·=>·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/session/session.js
|1149| »   »   if·(player·!=·0·&&
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with '0'.

binaries/data/mods/public/gui/session/session.js
|1244| »   »   button.onpress·=·(function(e)·{·return·function()·{·selectAndMoveTo(e);·};·})(researchStarted[tech].researcher);
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/session/session.js
|1441| »   »   if·(+playerID·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
Executing section XML GUI...
Executing section Python...
Executing section Perl...

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

elexis accepted this revision.Aug 24 2017, 10:27 PM
elexis added a subscriber: elexis.

rP14954 introduced it. It had only one use in that commit: wallName === "Wooden Wall".
We don't really have to look further whether this is a useful function or not. It isn't, because untranslated strings should never concern the simulation or GUI.
Patch removes the concerned function and variables completely and the other cache variables are in use.

(Remotely related: It's a bit weird that the GUI code copies the aura objects into the template data instead of looking up in the aura cache.)

This revision is now accepted and ready to land.Aug 24 2017, 10:27 PM
This revision was automatically updated to reflect the committed changes.