Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/common/tooltips.js
Show First 20 Lines • Show All 360 Lines • ▼ Show 20 Lines | return sprintf(translate("%(repairRateLabel)s %(value)s %(health)s / %(second)s / %(worker)s"), { | ||||
"repairRateLabel": headerFont(translate("Repair Rate:")), | "repairRateLabel": headerFont(translate("Repair Rate:")), | ||||
"value": template.repairRate.toFixed(1), | "value": template.repairRate.toFixed(1), | ||||
"health": unitFont(translate("Health")), | "health": unitFont(translate("Health")), | ||||
"second": unitFont(translate("second")), | "second": unitFont(translate("second")), | ||||
"worker": unitFont(translate("Worker")) | "worker": unitFont(translate("Worker")) | ||||
}); | }); | ||||
} | } | ||||
function getBuildRateTooltip(template) | function getBuildTimeTooltip(entState) | ||||
{ | { | ||||
if (!template.buildRate) | if (!entState.foundation.numBuilders) | ||||
return ""; | return sprintf(translatePlural( | ||||
"Add a worker to finish the construction in %(second)s second.", | |||||
"Add a worker to finish the construction in %(second)s seconds.", | |||||
Math.round(entState.foundation.buildTime.timeRemainingNew)), | |||||
{ | |||||
"second": Math.round(entState.foundation.buildTime.timeRemainingNew) | |||||
}); | |||||
return sprintf(translate("%(buildRateLabel)s %(value)s %(health)s / %(second)s / %(worker)s"), { | return sprintf(translate("%(label)s %(details)s"), { | ||||
"buildRateLabel": headerFont(translate("Build Rate:")), | "label": headerFont(translate("Number of builders:")), | ||||
"value": template.buildRate.toFixed(1), | "details": entState.foundation.numBuilders | ||||
"health": unitFont(translate("Health")), | }) + "\n" + | ||||
"second": unitFont(translate("second")), | sprintf(translatePlural( | ||||
"worker": unitFont(translate("Worker")) | "Add another worker to speed up the construction by %(second)s second.", | ||||
"Add another worker to speed up the construction by %(second)s seconds.", | |||||
Math.round(entState.foundation.buildTime.timeRemaining - entState.foundation.buildTime.timeRemainingNew)), | |||||
{ | |||||
"second": Math.round(entState.foundation.buildTime.timeRemaining - entState.foundation.buildTime.timeRemainingNew) | |||||
}); | }); | ||||
} | } | ||||
/** | /** | ||||
* Multiplies the costs for a template by a given batch size. | * Multiplies the costs for a template by a given batch size. | ||||
*/ | */ | ||||
function multiplyEntityCosts(template, trainNum) | function multiplyEntityCosts(template, trainNum) | ||||
{ | { | ||||
let totalCosts = {}; | let totalCosts = {}; | ||||
▲ Show 20 Lines • Show All 374 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator