Now the cool artillery towers are implemented the user visible string "arrows" in the rate tooltip is wrong sometimes. This patch aims at fixing that.
I've used | as the singular/plural delimiter, not knowing whether that is good?
Differential D2431
Get projectile names from template. Freagarach on Nov 18 2019, 3:50 PM. Authored by
Details
Now the cool artillery towers are implemented the user visible string "arrows" in the rate tooltip is wrong sometimes. This patch aims at fixing that. I've used | as the singular/plural delimiter, not knowing whether that is good? Verify that different projectiles are shown correctly.
Diff Detail
Event TimelineComment Actions Successful build - Chance fights ever on the side of the prudent. Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/601/display/redirect Comment Actions Successful build - Chance fights ever on the side of the prudent. Linter detected issues: Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (operator-linebreak): | | '||' should be placed at the end of the line. |----| | /zpool0/trunk/binaries/data/mods/public/globalscripts/Templates.js | |++++| /zpool0/trunk/binaries/data/mods/public/globalscripts/Templates.js | 87| 87| // If the elements are still strings, split them by space or by '+' | 88| 88| if (typeof sublist == "string") | 89| 89| sublist = sublist.split(/[+\s]+/); | 90| |- if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1) | 91| |- || (c[0] != "!" && classes.indexOf(c) != -1))) | | 90|+ if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1) || | | 91|+ (c[0] != "!" && classes.indexOf(c) != -1))) | 92| 92| return true; | 93| 93| } | 94| 94| binaries/data/mods/public/globalscripts/Templates.js | 91| » » ····················||·(c[0]·!=·"!"·&&·classes.indexOf(c)·!=·-1))) | | [NORMAL] JSHintBear: | | Misleading line break before '||'; readers may interpret this as an expression boundary. | | [NORMAL] ESLintBear (indent): | | Expected indentation of 3 tabs but found 4. |----| | /zpool0/trunk/binaries/data/mods/public/gui/common/tooltips.js | |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/tooltips.js | 206| 206| "projectileName": unitFont(sprintf(translatePlural("%(singularProjectileName)s", "%(pluralProjectileName)s", projectiles), { | 207| 207| "singularProjectileName": projectileNames[0], | 208| 208| "pluralProjectileName": projectileNames[1] | 209| |- })) | | 209|+ })) | 210| 210| }); | 211| 211| | 212| 212| attackRateString = sprintf(translate("%(projectileString)s / %(attackRateString)s"), { | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js | 823| 823| updateEntityColor(data.showAllStatusBars && (i == player || player == -1) ? | 824| 824| [IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer, IID_StatusBars] : | 825| 825| [IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer], | 826| |- cmpRangeManager.GetEntitiesByPlayer(i)); | | 826|+ cmpRangeManager.GetEntitiesByPlayer(i)); | 827| 827| } | 828| 828| updateEntityColor([IID_Selectable, IID_StatusBars], data.selected); | 829| 829| Engine.QueryInterface(SYSTEM_ENTITY, IID_TerritoryManager).UpdateColors(); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 5 tabs but found 6. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js |1656|1656| { |1657|1657| minDist2 = dist2; |1658|1658| minDistEntitySnapData = { |1659| |- "x": pos.x, | |1659|+ "x": pos.x, |1660|1660| "z": pos.z, |1661|1661| "angle": cmpPosition.GetRotation().y, |1662|1662| "ent": ent | | [NORMAL] ESLintBear (indent): | | Expected indentation of 5 tabs but found 6. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js |1657|1657| minDist2 = dist2; |1658|1658| minDistEntitySnapData = { |1659|1659| "x": pos.x, |1660| |- "z": pos.z, | |1660|+ "z": pos.z, |1661|1661| "angle": cmpPosition.GetRotation().y, |1662|1662| "ent": ent |1663|1663| }; | | [NORMAL] ESLintBear (indent): | | Expected indentation of 5 tabs but found 6. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js |1658|1658| minDistEntitySnapData = { |1659|1659| "x": pos.x, |1660|1660| "z": pos.z, |1661| |- "angle": cmpPosition.GetRotation().y, | |1661|+ "angle": cmpPosition.GetRotation().y, |1662|1662| "ent": ent |1663|1663| }; |1664|1664| } | | [NORMAL] ESLintBear (indent): | | Expected indentation of 5 tabs but found 6. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js |1659|1659| "x": pos.x, |1660|1660| "z": pos.z, |1661|1661| "angle": cmpPosition.GetRotation().y, |1662| |- "ent": ent | |1662|+ "ent": ent |1663|1663| }; |1664|1664| } |1665|1665| } Executing section cli... Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1117/display/redirect Comment Actions
Well that is certainly not going to work straight away, since there are languages in the world that have more than 2 plural forms. So firstly need some way to have plural translatable template tags (afaik we only have singular now)
Comment Actions We could add two template entries: ProjectileNameSingular and ProjectileNamePlural, but that wouldn't solve the "more than 2 plural forms".
|