Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/common/tooltips.js
Show First 20 Lines • Show All 372 Lines • ▼ Show 20 Lines | function getAttackTooltip(template) | ||||
let tooltips = []; | let tooltips = []; | ||||
for (let attackType in template.attack) | for (let attackType in template.attack) | ||||
{ | { | ||||
// Slaughter is used to kill animals, so do not show it. | // Slaughter is used to kill animals, so do not show it. | ||||
if (attackType == "Slaughter") | if (attackType == "Slaughter") | ||||
continue; | continue; | ||||
let attackTypeTemplate = template.attack[attackType]; | |||||
let attackLabel = sprintf(headerFont(translate("%(attackType)s")), { | let attackLabel = sprintf(headerFont(translate("%(attackType)s")), { | ||||
"attackType": attackType | "attackType": attackTypeTemplate.attackName.context ? | ||||
translateWithContext(attackTypeTemplate.attackName.context, attackTypeTemplate.attackName.name) : | |||||
translate(attackTypeTemplate.attackName.name) | |||||
}); | }); | ||||
let attackTypeTemplate = template.attack[attackType]; | |||||
let projectiles; | let projectiles; | ||||
// Use either current rate from simulation or default count if the sim is not running. | // Use either current rate from simulation or default count if the sim is not running. | ||||
// TODO: This ought to be extended to include units which fire multiple projectiles. | // TODO: This ought to be extended to include units which fire multiple projectiles. | ||||
if (template.buildingAI) | if (template.buildingAI) | ||||
projectiles = template.buildingAI.arrowCount || template.buildingAI.defaultArrowCount; | projectiles = template.buildingAI.arrowCount || template.buildingAI.defaultArrowCount; | ||||
let splashTemplate = attackTypeTemplate.splash; | let splashTemplate = attackTypeTemplate.splash; | ||||
▲ Show 20 Lines • Show All 623 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator