Add AddCommand and THEME:GetMetricA.
This won't work with theme reloading, but that hasn't worked in a long time anyway (recreating the Lua environment while it's actually in use is hard).
This commit is contained in:
@@ -1394,6 +1394,13 @@ public:
|
||||
static int playcommand( T* p, lua_State *L ) { p->PlayCommand(SArg(1),NULL); return 0; }
|
||||
static int queuecommand( T* p, lua_State *L ) { p->QueueCommand(SArg(1)); return 0; }
|
||||
static int queuemessage( T* p, lua_State *L ) { p->QueueMessage(SArg(1)); return 0; }
|
||||
static int addcommand( T* p, lua_State *L )
|
||||
{
|
||||
LuaReference *pRef = new LuaReference;
|
||||
pRef->SetFromStack( L );
|
||||
p->AddCommand( SArg(1), apActorCommands(pRef) );
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int GetX( T* p, lua_State *L ) { lua_pushnumber( L, p->GetX() ); return 1; }
|
||||
static int GetY( T* p, lua_State *L ) { lua_pushnumber( L, p->GetY() ); return 1; }
|
||||
@@ -1524,6 +1531,7 @@ public:
|
||||
ADD_METHOD( playcommand );
|
||||
ADD_METHOD( queuecommand );
|
||||
ADD_METHOD( queuemessage );
|
||||
ADD_METHOD( addcommand );
|
||||
|
||||
ADD_METHOD( GetX );
|
||||
ADD_METHOD( GetY );
|
||||
|
||||
@@ -18,7 +18,7 @@ private:
|
||||
CString m_sLuaFunction;
|
||||
};
|
||||
|
||||
typedef AutoPtrCopyOnWrite<ActorCommands> apActorCommands;
|
||||
typedef AutoPtrCopyOnWrite<LuaReference> apActorCommands;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -299,10 +299,12 @@ public:
|
||||
LunaNoteSkinManager() { LUA->Register( Register ); }
|
||||
|
||||
static int GetPath( T* p, lua_State *L ) { lua_pushstring(L, p->GetPath(SArg(1),SArg(2)) ); return 1; }
|
||||
static int GetMetricA( T* p, lua_State *L ) { p->GetMetricA(SArg(1),SArg(2))->PushSelf(L); return 1; }
|
||||
|
||||
static void Register(lua_State *L)
|
||||
{
|
||||
ADD_METHOD( GetPath );
|
||||
ADD_METHOD( GetMetricA );
|
||||
|
||||
Luna<T>::Register( L );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user