Update UI timers for variable game speed.

This commit is contained in:
Paul Chote
2015-09-03 22:23:37 +01:00
parent 301b698c81
commit 1109ec53d1
12 changed files with 47 additions and 37 deletions

View File

@@ -92,18 +92,18 @@ namespace OpenRA.Mods.Common.Widgets
WidgetUtils.DrawSHPCentered(clock.Image, location + 0.5f * iconSize, worldRenderer.Palette(bi.IconPalette), 0.5f);
var tiny = Game.Renderer.Fonts["Tiny"];
var text = GetOverlayForItem(current);
var text = GetOverlayForItem(current, world.Timestep);
tiny.DrawTextWithContrast(text,
location + new float2(16, 16) - new float2(tiny.Measure(text).X / 2, 0),
Color.White, Color.Black, 1);
}
}
static string GetOverlayForItem(ProductionItem item)
static string GetOverlayForItem(ProductionItem item, int timestep)
{
if (item.Paused) return "ON HOLD";
if (item.Done) return "READY";
return WidgetUtils.FormatTime(item.RemainingTimeActual);
return WidgetUtils.FormatTime(item.RemainingTimeActual, timestep);
}
public override Widget Clone()