Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/Player.js
Show First 20 Lines • Show All 319 Lines • ▼ Show 20 Lines | if (amountsNeeded) | ||||
} | } | ||||
let msg = ""; | let msg = ""; | ||||
// When marking strings for translations, you need to include the actual string, | // When marking strings for translations, you need to include the actual string, | ||||
// not some way to derive the string. | // not some way to derive the string. | ||||
if (i < 1) | if (i < 1) | ||||
warn("Amounts needed but no amounts given?"); | warn("Amounts needed but no amounts given?"); | ||||
else if (i == 1) | else if (i == 1) | ||||
msg = markForTranslation("Insufficient resources - %(resourceAmount1)s %(resourceType1)s"); | msg = markForTranslation("Requires more resources - %(resourceAmount1)s %(resourceType1)s"); | ||||
else if (i == 2) | else if (i == 2) | ||||
msg = markForTranslation("Insufficient resources - %(resourceAmount1)s %(resourceType1)s, %(resourceAmount2)s %(resourceType2)s"); | msg = markForTranslation("Requires more resources - %(resourceAmount1)s %(resourceType1)s, %(resourceAmount2)s %(resourceType2)s"); | ||||
else if (i == 3) | else if (i == 3) | ||||
msg = markForTranslation("Insufficient resources - %(resourceAmount1)s %(resourceType1)s, %(resourceAmount2)s %(resourceType2)s, %(resourceAmount3)s %(resourceType3)s"); | msg = markForTranslation("Requires more resources - %(resourceAmount1)s %(resourceType1)s, %(resourceAmount2)s %(resourceType2)s, %(resourceAmount3)s %(resourceType3)s"); | ||||
else if (i == 4) | else if (i == 4) | ||||
msg = markForTranslation("Insufficient resources - %(resourceAmount1)s %(resourceType1)s, %(resourceAmount2)s %(resourceType2)s, %(resourceAmount3)s %(resourceType3)s, %(resourceAmount4)s %(resourceType4)s"); | msg = markForTranslation("Requires more resources - %(resourceAmount1)s %(resourceType1)s, %(resourceAmount2)s %(resourceType2)s, %(resourceAmount3)s %(resourceType3)s, %(resourceAmount4)s %(resourceType4)s"); | ||||
else | else | ||||
warn("Localisation: Strings are not localised for more than 4 resources"); | warn("Localisation: Strings are not localised for more than 4 resources"); | ||||
// Send as time-notification. | // Send as time-notification. | ||||
let cmpGUIInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); | let cmpGUIInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); | ||||
cmpGUIInterface.PushNotification({ | cmpGUIInterface.PushNotification({ | ||||
"players": [this.playerID], | "players": [this.playerID], | ||||
"message": msg, | "message": msg, | ||||
▲ Show 20 Lines • Show All 649 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator