Add a FormatTime function to UtilsGlobal.cs

This commit is contained in:
abcdefg30
2015-05-16 01:30:25 +02:00
parent f65d9ab584
commit 57dbdd097d

View File

@@ -12,6 +12,7 @@ using System.Linq;
using Eluant;
using OpenRA.Scripting;
using OpenRA.Traits;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Scripting
{
@@ -96,5 +97,11 @@ namespace OpenRA.Mods.Common.Scripting
return Context.World.SharedRandom.Next(low, high);
}
[Desc("Returns the ticks formatted to HH:MM:SS.")]
public string FormatTime(int ticks, bool leadingMinuteZero = true)
{
return WidgetUtils.FormatTime(ticks, leadingMinuteZero);
}
}
}