Add a time function.
This commit is contained in:
@@ -654,6 +654,14 @@ LuaDefine(tangible_start, "tangible,function,arg1,arg2...",
|
||||
return LS.result();
|
||||
}
|
||||
|
||||
LuaDefine(time, "",
|
||||
"|Get the elapsed time in ticks since the world started running.") {
|
||||
World *w = World::fetch_global_pointer(L);
|
||||
LuaRet time;
|
||||
LuaDefStack LS(L, time);
|
||||
LS.set(time, w->clock_);
|
||||
return LS.result();
|
||||
}
|
||||
|
||||
LuaDefine(wait, "nticks",
|
||||
"|Wait the specified number of ticks.") {
|
||||
@@ -873,7 +881,7 @@ LuaDefine(pprintx, "options",
|
||||
"| value - the object to pretty-print"
|
||||
"| indent - if false, suppress newlines and indentation (default: true)"
|
||||
"| level - base level of indentation (default: zero)"
|
||||
"| expand - if true, force expansion of top-level table (default: false)"
|
||||
"| expand - if true, force expansion of top-level table (default: true)"
|
||||
"|"
|
||||
"|About the expand flag: normally, when you print a class, it just "
|
||||
"|prints '<class name>', and when you print a tangible, it just"
|
||||
|
||||
Reference in New Issue
Block a user