Fix Utils.FormatTime not working properly on different game speeds
This commit is contained in:
@@ -19,12 +19,8 @@ namespace OpenRA.Mods.Common.Scripting
|
|||||||
[ScriptGlobal("Utils")]
|
[ScriptGlobal("Utils")]
|
||||||
public class UtilsGlobal : ScriptGlobal
|
public class UtilsGlobal : ScriptGlobal
|
||||||
{
|
{
|
||||||
readonly World world;
|
|
||||||
public UtilsGlobal(ScriptContext context)
|
public UtilsGlobal(ScriptContext context)
|
||||||
: base(context)
|
: base(context) { }
|
||||||
{
|
|
||||||
world = context.World;
|
|
||||||
}
|
|
||||||
|
|
||||||
[Desc("Calls a function on every element in a collection.")]
|
[Desc("Calls a function on every element in a collection.")]
|
||||||
public void Do(LuaValue[] collection, LuaFunction func)
|
public void Do(LuaValue[] collection, LuaFunction func)
|
||||||
@@ -106,7 +102,7 @@ namespace OpenRA.Mods.Common.Scripting
|
|||||||
[Desc("Returns the ticks formatted to HH:MM:SS.")]
|
[Desc("Returns the ticks formatted to HH:MM:SS.")]
|
||||||
public string FormatTime(int ticks, bool leadingMinuteZero = true)
|
public string FormatTime(int ticks, bool leadingMinuteZero = true)
|
||||||
{
|
{
|
||||||
return WidgetUtils.FormatTime(ticks, leadingMinuteZero, world.Timestep);
|
return WidgetUtils.FormatTime(ticks, leadingMinuteZero, 40);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user