Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/common/tooltips.js
Show First 20 Lines • Show All 614 Lines • ▼ Show 20 Lines | if (costs) | ||||
"label": headerFont(translate("Cost:")), | "label": headerFont(translate("Cost:")), | ||||
"costs": costs | "costs": costs | ||||
}); | }); | ||||
} | } | ||||
return ""; | return ""; | ||||
} | } | ||||
function getRequiredTechnologyTooltip(technologyEnabled, requiredTechnology, civ) | function getRequiredTechnologyTooltip(technologyEnabled, requiredTechnologies, civ) | ||||
{ | { | ||||
if (technologyEnabled) | if (technologyEnabled) | ||||
return ""; | return ""; | ||||
return sprintf(translate("Requires %(technology)s"), { | let mTechNames = requiredTechnologies.map(tech => getEntityNames(GetTechnologyData(tech, civ))); | ||||
"technology": getEntityNames(GetTechnologyData(requiredTechnology, civ)) | // Translation: This comma is used for separating first to penultimate elements in an enumeration | ||||
return sprintf(translate("Requires %(technologies)s"), { | |||||
"technologies": mTechNames.join(translate(", ")) | |||||
}); | }); | ||||
} | } | ||||
/** | /** | ||||
* Returns the population bonus information to display in the specified entity's construction button tooltip. | * Returns the population bonus information to display in the specified entity's construction button tooltip. | ||||
*/ | */ | ||||
function getPopulationBonusTooltip(template) | function getPopulationBonusTooltip(template) | ||||
{ | { | ||||
let popBonus = ""; | let popBonus = ""; | ||||
if (template.cost && template.cost.populationBonus) | if (template.cost && template.cost.populationBonus) | ||||
Freagarach: Shouldn't this comment be one line below? | |||||
popBonus = sprintf(translate("%(label)s %(populationBonus)s"), { | popBonus = sprintf(translate("%(label)s %(populationBonus)s"), { | ||||
"label": headerFont(translate("Population Bonus:")), | "label": headerFont(translate("Population Bonus:")), | ||||
"populationBonus": template.cost.populationBonus | "populationBonus": template.cost.populationBonus | ||||
}); | }); | ||||
return popBonus; | return popBonus; | ||||
} | } | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 189 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Shouldn't this comment be one line below?