Add ProductionCost/TimeMultiplier

This commit is contained in:
Mustafa Alperen Seki
2018-11-21 21:33:46 +03:00
committed by reaperrr
parent 1f730fbfb9
commit de7706c98f
6 changed files with 132 additions and 18 deletions

View File

@@ -70,8 +70,16 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var tooltip = actor.TraitInfos<TooltipInfo>().FirstOrDefault(info => info.EnabledByDefault);
var name = tooltip != null ? tooltip.Name : actor.Name;
var buildable = actor.TraitInfo<BuildableInfo>();
var valued = actor.TraitInfoOrDefault<ValuedInfo>();
var cost = valued != null ? valued.Cost : 0;
var cost = 0;
if (tooltipIcon.ProductionQueue != null)
cost = tooltipIcon.ProductionQueue.GetProductionCost(actor);
else
{
var valued = actor.TraitInfoOrDefault<ValuedInfo>();
if (valued != null)
cost = valued.Cost;
}
nameLabel.Text = name;