Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/common/gamedescription.js
Show First 20 Lines • Show All 333 Lines • ▼ Show 20 Lines | function getGameDescription(mapCache) | ||||
if (g_GameAttributes.settings.TriggerDifficulty !== undefined) | if (g_GameAttributes.settings.TriggerDifficulty !== undefined) | ||||
{ | { | ||||
let triggerDifficulty = g_Settings.TriggerDifficulties.find(difficulty => difficulty.Difficulty == g_GameAttributes.settings.TriggerDifficulty); | let triggerDifficulty = g_Settings.TriggerDifficulties.find(difficulty => difficulty.Difficulty == g_GameAttributes.settings.TriggerDifficulty); | ||||
titles.push({ | titles.push({ | ||||
"label": triggerDifficulty.Title, | "label": triggerDifficulty.Title, | ||||
"value": triggerDifficulty.Tooltip | "value": triggerDifficulty.Tooltip | ||||
}); | }); | ||||
} | } | ||||
if (g_GameAttributes.settings.Nomad !== undefined) | if (g_GameAttributes.settings.Nomad !== undefined) | ||||
titles.push({ | titles.push({ | ||||
"label": g_GameAttributes.settings.Nomad ? translate("Nomad Mode") : translate("Civic Centers"), | "label": g_GameAttributes.settings.Nomad ? translate("Nomad Mode") : translate("Civic Centers"), | ||||
"value": | "value": | ||||
g_GameAttributes.settings.Nomad ? | g_GameAttributes.settings.Nomad ? | ||||
translate("Players start with only few units and have to find a suitable place to build their city.") : | translate("Players start with only few units and have to find a suitable place to build their city.") : | ||||
translate("Players start with a Civic Center.") | translate("Players start with a Civic Center.") | ||||
}); | }); | ||||
if (g_GameAttributes.settings.StartingResources !== undefined) | if (g_GameAttributes.settings.StartingResources !== undefined) | ||||
titles.push({ | titles.push({ | ||||
"label": translate("Starting Resources"), | "label": translate("Starting Resources"), | ||||
"value": | "value": | ||||
g_GameAttributes.settings.PlayerData && | g_GameAttributes.settings.PlayerData && | ||||
g_GameAttributes.settings.PlayerData.some(pData => pData && pData.Resources !== undefined) ? | g_GameAttributes.settings.PlayerData.some(pData => pData && pData.Resources !== undefined) ? | ||||
translateWithContext("starting resources", "Per Player") : | translateWithContext("starting resources", "Per Player") : | ||||
sprintf(translate("%(startingResourcesTitle)s (%(amount)s)"), { | sprintf(translate("%(startingResourcesTitle)s (%(amount)s)"), { | ||||
"startingResourcesTitle": | "startingResourcesTitle": | ||||
g_StartingResources.Title[ | g_StartingResources.Title[ | ||||
g_StartingResources.Resources.indexOf( | g_StartingResources.Resources.indexOf( | ||||
g_GameAttributes.settings.StartingResources)], | g_GameAttributes.settings.StartingResources)], | ||||
"amount": g_GameAttributes.settings.StartingResources | "amount": g_GameAttributes.settings.StartingResources | ||||
}) | }) | ||||
}); | }); | ||||
if (g_GameAttributes.settings.PopulationCap !== undefined) | if (g_GameAttributes.settings.PopulationCap !== undefined) | ||||
titles.push({ | titles.push({ | ||||
"label": translate("Population Limit"), | "label": translate("Population Limit"), | ||||
"value": | "value": | ||||
g_GameAttributes.settings.PlayerData && | g_GameAttributes.settings.PlayerData && | ||||
g_GameAttributes.settings.PlayerData.some(pData => pData && pData.PopulationLimit !== undefined) ? | g_GameAttributes.settings.PlayerData.some(pData => pData && pData.PopulationLimit !== undefined) ? | ||||
translateWithContext("population limit", "Per Player") : | translateWithContext("population limit", "Per Player") : | ||||
g_PopulationCapacities.Title[ | g_PopulationCapacities.Title[ | ||||
g_PopulationCapacities.Population.indexOf( | g_PopulationCapacities.Population.indexOf( | ||||
g_GameAttributes.settings.PopulationCap)] | g_GameAttributes.settings.PopulationCap)] | ||||
}); | }); | ||||
Nescio: These four lines could be deleted; cf. “Last Man Standing / Allied Victory”. | |||||
if (g_GameAttributes.settings.WorldPopulationCap !== undefined) | |||||
Not Done Inline Actionswill that be anytime 0 and we would want to enter the if ? Silier: will that be anytime 0 and we would want to enter the if ? | |||||
Not Done Inline ActionsGood question, I kept to the style used above. Freagarach: Good question, I kept to the style used above. | |||||
titles.push({ | |||||
"label": translate("World Population Cap"), | |||||
Done Inline Actions"World Population Cap" Nescio: "World Population Cap" | |||||
"value": | |||||
g_WorldPopulationCapacities.Title[ | |||||
g_WorldPopulationCapacities.Population.indexOf( | |||||
g_GameAttributes.settings.WorldPopulationCap)] | |||||
}); | |||||
titles.push({ | titles.push({ | ||||
"label": translate("Treasures"), | "label": translate("Treasures"), | ||||
Done Inline Actions"Player Population Cap" Nescio: "Player Population Cap" | |||||
"value": g_GameAttributes.settings.DisableTreasures ? | "value": g_GameAttributes.settings.DisableTreasures ? | ||||
translateWithContext("treasures", "Disabled") : | translateWithContext("treasures", "Disabled") : | ||||
translateWithContext("treasures", "As defined by the map.") | translateWithContext("treasures", "As defined by the map.") | ||||
}); | }); | ||||
titles.push({ | titles.push({ | ||||
"label": translate("Revealed Map"), | "label": translate("Revealed Map"), | ||||
"value": g_GameAttributes.settings.RevealMap | "value": g_GameAttributes.settings.RevealMap | ||||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
These four lines could be deleted; cf. “Last Man Standing / Allied Victory”.