Allow support powers to override the icon overlay/tooltip labels.

This commit is contained in:
Paul Chote
2018-10-09 19:28:02 +01:00
committed by reaperrr
parent 70b020205d
commit 1fa90c0474
3 changed files with 29 additions and 12 deletions

View File

@@ -59,11 +59,17 @@ namespace OpenRA.Mods.Common.Widgets.Logic
descLabel.Text = sp.Info.LongDesc.Replace("\\n", "\n");
var descSize = descFont.Measure(descLabel.Text);
var remaining = WidgetUtils.FormatTime(sp.RemainingTicks, world.Timestep);
var total = WidgetUtils.FormatTime(sp.Info.ChargeInterval, world.Timestep);
timeLabel.Text = "{0} / {1}".F(remaining, total);
var timeSize = timeFont.Measure(timeLabel.Text);
var customLabel = sp.TooltipTimeTextOverride();
if (customLabel == null)
{
var remaining = WidgetUtils.FormatTime(sp.RemainingTicks, world.Timestep);
var total = WidgetUtils.FormatTime(sp.Info.ChargeInterval, world.Timestep);
timeLabel.Text = "{0} / {1}".F(remaining, total);
}
else
timeLabel.Text = customLabel;
var timeSize = timeFont.Measure(timeLabel.Text);
var hotkeyWidth = 0;
hotkeyLabel.Visible = hotkey.IsValid();
if (hotkeyLabel.Visible)