BuildPalette tooltips show build time (+ in red if in low power)

This commit is contained in:
alzeih
2010-06-14 00:18:36 +12:00
parent fbeadb9869
commit 3ac0ca6a65
4 changed files with 32 additions and 16 deletions

View File

@@ -241,5 +241,13 @@ namespace OpenRA
{
return world.WorldActor.Info.Traits.WithInterface<PlayerColorPaletteInfo>().ToList();
}
public static string FormatTime(int ticks)
{
var seconds = ticks / 25;
var minutes = seconds / 60;
return "{0:D2}:{1:D2}".F(minutes, seconds % 60);
}
}
}