Tidy more uses of BottomRight/TopLeft, bogus location of FormatTime.
This commit is contained in:
@@ -25,7 +25,7 @@ namespace OpenRA.Widgets
|
||||
|
||||
public override void DrawInner( WorldRenderer wr )
|
||||
{
|
||||
var s = WorldUtils.FormatTime(Game.LocalTick);
|
||||
var s = WidgetUtils.FormatTime(Game.LocalTick);
|
||||
var size = Game.Renderer.TitleFont.Measure(s);
|
||||
Game.Renderer.TitleFont.DrawText(s, new float2(RenderBounds.Left - size.X / 2, RenderBounds.Top - 20), Color.White);
|
||||
}
|
||||
|
||||
@@ -128,6 +128,18 @@ namespace OpenRA.Widgets
|
||||
if (ps.HasFlags(PanelSides.Right | PanelSides.Bottom))
|
||||
DrawRGBA(ss[7], new float2(Bounds.Right - ss[7].size.X, Bounds.Bottom - ss[7].size.Y));
|
||||
}
|
||||
|
||||
|
||||
public static string FormatTime(int ticks)
|
||||
{
|
||||
var seconds = ticks / 25;
|
||||
var minutes = seconds / 60;
|
||||
|
||||
if (minutes >= 60)
|
||||
return "{0:D}:{1:D2}:{2:D2}".F(minutes / 60, minutes % 60, seconds % 60);
|
||||
else
|
||||
return "{0:D2}:{1:D2}".F(minutes, seconds % 60);
|
||||
}
|
||||
}
|
||||
|
||||
[Flags]
|
||||
|
||||
Reference in New Issue
Block a user