Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/common/tooltips.js
Show First 20 Lines • Show All 148 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) | |||||
}); | |||||
} | |||||
/** | /** | ||||
* Converts an resistance level into the actual reduction percentage. | * Converts an resistance level into the actual reduction percentage. | ||||
*/ | */ | ||||
function resistanceLevelToPercentageString(level) | function resistanceLevelToPercentageString(level) | ||||
{ | { | ||||
return sprintf(translate("%(percentage)s%%"), { | return sprintf(translate("%(percentage)s%%"), { | ||||
"percentage": (100 - Math.round(Math.pow(0.9, level) * 100)) | "percentage": (100 - Math.round(Math.pow(0.9, level) * 100)) | ||||
}); | }); | ||||
▲ Show 20 Lines • Show All 841 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator