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 = setStringTags(text, g_TooltipTextFormats.insufficient); | ||||
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 43 Lines • ▼ Show 20 Lines | if (buildingsCountToTrainFullBatch > 1 || | ||||
buildingsCountToTrainFullBatch == 1 && remainderBatch > 0) | buildingsCountToTrainFullBatch == 1 && remainderBatch > 0) | ||||
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 bodyFont(setStringTags( | ||||
setStringTags( | |||||
sprintf(batchString, { | sprintf(batchString, { | ||||
"action": "[font=\"sans-bold-13\"]" + translate("Shift-click") + "[/font]", | "action": headerFont(translate("Shift-click")), | ||||
"number": totalBatchTrainingCount, | "number": totalBatchTrainingCount, | ||||
"fullBatch": fullBatchesString, | "fullBatch": fullBatchesString, | ||||
"remainderBatch": remainderBatch | "remainderBatch": remainderBatch | ||||
}), | }), | ||||
g_HotkeyTags) + | g_HotkeyTag)); | ||||
"[/font]"; | |||||
} | } | ||||
/** | /** | ||||
* Camera jumping: when the user presses a hotkey the current camera location is marked. | * Camera jumping: when the user presses a hotkey the current camera location is marked. | ||||
* When pressing another camera jump hotkey the camera jumps back to that position. | * When pressing another camera jump hotkey the camera jumps back to that position. | ||||
* When the camera is already roughly at that location, jump back to where it was previously. | * When the camera is already roughly at that location, jump back to where it was previously. | ||||
*/ | */ | ||||
var g_JumpCameraPositions = []; | var g_JumpCameraPositions = []; | ||||
▲ Show 20 Lines • Show All 300 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator