load commands from elements (for using Lua to generate the command name)

This commit is contained in:
Chris Danford
2005-08-06 05:33:01 +00:00
parent fc05cb7838
commit c20c41e7fc
+23 -1
View File
@@ -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" );