Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/common/tooltips.js
Show First 20 Lines • Show All 173 Lines • ▼ Show 20 Lines | function getCurrentHealthTooltip(entState, label) | ||||
return sprintf(translate("%(healthLabel)s %(current)s / %(max)s"), { | return sprintf(translate("%(healthLabel)s %(current)s / %(max)s"), { | ||||
"healthLabel": headerFont(label || translate("Health:")), | "healthLabel": headerFont(label || translate("Health:")), | ||||
"current": Math.round(entState.hitpoints), | "current": Math.round(entState.hitpoints), | ||||
"max": Math.round(entState.maxHitpoints) | "max": Math.round(entState.maxHitpoints) | ||||
}); | }); | ||||
} | } | ||||
function getCurrentCaptureTooltip(entState, label) | |||||
{ | |||||
if (!entState.maxCapturePoints) | |||||
return ""; | |||||
return sprintf(translate("%(captureLabel)s %(current)s / %(max)s"), { | |||||
"captureLabel": headerFont(label || translate("Capture points:")), | |||||
"current": Math.round(entState.capturePoints[entState.player]), | |||||
"max": Math.round(entState.maxCapturePoints) | |||||
}); | |||||
} | |||||
function attackRateDetails(template, type) | function attackRateDetails(template, type) | ||||
{ | { | ||||
// Either one arrow shot by UnitAI, | // Either one arrow shot by UnitAI, | ||||
let timeString = getSecondsString(template.attack[type].repeatTime / 1000); | let timeString = getSecondsString(template.attack[type].repeatTime / 1000); | ||||
// or multiple arrows shot by BuildingAI | // or multiple arrows shot by BuildingAI | ||||
if (!template.buildingAI || type != "Ranged") | if (!template.buildingAI || type != "Ranged") | ||||
return timeString; | return timeString; | ||||
▲ Show 20 Lines • Show All 646 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator