mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
Show the garrisoned healrate in tooltips, revealing not necessarily intuitive rates for special buildings and ships.
This was SVN commit r18529.
This commit is contained in:
parent
d0639c4df6
commit
2feeda802d
3 changed files with 23 additions and 5 deletions
|
|
@ -229,7 +229,10 @@ function GetTemplateDataHelper(template, player, auraTemplates)
|
|||
|
||||
if (template.GarrisonHolder)
|
||||
{
|
||||
ret.garrisonHolder = {};
|
||||
ret.garrisonHolder = {
|
||||
"buffHeal": getEntityValue("GarrisonHolder/BuffHeal")
|
||||
};
|
||||
|
||||
if (template.GarrisonHolder.Max)
|
||||
ret.garrisonHolder.max = getEntityValue("GarrisonHolder/Max");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -226,10 +226,24 @@ function getGarrisonTooltip(template)
|
|||
if (!template.garrisonHolder)
|
||||
return "";
|
||||
|
||||
return sprintf(translate("%(label)s: %(garrisonLimit)s"), {
|
||||
"label": headerFont(translate("Garrison Limit")),
|
||||
"garrisonLimit": template.garrisonHolder.capacity || template.garrisonHolder.max
|
||||
});
|
||||
let tooltips = [
|
||||
sprintf(translate("%(label)s: %(garrisonLimit)s"), {
|
||||
"label": headerFont(translate("Garrison Limit")),
|
||||
"garrisonLimit": template.garrisonHolder.capacity || template.garrisonHolder.max
|
||||
})
|
||||
];
|
||||
|
||||
if (template.garrisonHolder.buffHeal)
|
||||
tooltips.push(
|
||||
sprintf(translate("%(healRateLabel)s %(value)s %(health)s / %(second)s"), {
|
||||
"healRateLabel": headerFont(translate("Heal:")),
|
||||
"value": Math.round(template.garrisonHolder.buffHeal),
|
||||
"health": unitFont(translate("health")),
|
||||
"second": unitFont(translate("second")),
|
||||
})
|
||||
);
|
||||
|
||||
return tooltips.join(commaFont(translate(", ")));
|
||||
}
|
||||
|
||||
function getProjectilesTooltip(template)
|
||||
|
|
|
|||
|
|
@ -356,6 +356,7 @@ GuiInterface.prototype.GetEntityState = function(player, ent)
|
|||
if (cmpGarrisonHolder)
|
||||
ret.garrisonHolder = {
|
||||
"entities": cmpGarrisonHolder.GetEntities(),
|
||||
"buffHeal": cmpGarrisonHolder.GetHealRate(),
|
||||
"allowedClasses": cmpGarrisonHolder.GetAllowedClasses(),
|
||||
"capacity": cmpGarrisonHolder.GetCapacity(),
|
||||
"garrisonedEntitiesCount": cmpGarrisonHolder.GetGarrisonedEntitiesCount()
|
||||
|
|
|
|||
Loading…
Reference in a new issue