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

@@ -19,7 +19,12 @@ namespace OpenRA.Mods.Common.Scripting
[ScriptGlobal("Utils")]
public class UtilsGlobal : ScriptGlobal
{
public UtilsGlobal(ScriptContext context) : base(context) { }
readonly World world;
public UtilsGlobal(ScriptContext context)
: base(context)
{
world = context.World;
}
[Desc("Calls a function on every element in a collection.")]
public void Do(LuaValue[] collection, LuaFunction func)
@@ -101,7 +106,7 @@ namespace OpenRA.Mods.Common.Scripting
[Desc("Returns the ticks formatted to HH:MM:SS.")]
public string FormatTime(int ticks, bool leadingMinuteZero = true)
{
return WidgetUtils.FormatTime(ticks, leadingMinuteZero);
return WidgetUtils.FormatTime(ticks, leadingMinuteZero, world.Timestep);
}
}
}