More Lua API enhancements
This commit is contained in:
@@ -17,7 +17,8 @@ namespace OpenRA.Mods.RA.Scripting
|
||||
[ScriptGlobal("Date")]
|
||||
public class DateGlobal : ScriptGlobal
|
||||
{
|
||||
public DateGlobal(ScriptContext context) : base(context) { }
|
||||
public DateGlobal(ScriptContext context)
|
||||
: base(context) { }
|
||||
|
||||
[Desc("True on the 31st of October.")]
|
||||
public bool IsHalloween
|
||||
@@ -25,4 +26,17 @@ namespace OpenRA.Mods.RA.Scripting
|
||||
get { return DateTime.Today.Month == 10 && DateTime.Today.Day == 31; }
|
||||
}
|
||||
}
|
||||
|
||||
[ScriptGlobal("Time")]
|
||||
public class TimeGlobal : ScriptGlobal
|
||||
{
|
||||
public TimeGlobal(ScriptContext context)
|
||||
: base(context) { }
|
||||
|
||||
[Desc("Get the current game time (in ticks)")]
|
||||
public int GameTime
|
||||
{
|
||||
get { return context.World.WorldTick; }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user