Update UI timers for variable game speed.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user