Differential D4899 Diff 21453 ps/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js
Show First 20 Lines • Show All 92 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 = objectionFont(text); | ||||
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 61 Lines • ▼ Show 20 Lines | else | ||||
else if (matchEntLimit == 1) | else if (matchEntLimit == 1) | ||||
text = translate("Can be created only once."); | text = translate("Can be created only once."); | ||||
else | else | ||||
text = sprintf(translatePlural("Can be created %(count)s more time.", "Can be created %(count)s more times.", count), { | text = sprintf(translatePlural("Can be created %(count)s more time.", "Can be created %(count)s more times.", count), { | ||||
"count": count | "count": count | ||||
}); | }); | ||||
} | } | ||||
return passedLimit ? coloredText(text, "red") : text; | return passedLimit ? objectionFont(text) : text; | ||||
} | } | ||||
/** | /** | ||||
* Format batch training string for the tooltip | * Format batch training string for the tooltip | ||||
* Examples: | * Examples: | ||||
* buildingsCountToTrainFullBatch = 1, fullBatchSize = 5, remainderBatch = 0: | * buildingsCountToTrainFullBatch = 1, fullBatchSize = 5, remainderBatch = 0: | ||||
* "Shift-click to train 5" | * "Shift-click to train 5" | ||||
* buildingsCountToTrainFullBatch = 2, fullBatchSize = 5, remainderBatch = 0: | * buildingsCountToTrainFullBatch = 2, fullBatchSize = 5, remainderBatch = 0: | ||||
▲ Show 20 Lines • Show All 392 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator