load commands from elements (for using Lua to generate the command name)
This commit is contained in:
+23
-1
@@ -192,7 +192,7 @@ void Actor::LoadFromNode( const CString& sDir, const XNode* pNode )
|
||||
|
||||
|
||||
//
|
||||
// Load commands
|
||||
// Load command attributes
|
||||
//
|
||||
FOREACH_CONST_Attr( pNode, a )
|
||||
{
|
||||
@@ -214,6 +214,28 @@ void Actor::LoadFromNode( const CString& sDir, const XNode* pNode )
|
||||
AddCommand( sCmdName, apac );
|
||||
}
|
||||
|
||||
//
|
||||
// Load command elements
|
||||
//
|
||||
FOREACH_CONST_Child( pNode, c )
|
||||
{
|
||||
CString sKeyName = c->m_sName; /* "OnCommand" */
|
||||
|
||||
if( sKeyName != "Command" )
|
||||
continue; /* not a command */
|
||||
|
||||
CString sName;
|
||||
c->GetAttrValue( "Name", sName );
|
||||
CString sValue;
|
||||
c->GetAttrValue( "Value", sValue );
|
||||
|
||||
THEME->EvaluateString( sName );
|
||||
THEME->EvaluateString( sValue );
|
||||
apActorCommands apac( new ActorCommands( sValue ) );
|
||||
|
||||
AddCommand( sName, apac );
|
||||
}
|
||||
|
||||
/* There's an InitCommand. Run it now. This can be used to eg. change Z to
|
||||
* modify draw order between BGAs in a Foreground. */
|
||||
PlayCommand( "Init" );
|
||||
|
||||
Reference in New Issue
Block a user