Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/selection_panels_helpers.js
Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | if (trainEntLimit == undefined) | ||||
return ""; | return ""; | ||||
var text = sprintf(translate("Current Count: %(count)s, Limit: %(limit)s."), { | var text = sprintf(translate("Current Count: %(count)s, Limit: %(limit)s."), { | ||||
"count": trainEntCount, | "count": trainEntCount, | ||||
"limit": trainEntLimit | "limit": trainEntLimit | ||||
}); | }); | ||||
if (trainEntCount >= trainEntLimit) | if (trainEntCount >= trainEntLimit) | ||||
text = coloredText(text, "red"); | text = setColor(text, "red"); | ||||
for (var c in trainEntLimitChangers) | for (var c in trainEntLimitChangers) | ||||
{ | { | ||||
if (!trainEntLimitChangers[c]) | if (!trainEntLimitChangers[c]) | ||||
continue; | continue; | ||||
let string = trainEntLimitChangers[c] > 0 ? | let string = trainEntLimitChangers[c] > 0 ? | ||||
translate("%(changer)s enlarges the limit with %(change)s.") : | translate("%(changer)s enlarges the limit with %(change)s.") : | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | if (buildingsCountToTrainFullBatch > 1 || | ||||
if (remainderBatch > 0) | if (remainderBatch > 0) | ||||
batchString = translate("%(action)s to train %(number)s (%(fullBatch)s + %(remainderBatch)s)."); | batchString = translate("%(action)s to train %(number)s (%(fullBatch)s + %(remainderBatch)s)."); | ||||
else | else | ||||
batchString = translate("%(action)s to train %(number)s (%(fullBatch)s)."); | batchString = translate("%(action)s to train %(number)s (%(fullBatch)s)."); | ||||
else | else | ||||
batchString = translate("%(action)s to train %(number)s."); | batchString = translate("%(action)s to train %(number)s."); | ||||
return "[font=\"sans-13\"]" + | return "[font=\"sans-13\"]" + | ||||
coloredText( | setColor( | ||||
sprintf(batchString, { | sprintf(batchString, { | ||||
"action": "[font=\"sans-bold-13\"]" + translate("Shift-click") + "[/font]", | "action": "[font=\"sans-bold-13\"]" + translate("Shift-click") + "[/font]", | ||||
"number": totalBatchTrainingCount, | "number": totalBatchTrainingCount, | ||||
"fullBatch": fullBatchesString, | "fullBatch": fullBatchesString, | ||||
"remainderBatch": remainderBatch | "remainderBatch": remainderBatch | ||||
}), | }), | ||||
g_HotkeyColor) + | g_HotkeyColor) + | ||||
"[/font]"; | "[/font]"; | ||||
▲ Show 20 Lines • Show All 321 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator