diff --git a/stepmania/src/ActorFrame.cpp b/stepmania/src/ActorFrame.cpp index 45b2939243..f67d2b987d 100644 --- a/stepmania/src/ActorFrame.cpp +++ b/stepmania/src/ActorFrame.cpp @@ -233,6 +233,13 @@ void ActorFrame::PlayCommandOnChildren( const RString &sCommandName ) RunCommandsOnChildren( *pCmd ); } +void ActorFrame::PlayCommandOnLeaves( const RString &sCommandName ) +{ + const apActorCommands *pCmd = GetCommand( sCommandName ); + if( pCmd != NULL ) + RunCommandsOnLeaves( **pCmd ); +} + void ActorFrame::RunCommandsOnChildren( const LuaReference& cmds ) { for( unsigned i=0; iRegister( Register ); } static int playcommandonchildren( T* p, lua_State *L ) { p->PlayCommandOnChildren(SArg(1)); return 0; } + static int playcommandonleaves( T* p, lua_State *L ) { p->PlayCommandOnLeaves(SArg(1)); return 0; } static int propagate( T* p, lua_State *L ) { p->SetPropagateCommands( !!IArg(1) ); return 0; } static int fov( T* p, lua_State *L ) { p->SetFOV( FArg(1) ); return 0; } static int SetUpdateRate( T* p, lua_State *L ) { p->SetUpdateRate( FArg(1) ); return 0; } @@ -398,6 +406,7 @@ public: static void Register(lua_State *L) { ADD_METHOD( playcommandonchildren ); + ADD_METHOD( playcommandonleaves ); ADD_METHOD( propagate ); // deprecated ADD_METHOD( fov ); ADD_METHOD( SetUpdateRate ); diff --git a/stepmania/src/ActorFrame.h b/stepmania/src/ActorFrame.h index 012a0e2f90..339da78c77 100644 --- a/stepmania/src/ActorFrame.h +++ b/stepmania/src/ActorFrame.h @@ -35,9 +35,10 @@ public: // virtual void PushSelf( lua_State *L ); void PlayCommandOnChildren( const RString &sCommandName ); + void PlayCommandOnLeaves( const RString &sCommandName ); virtual void RunCommandsOnChildren( const LuaReference& cmds ); /* but not on self */ void RunCommandsOnChildren( const apActorCommands& cmds ) { this->RunCommandsOnChildren( *cmds ); } // convenience - virtual void RunCommandsOnLeaves( const LuaReference& cmds, Actor* pParent ); /* but not on self */ + virtual void RunCommandsOnLeaves( const LuaReference& cmds, Actor* pParent=NULL ); /* but not on self */ virtual void UpdateInternal( float fDeltaTime ); virtual void ProcessMessages( float fDeltaTime );