Rename *Time to *Ticks and increase internal resolution.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user