Merge pull request #8174 from abcdefg30/formattime
Added a FormatTime function to UtilsGlobal.cs
This commit is contained in:
@@ -12,6 +12,7 @@ using System.Linq;
|
|||||||
using Eluant;
|
using Eluant;
|
||||||
using OpenRA.Scripting;
|
using OpenRA.Scripting;
|
||||||
using OpenRA.Traits;
|
using OpenRA.Traits;
|
||||||
|
using OpenRA.Widgets;
|
||||||
|
|
||||||
namespace OpenRA.Mods.Common.Scripting
|
namespace OpenRA.Mods.Common.Scripting
|
||||||
{
|
{
|
||||||
@@ -96,5 +97,11 @@ namespace OpenRA.Mods.Common.Scripting
|
|||||||
|
|
||||||
return Context.World.SharedRandom.Next(low, high);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
Container@SKIRMISH_STATS:
|
Container@SKIRMISH_STATS:
|
||||||
Height: PARENT_BOTTOM
|
Height: PARENT_BOTTOM
|
||||||
Width: PARENT_RIGHT
|
Width: PARENT_RIGHT
|
||||||
Logic: GameInfoStatsLogic
|
Logic: GameInfoStatsLogic
|
||||||
Children:
|
Children:
|
||||||
|
|||||||
Reference in New Issue
Block a user