Always call LoadAllCommands explicitly.

The hack to LoadAllCommands when playing a command was leading to weird interactions: If a theme element contained an OnCommand, it would cause the rest of the commands defined in metrics to not be loaded.
This commit is contained in:
Chris Danford
2007-02-19 09:30:07 +00:00
parent d72ebfa33e
commit 599db61b62
42 changed files with 236 additions and 236 deletions
+5 -5
View File
@@ -44,14 +44,14 @@ void ScreenNetSelectBase::Init()
m_sprChatInputBox.Load( THEME->GetPathG( m_sName, "ChatInputBox" ) );
m_sprChatInputBox.SetWidth( CHATINPUT_WIDTH );
m_sprChatInputBox.SetHeight( CHATINPUT_HEIGHT );
SET_XY_AND_ON_COMMAND( m_sprChatInputBox );
LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_sprChatInputBox );
this->AddChild( &m_sprChatInputBox );
m_sprChatOutputBox.SetName( "ChatOutputBox" );
m_sprChatOutputBox.Load( THEME->GetPathG( m_sName, "ChatOutputBox" ) );
m_sprChatOutputBox.SetWidth( CHATOUTPUT_WIDTH );
m_sprChatOutputBox.SetHeight( CHATOUTPUT_HEIGHT );
SET_XY_AND_ON_COMMAND( m_sprChatOutputBox );
LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_sprChatOutputBox );
this->AddChild( &m_sprChatOutputBox );
m_textChatInput.LoadFromFont( THEME->GetPathF(m_sName,"chat") );
@@ -60,7 +60,7 @@ void ScreenNetSelectBase::Init()
m_textChatInput.SetShadowLength( 0 );
m_textChatInput.SetName( "ChatInput" );
m_textChatInput.SetWrapWidthPixels( (int)(CHAT_TEXT_INPUT_WIDTH) );
SET_XY_AND_ON_COMMAND( m_textChatInput );
LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textChatInput );
this->AddChild( &m_textChatInput );
m_textChatOutput.LoadFromFont( THEME->GetPathF(m_sName,"chat") );
@@ -69,7 +69,7 @@ void ScreenNetSelectBase::Init()
m_textChatOutput.SetVertAlign( align_bottom );
m_textChatOutput.SetShadowLength( 0 );
m_textChatOutput.SetName( "ChatOutput" );
SET_XY_AND_ON_COMMAND( m_textChatOutput );
LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textChatOutput );
this->AddChild( &m_textChatOutput );
m_textChatOutput.SetText( NSMAN->m_sChatText );
@@ -217,7 +217,7 @@ void ScreenNetSelectBase::UpdateUsers()
void UtilSetQuadInit( Actor& actor, const RString &sClassName )
{
ActorUtil::SetXYAndOnCommand( actor, sClassName );
ActorUtil::LoadAllCommandsAndSetXYAndOnCommand( actor, sClassName );
actor.RunCommands( THEME->GetMetricA( sClassName, actor.GetName() + "Command" ) );
actor.SetWidth( THEME->GetMetricF( sClassName, actor.GetName() + "Width" ) );
actor.SetHeight( THEME->GetMetricF( sClassName, actor.GetName() + "Height" ) );