play InitCommand for all Actors at load time
This commit is contained in:
@@ -113,6 +113,10 @@ void Actor::LoadFromNode( const CString& sDir, const XNode* pNode )
|
|||||||
sCmdName = sKeyName.Left( sKeyName.size()-7 );
|
sCmdName = sKeyName.Left( sKeyName.size()-7 );
|
||||||
AddCommand( sCmdName, apac );
|
AddCommand( sCmdName, 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" );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Actor::Draw()
|
void Actor::Draw()
|
||||||
|
|||||||
@@ -179,15 +179,6 @@ void BGAnimation::LoadFromNode( const CString& sDir, const XNode* pNode )
|
|||||||
{
|
{
|
||||||
DEBUG_ASSERT( pNode->m_sName == "BGAnimation" );
|
DEBUG_ASSERT( pNode->m_sName == "BGAnimation" );
|
||||||
|
|
||||||
CString sInitCommand;
|
|
||||||
if( pNode->GetAttrValue( "InitCommand", sInitCommand ) )
|
|
||||||
{
|
|
||||||
/* There's an InitCommand. Run it now. This can be used to eg. change Z to
|
|
||||||
* modify draw order between BGAs in a Foreground. Most things should be done
|
|
||||||
* in metrics.ini commands, not here. */
|
|
||||||
this->RunCommands( ActorCommands(ParseCommands(sInitCommand)) );
|
|
||||||
}
|
|
||||||
|
|
||||||
ActorScroller::LoadFromNode( sDir, pNode );
|
ActorScroller::LoadFromNode( sDir, pNode );
|
||||||
|
|
||||||
this->RunCommandsOnChildren( ActorCommands(ParseCommands("PlayCommand,Init")) );
|
this->RunCommandsOnChildren( ActorCommands(ParseCommands("PlayCommand,Init")) );
|
||||||
|
|||||||
@@ -107,7 +107,6 @@ ScreenSelectMaster::ScreenSelectMaster( CString sClassName ) : ScreenSelect( sCl
|
|||||||
|
|
||||||
m_sprScroll[c][0].Load( THEME->GetPathG(m_sName,ssprintf("Scroll Choice%s",mc.m_sName.c_str())) );
|
m_sprScroll[c][0].Load( THEME->GetPathG(m_sName,ssprintf("Scroll Choice%s",mc.m_sName.c_str())) );
|
||||||
m_sprScroll[c][0]->SetName( ssprintf("Scroll") );
|
m_sprScroll[c][0]->SetName( ssprintf("Scroll") );
|
||||||
m_sprScroll[c][0]->PlayCommand( "Init" );
|
|
||||||
m_Scroller[0].AddChild( m_sprScroll[c][0] );
|
m_Scroller[0].AddChild( m_sprScroll[c][0] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -131,7 +130,6 @@ ScreenSelectMaster::ScreenSelectMaster( CString sClassName ) : ScreenSelect( sCl
|
|||||||
|
|
||||||
m_sprScroll[c][p].Load( THEME->GetPathG(m_sName,ssprintf("Scroll Choice%s P%d",mc.m_sName.c_str(),p+1)) );
|
m_sprScroll[c][p].Load( THEME->GetPathG(m_sName,ssprintf("Scroll Choice%s P%d",mc.m_sName.c_str(),p+1)) );
|
||||||
m_sprScroll[c][p]->SetName( ssprintf("ScrollP%d",p+1) );
|
m_sprScroll[c][p]->SetName( ssprintf("ScrollP%d",p+1) );
|
||||||
m_sprScroll[c][p]->PlayCommand( "Init" );
|
|
||||||
m_Scroller[p].AddChild( m_sprScroll[c][p] );
|
m_Scroller[p].AddChild( m_sprScroll[c][p] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user