Rename *Time to *Ticks and increase internal resolution.

This commit is contained in:
Paul Chote
2018-10-07 15:03:19 +00:00
committed by reaperrr
parent e03abdc0da
commit 70b020205d
6 changed files with 26 additions and 23 deletions

View File

@@ -47,7 +47,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
// HACK: This abuses knowledge of the internals of WidgetUtils.FormatTime
// to efficiently work when the label is going to change, requiring a panel relayout
var remainingSeconds = (int)Math.Ceiling(sp.RemainingTime * world.Timestep / 1000f);
var remainingSeconds = (int)Math.Ceiling(sp.RemainingTicks * world.Timestep / 1000f);
var hotkey = icon.Hotkey != null ? icon.Hotkey.GetValue() : Hotkey.Invalid;
if (sp == lastPower && hotkey == lastHotkey && lastRemainingSeconds == remainingSeconds)
@@ -59,7 +59,7 @@ 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.RemainingTime, world.Timestep);
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);