diff --git a/stepmania/src/ActorUtil.cpp b/stepmania/src/ActorUtil.cpp index a51fef2f77..6531823284 100644 --- a/stepmania/src/ActorUtil.cpp +++ b/stepmania/src/ActorUtil.cpp @@ -436,14 +436,6 @@ void ActorUtil::SetXY( Actor& actor, const RString &sType ) { ASSERT( !actor.GetName().empty() ); - /* - * Hack: We normally SET_XY in Init(), and run ON_COMMAND in BeginScreen. We - * want to load the actor's commands in Init(), since that takes long enough - * to skip. So, run LoadAllCommands here if it hasn't been run yet. - */ - if( !actor.HasCommand("On") ) // this actor hasn't loaded commands yet - LoadAllCommands( actor, sType ); - /* * Hack: This is run after InitCommand, and InitCommand might set X/Y. If * these are both 0, leave the actor where it is. If InitCommand doesn't, @@ -465,41 +457,6 @@ void ActorUtil::LoadCommandFromName( Actor& actor, const RString &sType, const R actor.AddCommand( sCommandName, THEME->GetMetricA(sType,sName+sCommandName+"Command") ); } -void ActorUtil::LoadAndPlayCommand( Actor& actor, const RString &sType, const RString &sCommandName ) -{ - // HACK: It's very often that we command things to TweenOffScreen - // that we aren't drawing. We know that an Actor is not being - // used if its name is blank. So, do nothing on Actors with a blank name. - // (Do "playcommand" anyway; BGAs often have no name.) - if( sCommandName=="Off" && actor.GetName().empty() ) - return; - - ASSERT_M( - !actor.GetName().empty(), - ssprintf("!actor.GetName().empty() ('%s', '%s')", sType.c_str(), sCommandName.c_str()) - ); - ASSERT_M( - !sType.empty(), - ssprintf("!sType.empty() ('%s', '%s')", sType.c_str(), sCommandName.c_str()) - ); - - if( !actor.HasCommand(sCommandName ) ) // this actor hasn't loaded commands yet - LoadAllCommands( actor, sType ); - - // If we didn't load the command in LoadAllCommands, load the requested command - // explicitly. The metric is missing, and ThemeManager will prompt. - if( !actor.HasCommand(sCommandName) ) - { - // If this metric exists and we didn't load it in LoadAllCommands, then - // LoadAllCommands has a bug. - DEBUG_ASSERT( !THEME->HasMetric(sType,actor.GetName()+sCommandName+"Command") ); - - LoadCommand( actor, sType, sCommandName ); - } - - actor.PlayCommand( sCommandName ); -} - void ActorUtil::LoadAllCommands( Actor& actor, const RString &sType ) { LoadAllCommandsFromName( actor, sType, actor.GetName() ); @@ -513,7 +470,7 @@ void ActorUtil::LoadAllCommandsFromName( Actor& actor, const RString &sType, con FOREACHS_CONST( RString, vsValueNames, v ) { const RString &sv = *v; - static RString sEnding = "Command"; + static const RString sEnding = "Command"; if( EndsWith(sv,sEnding) ) { RString sCommandName( sv.begin()+sName.size(), sv.end()-sEnding.size() ); diff --git a/stepmania/src/ActorUtil.h b/stepmania/src/ActorUtil.h index 0fe36b1a81..972603a76e 100644 --- a/stepmania/src/ActorUtil.h +++ b/stepmania/src/ActorUtil.h @@ -45,25 +45,63 @@ namespace ActorUtil apActorCommands ParseActorCommands( const RString &sCommands, const RString &sName = "" ); void SetXY( Actor& actor, const RString &sType ); + inline void PlayCommand( Actor& actor, const RString &sCommandName ) { actor.PlayCommand( sCommandName ); } + inline void OnCommand( Actor& actor ) + { + ASSERT( actor.HasCommand("On") ); + actor.PlayCommand("On"); + } + inline void OffCommand( Actor& actor ) + { + // HACK: It's very often that we command things to TweenOffScreen + // that we aren't drawing. We know that an Actor is not being + // used if its name is blank. So, do nothing on Actors with a blank name. + // (Do "playcommand" anyway; BGAs often have no name.) + if( actor.GetName().empty() ) + return; + ASSERT( actor.HasCommand("Off") ); + actor.PlayCommand("Off"); + } + void LoadCommand( Actor& actor, const RString &sType, const RString &sCommandName ); void LoadCommandFromName( Actor& actor, const RString &sType, const RString &sCommandName, const RString &sName ); - void LoadAndPlayCommand( Actor& actor, const RString &sType, const RString &sCommandName ); void LoadAllCommands( Actor& actor, const RString &sType ); void LoadAllCommandsFromName( Actor& actor, const RString &sType, const RString &sName ); - inline void OnCommand( Actor& actor, const RString &sType ) { LoadAndPlayCommand( actor, sType, "On" ); } - inline void OffCommand( Actor& actor, const RString &sType ) { LoadAndPlayCommand( actor, sType, "Off" ); } + + inline void LoadAllCommandsAndSetXY( Actor& actor, const RString &sType ) + { + LoadAllCommands( actor, sType ); + SetXY( actor, sType ); + } + inline void LoadAllCommandsAndOnCommand( Actor& actor, const RString &sType ) + { + LoadAllCommands( actor, sType ); + OnCommand( actor ); + } inline void SetXYAndOnCommand( Actor& actor, const RString &sType ) { SetXY( actor, sType ); - OnCommand( actor, sType ); + OnCommand( actor ); + } + inline void LoadAllCommandsAndSetXYAndOnCommand( Actor& actor, const RString &sType ) + { + LoadAllCommands( actor, sType ); + SetXY( actor, sType ); + OnCommand( actor ); } /* convenience */ inline void SetXY( Actor* pActor, const RString &sType ) { SetXY( *pActor, sType ); } - inline void LoadAndPlayCommand( Actor* pActor, const RString &sType, const RString &sCommandName ) { if(pActor) LoadAndPlayCommand( *pActor, sType, sCommandName ); } - inline void OnCommand( Actor* pActor, const RString &sType ) { if(pActor) OnCommand( *pActor, sType ); } - inline void OffCommand( Actor* pActor, const RString &sType ) { if(pActor) OffCommand( *pActor, sType ); } + inline void PlayCommand( Actor* pActor, const RString &sCommandName ) { if(pActor) pActor->PlayCommand( sCommandName ); } + inline void OnCommand( Actor* pActor ) { if(pActor) ActorUtil::OnCommand( *pActor ); } + inline void OffCommand( Actor* pActor ) { if(pActor) ActorUtil::OffCommand( *pActor ); } + + inline void LoadAllCommands( Actor* pActor, const RString &sType ) { if(pActor) LoadAllCommands( *pActor, sType ); } + + inline void LoadAllCommandsAndSetXY( Actor* pActor, const RString &sType ) { if(pActor) LoadAllCommandsAndSetXY( *pActor, sType ); } + inline void LoadAllCommandsAndOnCommand( Actor* pActor, const RString &sType ) { if(pActor) LoadAllCommandsAndOnCommand( *pActor, sType ); } inline void SetXYAndOnCommand( Actor* pActor, const RString &sType ) { if(pActor) SetXYAndOnCommand( *pActor, sType ); } + inline void LoadAllCommandsAndSetXYAndOnCommand( Actor* pActor, const RString &sType ) { if(pActor) LoadAllCommandsAndSetXYAndOnCommand( *pActor, sType ); } // Return a Sprite, BitmapText, or Model depending on the file type Actor* LoadFromNode( const XNode* pNode, Actor *pParentActor = NULL ); @@ -81,10 +119,14 @@ namespace ActorUtil }; #define SET_XY( actor ) ActorUtil::SetXY( actor, m_sName ) -#define ON_COMMAND( actor ) ActorUtil::OnCommand( actor, m_sName ) -#define OFF_COMMAND( actor ) ActorUtil::OffCommand( actor, m_sName ) +#define ON_COMMAND( actor ) ActorUtil::OnCommand( actor ) +#define OFF_COMMAND( actor ) ActorUtil::OffCommand( actor ) #define SET_XY_AND_ON_COMMAND( actor ) ActorUtil::SetXYAndOnCommand( actor, m_sName ) -#define COMMAND( actor, command_name ) ActorUtil::LoadAndPlayCommand( actor, m_sName, command_name ) +#define COMMAND( actor, command_name ) ActorUtil::PlayCommand( actor, command_name ) +#define LOAD_ALL_COMMANDS( actor ) ActorUtil::LoadAllCommands( actor, m_sName ) +#define LOAD_ALL_COMMANDS_AND_SET_XY( actor ) ActorUtil::LoadAllCommandsAndSetXY( actor, m_sName ) +#define LOAD_ALL_COMMANDS_AND_ON_COMMAND( actor ) ActorUtil::LoadAllCommandsAndOnCommand( actor, m_sName ) +#define LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( actor ) ActorUtil::LoadAllCommandsAndSetXYAndOnCommand( actor, m_sName ) #endif diff --git a/stepmania/src/CourseEntryDisplay.cpp b/stepmania/src/CourseEntryDisplay.cpp index aeef633c7b..7885935dbd 100644 --- a/stepmania/src/CourseEntryDisplay.cpp +++ b/stepmania/src/CourseEntryDisplay.cpp @@ -26,7 +26,7 @@ void CourseEntryDisplay::Load() m_sprFrame.SetName( "Bar" ); m_sprFrame.Load( THEME->GetPathG("CourseEntryDisplay","bar") ); - SET_XY_AND_ON_COMMAND( &m_sprFrame ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( &m_sprFrame ); this->AddChild( &m_sprFrame ); this->m_size.x = m_sprFrame.GetUnzoomedWidth(); @@ -34,12 +34,12 @@ void CourseEntryDisplay::Load() m_textNumber.SetName( "Number" ); m_textNumber.LoadFromFont( THEME->GetPathF("CourseEntryDisplay","number") ); - SET_XY_AND_ON_COMMAND( &m_textNumber ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( &m_textNumber ); this->AddChild( &m_textNumber ); m_TextBanner.SetName( "TextBanner" ); m_TextBanner.Load( TEXT_BANNER_TYPE ); - SET_XY_AND_ON_COMMAND( &m_TextBanner ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( &m_TextBanner ); /* Load the m_TextBanner now, so any actor commands sent to us will propagate correctly. */ m_TextBanner.LoadFromString( "", "", "", "", "", "" ); this->AddChild( &m_TextBanner ); @@ -51,18 +51,18 @@ void CourseEntryDisplay::Load() m_textFoot[pn].SetName( SEPARATE_COURSE_METERS? ssprintf("FootP%i", pn+1):RString("Foot") ); m_textFoot[pn].LoadFromTextureAndChars( THEME->GetPathF("CourseEntryDisplay","difficulty"),"10" ); - SET_XY_AND_ON_COMMAND( &m_textFoot[pn] ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( &m_textFoot[pn] ); this->AddChild( &m_textFoot[pn] ); m_textDifficultyNumber[pn].SetName( SEPARATE_COURSE_METERS? ssprintf("DifficultyP%i", pn+1):RString("Difficulty") ); m_textDifficultyNumber[pn].LoadFromFont( THEME->GetPathF("Common","normal") ); - SET_XY_AND_ON_COMMAND( &m_textDifficultyNumber[pn] ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( &m_textDifficultyNumber[pn] ); this->AddChild( &m_textDifficultyNumber[pn] ); } m_textModifiers.SetName( "Modifiers" ); m_textModifiers.LoadFromFont( THEME->GetPathF("Common","normal") ); - SET_XY_AND_ON_COMMAND( &m_textModifiers ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( &m_textModifiers ); this->AddChild( &m_textModifiers ); } diff --git a/stepmania/src/DifficultyMeter.cpp b/stepmania/src/DifficultyMeter.cpp index 2c14ed2bed..ade1deb6a7 100644 --- a/stepmania/src/DifficultyMeter.cpp +++ b/stepmania/src/DifficultyMeter.cpp @@ -73,7 +73,7 @@ void DifficultyMeter::Load( const RString &sType ) Feet = "0X"; } m_textFeet.LoadFromTextureAndChars( THEME->GetPathF(sType,"bar"), Feet ); - ActorUtil::SetXYAndOnCommand( m_textFeet, sType ); + ActorUtil::LoadAllCommandsAndSetXYAndOnCommand( m_textFeet, sType ); this->AddChild( &m_textFeet ); } @@ -81,7 +81,7 @@ void DifficultyMeter::Load( const RString &sType ) { m_Difficulty.Load( THEME->GetPathG(sType,"difficulty") ); m_Difficulty->SetName( "Difficulty" ); - ActorUtil::SetXYAndOnCommand( m_Difficulty, sType ); + ActorUtil::LoadAllCommandsAndSetXYAndOnCommand( m_Difficulty, sType ); this->AddChild( m_Difficulty ); // These commands should have been loaded by SetXYAndOnCommand above. @@ -96,7 +96,7 @@ void DifficultyMeter::Load( const RString &sType ) { m_textMeter.SetName( "Meter" ); m_textMeter.LoadFromFont( THEME->GetPathF(sType,"meter") ); - ActorUtil::SetXYAndOnCommand( m_textMeter, sType ); + ActorUtil::LoadAllCommandsAndSetXYAndOnCommand( m_textMeter, sType ); this->AddChild( &m_textMeter ); // These commands should have been loaded by SetXYAndOnCommand above. @@ -111,7 +111,7 @@ void DifficultyMeter::Load( const RString &sType ) { m_textEditDescription.SetName( "EditDescription" ); m_textEditDescription.LoadFromFont( THEME->GetPathF(sType,"EditDescription") ); - ActorUtil::SetXYAndOnCommand( m_textEditDescription, sType ); + ActorUtil::LoadAllCommandsAndSetXYAndOnCommand( m_textEditDescription, sType ); this->AddChild( &m_textEditDescription ); } diff --git a/stepmania/src/FadingBanner.cpp b/stepmania/src/FadingBanner.cpp index 7b7e945c0a..f5d2c6252a 100644 --- a/stepmania/src/FadingBanner.cpp +++ b/stepmania/src/FadingBanner.cpp @@ -29,7 +29,7 @@ FadingBanner::FadingBanner() for( int i=0; iAddChild( &m_Banner[i] ); } } diff --git a/stepmania/src/MenuTimer.cpp b/stepmania/src/MenuTimer.cpp index bbe8d64e90..77591151a0 100644 --- a/stepmania/src/MenuTimer.cpp +++ b/stepmania/src/MenuTimer.cpp @@ -30,7 +30,7 @@ void MenuTimer::Load() { m_text[i].LoadFromFont( THEME->GetPathF("MenuTimer","numbers") ); m_text[i].SetName( ssprintf("Text%d",i+1) ); - ActorUtil::OnCommand( m_text[i], "MenuTimer" ); + ActorUtil::LoadAllCommandsAndOnCommand( m_text[i], "MenuTimer" ); this->AddChild( &m_text[i] ); } diff --git a/stepmania/src/MusicWheelItem.cpp b/stepmania/src/MusicWheelItem.cpp index c04265ff9d..da97cd7d3b 100644 --- a/stepmania/src/MusicWheelItem.cpp +++ b/stepmania/src/MusicWheelItem.cpp @@ -80,12 +80,12 @@ MusicWheelItem::MusicWheelItem( RString sType ): m_textCourse.SetName( "CourseName" ); m_textCourse.LoadFromFont( THEME->GetPathF(sType,"course") ); - SET_XY_AND_ON_COMMAND( &m_textCourse ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( &m_textCourse ); this->AddChild( &m_textCourse ); m_textSort.SetName( "Sort" ); m_textSort.LoadFromFont( THEME->GetPathF(sType,"sort") ); - SET_XY_AND_ON_COMMAND( &m_textSort ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( &m_textSort ); this->AddChild( &m_textSort ); FOREACH_PlayerNumber( p ) diff --git a/stepmania/src/PaneDisplay.cpp b/stepmania/src/PaneDisplay.cpp index bdc9ba486b..0bdafb9e4b 100644 --- a/stepmania/src/PaneDisplay.cpp +++ b/stepmania/src/PaneDisplay.cpp @@ -61,7 +61,7 @@ void PaneDisplay::Load( const RString &sMetricsGroup, PlayerNumber pn ) m_sprPaneUnder.Load( THEME->GetPathG(sMetricsGroup,ssprintf("under p%i",pn+1)) ); m_sprPaneUnder->SetName( "Under" ); - ActorUtil::OnCommand( m_sprPaneUnder, sMetricsGroup ); + ActorUtil::LoadAllCommandsAndOnCommand( m_sprPaneUnder, sMetricsGroup ); this->AddChild( m_sprPaneUnder ); EMPTY_MACHINE_HIGH_SCORE_NAME.Load( sMetricsGroup, "EmptyMachineHighScoreName" ); diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index e513299727..3a7957b2ca 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -383,14 +383,14 @@ void Player::Init( { m_pCombo->SetName( "Combo" ); m_pCombo->Load( m_pPlayerState, m_pPlayerStageStats ); - ActorUtil::OnCommand( m_pCombo, sType ); + ActorUtil::LoadAllCommandsAndOnCommand( m_pCombo, sType ); } if( m_pJudgment ) { m_pJudgment->SetName( "Judgment" ); m_pJudgment->LoadNormal(); - ActorUtil::OnCommand( m_pJudgment, sType ); + ActorUtil::LoadAllCommandsAndOnCommand( m_pJudgment, sType ); } // Load HoldJudgments diff --git a/stepmania/src/ScoreDisplayLifeTime.cpp b/stepmania/src/ScoreDisplayLifeTime.cpp index 35da3918e0..ca25e75e54 100644 --- a/stepmania/src/ScoreDisplayLifeTime.cpp +++ b/stepmania/src/ScoreDisplayLifeTime.cpp @@ -26,18 +26,18 @@ void ScoreDisplayLifeTime::Init( const PlayerState* pPlayerState, const PlayerSt m_sprFrame.Load( THEME->GetPathG(sType,"frame") ); m_sprFrame->SetName( "Frame" ); this->AddChild( m_sprFrame ); - ActorUtil::OnCommand( m_sprFrame, sType ); + ActorUtil::LoadAllCommandsAndOnCommand( m_sprFrame, sType ); m_textTimeRemaining.LoadFromFont( THEME->GetPathF(sType, "TimeRemaining") ); m_textTimeRemaining.SetName( "TimeRemaining" ); this->AddChild( &m_textTimeRemaining ); - ActorUtil::OnCommand( m_textTimeRemaining, sType ); + ActorUtil::LoadAllCommandsAndOnCommand( m_textTimeRemaining, sType ); m_textTimeRemaining.RunCommands( CommonMetrics::PLAYER_COLOR.GetValue(pn) ); m_textDeltaSeconds.LoadFromFont( THEME->GetPathF(sType,"DeltaSeconds") ); m_textDeltaSeconds.SetName( "DeltaSeconds" ); this->AddChild( &m_textDeltaSeconds ); - ActorUtil::OnCommand( m_textDeltaSeconds, sType ); + ActorUtil::LoadAllCommandsAndOnCommand( m_textDeltaSeconds, sType ); FOREACH_TapNoteScore( tns ) { diff --git a/stepmania/src/ScreenBookkeeping.cpp b/stepmania/src/ScreenBookkeeping.cpp index 67ce599a41..bb82d5f02e 100644 --- a/stepmania/src/ScreenBookkeeping.cpp +++ b/stepmania/src/ScreenBookkeeping.cpp @@ -18,19 +18,19 @@ void ScreenBookkeeping::Init() m_textAllTime.LoadFromFont( THEME->GetPathF(m_sName,"AllTime") ); m_textAllTime.SetName( "AllTime" ); - SET_XY_AND_ON_COMMAND( m_textAllTime ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textAllTime ); this->AddChild( &m_textAllTime ); m_textTitle.LoadFromFont( THEME->GetPathF(m_sName,"title") ); m_textTitle.SetName( "Title" ); - SET_XY_AND_ON_COMMAND( m_textTitle ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textTitle ); this->AddChild( &m_textTitle ); for( int i=0; iGetPathF(m_sName,"data") ); m_textData[i].SetName( "Data" ); - SET_XY_AND_ON_COMMAND( m_textData[i] ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textData[i] ); float fX = SCALE( i, 0.f, NUM_BOOKKEEPING_COLS-1, SCREEN_LEFT+50, SCREEN_RIGHT-160 ); m_textData[i].SetX( fX ); this->AddChild( &m_textData[i] ); diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 2745def71c..7b1764eee1 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -746,18 +746,18 @@ void ScreenEdit::Init() m_textInputTips.SetName( "EditHelp" ); m_textInputTips.LoadFromFont( THEME->GetPathF("ScreenEdit","EditHelp") ); m_textInputTips.SetText( EDIT_HELP_TEXT ); - SET_XY_AND_ON_COMMAND( m_textInputTips ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textInputTips ); this->AddChild( &m_textInputTips ); m_textInfo.SetName( "Info" ); m_textInfo.LoadFromFont( THEME->GetPathF("ScreenEdit","Info") ); - SET_XY_AND_ON_COMMAND( m_textInfo ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textInfo ); this->AddChild( &m_textInfo ); m_textPlayRecordHelp.SetName( "PlayRecordHelp" ); m_textPlayRecordHelp.LoadFromFont( THEME->GetPathF("ScreenEdit","PlayRecordHelp") ); m_textPlayRecordHelp.SetText( PLAY_RECORD_HELP_TEXT ); - SET_XY_AND_ON_COMMAND( m_textPlayRecordHelp ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textPlayRecordHelp ); this->AddChild( &m_textPlayRecordHelp ); m_soundAddNote.Load( THEME->GetPathS("ScreenEdit","AddNote"), true ); diff --git a/stepmania/src/ScreenEditMenu.cpp b/stepmania/src/ScreenEditMenu.cpp index d9dee5b9bd..a86e56d8a0 100644 --- a/stepmania/src/ScreenEditMenu.cpp +++ b/stepmania/src/ScreenEditMenu.cpp @@ -45,13 +45,13 @@ void ScreenEditMenu::Init() m_textExplanation.SetName( "Explanation" ); m_textExplanation.LoadFromFont( THEME->GetPathF(m_sName,"explanation") ); - SET_XY( m_textExplanation ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_textExplanation ); RefreshExplanationText(); this->AddChild( &m_textExplanation ); m_textNumStepsLoadedFromProfile.SetName( "NumStepsLoadedFromProfile" ); m_textNumStepsLoadedFromProfile.LoadFromFont( THEME->GetPathF(m_sName,"NumStepsLoadedFromProfile") ); - SET_XY_AND_ON_COMMAND( m_textNumStepsLoadedFromProfile ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textNumStepsLoadedFromProfile ); RefreshNumStepsLoadedFromProfile(); this->AddChild( &m_textNumStepsLoadedFromProfile ); } diff --git a/stepmania/src/ScreenEnding.cpp b/stepmania/src/ScreenEnding.cpp index cfbb8fb95a..09676b81a9 100644 --- a/stepmania/src/ScreenEnding.cpp +++ b/stepmania/src/ScreenEnding.cpp @@ -103,7 +103,7 @@ void ScreenEnding::Init() break; } ActorUtil::LoadAllCommands( m_sprRemoveMemoryCard[p], m_sName ); - SET_XY_AND_ON_COMMAND( m_sprRemoveMemoryCard[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_sprRemoveMemoryCard[p] ); this->AddChild( &m_sprRemoveMemoryCard[p] ); } diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index 45e0a77d89..46d030ff6d 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -275,13 +275,13 @@ void ScreenEvaluation::Init() m_SmallBanner[i].ScaleToClipped( BANNER_WIDTH, BANNER_HEIGHT ); m_SmallBanner[i].SetName( ssprintf("SmallBanner%d",i+1) ); ActorUtil::LoadAllCommands( m_SmallBanner[i], m_sName ); - SET_XY( m_SmallBanner[i] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_SmallBanner[i] ); this->AddChild( &m_SmallBanner[i] ); m_sprSmallBannerFrame[i].Load( THEME->GetPathG(m_sName,"banner frame") ); m_sprSmallBannerFrame[i]->SetName( ssprintf("SmallBanner%d",i+1) ); ActorUtil::LoadAllCommands( *m_sprSmallBannerFrame[i], m_sName ); - SET_XY( m_sprSmallBannerFrame[i] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprSmallBannerFrame[i] ); this->AddChild( m_sprSmallBannerFrame[i] ); } } @@ -294,13 +294,13 @@ void ScreenEvaluation::Init() m_LargeBanner.ScaleToClipped( BANNER_WIDTH, BANNER_HEIGHT ); m_LargeBanner.SetName( "LargeBanner" ); ActorUtil::LoadAllCommands( m_LargeBanner, m_sName ); - SET_XY( m_LargeBanner ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_LargeBanner ); this->AddChild( &m_LargeBanner ); m_sprLargeBannerFrame.Load( THEME->GetPathG(m_sName,"banner frame") ); m_sprLargeBannerFrame->SetName( "LargeBannerFrame" ); ActorUtil::LoadAllCommands( *m_sprLargeBannerFrame, m_sName ); - SET_XY( m_sprLargeBannerFrame ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprLargeBannerFrame ); this->AddChild( m_sprLargeBannerFrame ); } } @@ -317,7 +317,7 @@ void ScreenEvaluation::Init() m_DifficultyIcon[p].SetFromSteps( p, GAMESTATE->m_pCurSteps[p] ); m_DifficultyIcon[p].SetName( ssprintf("DifficultyIconP%d",p+1) ); ActorUtil::LoadAllCommands( m_DifficultyIcon[p], m_sName ); - SET_XY( m_DifficultyIcon[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_DifficultyIcon[p] ); this->AddChild( &m_DifficultyIcon[p] ); m_DifficultyMeter[p].SetName( ssprintf("DifficultyMeterP%d",p+1) ); @@ -327,13 +327,13 @@ void ScreenEvaluation::Init() else m_DifficultyMeter[p].SetFromSteps( GAMESTATE->m_pCurSteps[p] ); ActorUtil::LoadAllCommands( m_DifficultyMeter[p], m_sName ); - SET_XY( m_DifficultyMeter[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_DifficultyMeter[p] ); this->AddChild( &m_DifficultyMeter[p] ); m_textPlayerOptions[p].LoadFromFont( THEME->GetPathF(m_sName,"PlayerOptions") ); m_textPlayerOptions[p].SetName( ssprintf("PlayerOptionsP%d",p+1) ); ActorUtil::LoadAllCommands( m_textPlayerOptions[p], m_sName ); - SET_XY( m_textPlayerOptions[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_textPlayerOptions[p] ); vector v; GAMESTATE->m_pPlayerState[p]->m_PlayerOptions.GetStage().GetLocalizedMods( v ); RString sPO = join( PLAYER_OPTIONS_SEPARATOR, v ); @@ -353,14 +353,14 @@ void ScreenEvaluation::Init() m_sprGradeFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("grade frame p%d",p+1)) ); m_sprGradeFrame[p]->SetName( ssprintf("GradeFrameP%d",p+1) ); ActorUtil::LoadAllCommands( *m_sprGradeFrame[p], m_sName ); - SET_XY( m_sprGradeFrame[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprGradeFrame[p] ); this->AddChild( m_sprGradeFrame[p] ); m_Grades[p].Load( THEME->GetPathG(m_sName,"grades") ); m_Grades[p].SetGrade( p, grade[p] ); m_Grades[p].SetName( ssprintf("GradeP%d",p+1) ); ActorUtil::LoadAllCommands( m_Grades[p], m_sName ); - SET_XY( m_Grades[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_Grades[p] ); this->AddChild( &m_Grades[p] ); } } @@ -375,7 +375,7 @@ void ScreenEvaluation::Init() m_sprPercentFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("percent frame p%d",p+1)) ); m_sprPercentFrame[p]->SetName( ssprintf("PercentFrameP%d",p+1) ); ActorUtil::LoadAllCommands( *m_sprPercentFrame[p], m_sName ); - SET_XY( m_sprPercentFrame[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprPercentFrame[p] ); this->AddChild( m_sprPercentFrame[p] ); /* Use "ScreenEvaluation Percent" for the [metric set], but position and @@ -383,7 +383,7 @@ void ScreenEvaluation::Init() m_Percent[p].SetName( ssprintf("PercentP%d",p+1) ); m_Percent[p].Load( GAMESTATE->m_pPlayerState[p], &STATSMAN->m_CurStageStats.m_player[p], "ScreenEvaluation Percent", true ); ActorUtil::LoadAllCommands( m_Percent[p], m_sName ); - SET_XY( m_Percent[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_Percent[p] ); this->AddChild( &m_Percent[p] ); } } @@ -398,7 +398,7 @@ void ScreenEvaluation::Init() m_sprBonusFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("bonus frame p%d",p+1)) ); m_sprBonusFrame[p]->SetName( ssprintf("BonusFrameP%d",p+1) ); ActorUtil::LoadAllCommands( *m_sprBonusFrame[p], m_sName ); - SET_XY( m_sprBonusFrame[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprBonusFrame[p] ); this->AddChild( m_sprBonusFrame[p] ); for( int r=0; rm_CurStageStats.m_player[p].m_radarPossible[r] ); m_sprPossibleBar[p][r].SetName( ssprintf("BarPossible%dP%d",r+1,p+1) ); ActorUtil::LoadAllCommands( m_sprPossibleBar[p][r], m_sName ); - SET_XY( m_sprPossibleBar[p][r] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprPossibleBar[p][r] ); this->AddChild( &m_sprPossibleBar[p][r] ); m_sprActualBar[p][r].Load( THEME->GetPathG(m_sName,ssprintf("bar actual p%d",p+1)) ); @@ -419,7 +419,7 @@ void ScreenEvaluation::Init() m_sprActualBar[p][r].SetName( ssprintf("BarActual%dP%d",r+1,p+1) ); ActorUtil::LoadAllCommands( m_sprActualBar[p][r], m_sName ); - SET_XY( m_sprActualBar[p][r] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprActualBar[p][r] ); // .99999 is fairly close to 1.00, so we use that if( STATSMAN->m_CurStageStats.m_player[p].m_radarActual[r] > 0.99999f ) @@ -439,7 +439,7 @@ void ScreenEvaluation::Init() m_sprSurvivedFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("survived frame p%d",p+1)) ); m_sprSurvivedFrame[p]->SetName( ssprintf("SurvivedFrameP%d",p+1) ); ActorUtil::LoadAllCommands( *m_sprSurvivedFrame[p], m_sName ); - SET_XY( m_sprSurvivedFrame[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprSurvivedFrame[p] ); this->AddChild( m_sprSurvivedFrame[p] ); m_textSurvivedNumber[p].LoadFromFont( THEME->GetPathF(m_sName, "stage") ); @@ -449,7 +449,7 @@ void ScreenEvaluation::Init() m_textSurvivedNumber[p].SetText( ssprintf("%02d", STATSMAN->m_CurStageStats.m_player[p].m_iSongsPassed) ); m_textSurvivedNumber[p].SetName( ssprintf("SurvivedNumberP%d",p+1) ); ActorUtil::LoadAllCommands( m_textSurvivedNumber[p], m_sName ); - SET_XY( m_textSurvivedNumber[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_textSurvivedNumber[p] ); this->AddChild( &m_textSurvivedNumber[p] ); } } @@ -464,7 +464,7 @@ void ScreenEvaluation::Init() m_sprWinFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("win frame p%d",p+1)) ); m_sprWinFrame[p]->SetName( ssprintf("WinFrameP%d",p+1) ); ActorUtil::LoadAllCommands( *m_sprWinFrame[p], m_sName ); - SET_XY( m_sprWinFrame[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprWinFrame[p] ); this->AddChild( m_sprWinFrame[p] ); m_sprWin[p].Load( THEME->GetPathG(m_sName,ssprintf("win p%d 1x3",p+1)) ); @@ -473,7 +473,7 @@ void ScreenEvaluation::Init() m_sprWin[p].SetState( iFrame ); m_sprWin[p].SetName( ssprintf("WinP%d",p+1) ); ActorUtil::LoadAllCommands( m_sprWin[p], m_sName ); - SET_XY( m_sprWin[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprWin[p] ); this->AddChild( &m_sprWin[p] ); } } @@ -495,7 +495,7 @@ void ScreenEvaluation::Init() m_sprJudgeLabels[l].SetState( l ); m_sprJudgeLabels[l].SetName( JudgeLineToString(l)+"Label" ); ActorUtil::LoadAllCommands( m_sprJudgeLabels[l], m_sName ); - SET_XY( m_sprJudgeLabels[l] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprJudgeLabels[l] ); this->AddChild( &m_sprJudgeLabels[l] ); } @@ -506,7 +506,7 @@ void ScreenEvaluation::Init() m_textJudgeNumbers[l][p].RunCommands( CommonMetrics::PLAYER_COLOR.GetValue(p) ); m_textJudgeNumbers[l][p].SetName( JudgeLineToString(l)+ssprintf("NumberP%d",p+1) ); ActorUtil::LoadAllCommands( m_textJudgeNumbers[l][p], m_sName ); - SET_XY( m_textJudgeNumbers[l][p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_textJudgeNumbers[l][p] ); this->AddChild( &m_textJudgeNumbers[l][p] ); int iValue; @@ -541,7 +541,7 @@ void ScreenEvaluation::Init() m_sprStatsLabel[l]->StopAnimating(); m_sprStatsLabel[l]->SetName( StatLineToString(l)+"Label" ); ActorUtil::LoadAllCommands( *m_sprStatsLabel[l], m_sName ); - SET_XY( m_sprStatsLabel[l] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprStatsLabel[l] ); this->AddChild( m_sprStatsLabel[l] ); } @@ -551,7 +551,7 @@ void ScreenEvaluation::Init() m_textStatsText[l][p].RunCommands( CommonMetrics::PLAYER_COLOR.GetValue(p) ); m_textStatsText[l][p].SetName( StatLineToString(l)+ssprintf("TextP%d",p+1) ); ActorUtil::LoadAllCommands( m_textStatsText[l][p], m_sName ); - SET_XY( m_textStatsText[l][p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_textStatsText[l][p] ); this->AddChild( &m_textStatsText[l][p] ); static const int indeces[NUM_StatLine] = @@ -574,7 +574,7 @@ void ScreenEvaluation::Init() m_sprScoreLabel.Load( THEME->GetPathG(m_sName,"score label") ); m_sprScoreLabel->SetName( "ScoreLabel" ); ActorUtil::LoadAllCommands( *m_sprScoreLabel, m_sName ); - SET_XY( m_sprScoreLabel ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprScoreLabel ); this->AddChild( m_sprScoreLabel ); FOREACH_EnabledPlayer( p ) @@ -584,7 +584,7 @@ void ScreenEvaluation::Init() m_textScore[p].RunCommands( CommonMetrics::PLAYER_COLOR.GetValue(p) ); m_textScore[p].SetName( ssprintf("ScoreNumberP%d",p+1) ); ActorUtil::LoadAllCommands( m_textScore[p], m_sName ); - SET_XY( m_textScore[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_textScore[p] ); m_textScore[p].SetText( ssprintf("%*.0i", NUM_SCORE_DIGITS, STATSMAN->m_CurStageStats.m_player[p].m_iScore) ); this->AddChild( &m_textScore[p] ); } @@ -595,7 +595,7 @@ void ScreenEvaluation::Init() m_sprTotalScoreLabel.Load( THEME->GetPathG(m_sName,"totalscore label") ); m_sprTotalScoreLabel->SetName( "TotalScoreLabel" ); ActorUtil::LoadAllCommands( *m_sprTotalScoreLabel, m_sName ); - SET_XY( m_sprTotalScoreLabel ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprTotalScoreLabel ); this->AddChild( m_sprTotalScoreLabel ); FOREACH_EnabledPlayer( p ) @@ -612,7 +612,7 @@ void ScreenEvaluation::Init() m_textTotalScore[p].SetName( ssprintf("TotalScoreNumberP%d",p+1) ); m_textTotalScore[p].SetText( ssprintf("%*.0i", NUM_SCORE_DIGITS+2, iTotalScore) ); ActorUtil::LoadAllCommands( m_textTotalScore[p], m_sName ); - SET_XY( m_textTotalScore[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_textTotalScore[p] ); this->AddChild( &m_textTotalScore[p] ); } @@ -626,7 +626,7 @@ void ScreenEvaluation::Init() m_sprTimeLabel.Load( THEME->GetPathG(m_sName,"time label") ); m_sprTimeLabel->SetName( "TimeLabel" ); ActorUtil::LoadAllCommands( *m_sprTimeLabel, m_sName ); - SET_XY( m_sprTimeLabel ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprTimeLabel ); this->AddChild( m_sprTimeLabel ); FOREACH_EnabledPlayer( p ) @@ -636,7 +636,7 @@ void ScreenEvaluation::Init() m_textTime[p].RunCommands( CommonMetrics::PLAYER_COLOR.GetValue(p) ); m_textTime[p].SetName( ssprintf("TimeNumberP%d",p+1) ); ActorUtil::LoadAllCommands( m_textTime[p], m_sName ); - SET_XY( m_textTime[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_textTime[p] ); m_textTime[p].SetText( SecondsToMMSSMsMs(STATSMAN->m_CurStageStats.m_player[p].m_fAliveSeconds) ); this->AddChild( &m_textTime[p] ); } @@ -655,7 +655,7 @@ void ScreenEvaluation::Init() m_sprMachineRecord[p].Load( THEME->GetPathG( m_sName, ssprintf("MachineRecord %02d",STATSMAN->m_CurStageStats.m_player[p].m_iMachineHighScoreIndex+1) ) ); m_sprMachineRecord[p]->SetName( ssprintf("MachineRecordP%d",p+1) ); ActorUtil::LoadAllCommands( *m_sprMachineRecord[p], m_sName ); - SET_XY( m_sprMachineRecord[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprMachineRecord[p] ); this->AddChild( m_sprMachineRecord[p] ); } if( STATSMAN->m_CurStageStats.m_player[p].m_iPersonalHighScoreIndex != -1 ) @@ -663,7 +663,7 @@ void ScreenEvaluation::Init() m_sprPersonalRecord[p].Load( THEME->GetPathG( m_sName, ssprintf("PersonalRecord %02d",STATSMAN->m_CurStageStats.m_player[p].m_iPersonalHighScoreIndex+1) ) ); m_sprPersonalRecord[p]->SetName( ssprintf("PersonalRecordP%d",p+1) ); ActorUtil::LoadAllCommands( *m_sprPersonalRecord[p], m_sName ); - SET_XY( m_sprPersonalRecord[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprPersonalRecord[p] ); this->AddChild( m_sprPersonalRecord[p] ); } } @@ -683,7 +683,7 @@ void ScreenEvaluation::Init() m_sprTryExtraStage.Load( THEME->GetPathG(m_sName,GAMESTATE->IsExtraStage()?"try extra2":"try extra1") ); m_sprTryExtraStage->SetName( "TryExtraStage" ); ActorUtil::LoadAllCommands( *m_sprTryExtraStage, m_sName ); - SET_XY( m_sprTryExtraStage ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprTryExtraStage ); this->AddChild( m_sprTryExtraStage ); if( GAMESTATE->IsExtraStage() ) diff --git a/stepmania/src/ScreenEz2SelectMusic.cpp b/stepmania/src/ScreenEz2SelectMusic.cpp index 33e1aa5214..dbcf32227f 100644 --- a/stepmania/src/ScreenEz2SelectMusic.cpp +++ b/stepmania/src/ScreenEz2SelectMusic.cpp @@ -609,13 +609,13 @@ void ScreenEz2SelectMusic::MusicChanged() { m_sprBalloon.StopTweening(); m_sprBalloon.Load( THEME->GetPathG("ScreenSelectMusic","balloon marathon") ); - SET_XY_AND_ON_COMMAND( m_sprBalloon ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_sprBalloon ); } else if( pSong->IsLong() ) { m_sprBalloon.StopTweening(); m_sprBalloon.Load( THEME->GetPathG("ScreenSelectMusic","balloon long") ); - SET_XY_AND_ON_COMMAND( m_sprBalloon ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_sprBalloon ); } else { diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index c989e1570f..5927b7c9da 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -478,7 +478,7 @@ void ScreenGameplay::Init() pi->m_sprOniGameOver.Load( THEME->GetPathG(m_sName,"oni gameover") ); pi->m_sprOniGameOver->SetName( ssprintf("OniGameOver%s",pi->GetName().c_str()) ); ActorUtil::LoadAllCommands( *pi->m_sprOniGameOver, m_sName ); - SET_XY( pi->m_sprOniGameOver ); + LOAD_ALL_COMMANDS_AND_SET_XY( pi->m_sprOniGameOver ); this->AddChild( pi->m_sprOniGameOver ); } } @@ -500,7 +500,7 @@ void ScreenGameplay::Init() m_sprLifeFrame.Load( THEME->GetPathG(m_sName,bBattery?"oni life frame":"life frame") ); m_sprLifeFrame->SetName( "LifeFrame" ); ActorUtil::LoadAllCommands( *m_sprLifeFrame, m_sName ); - SET_XY( m_sprLifeFrame ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprLifeFrame ); this->AddChild( m_sprLifeFrame ); // @@ -509,7 +509,7 @@ void ScreenGameplay::Init() m_sprScoreFrame.Load( THEME->GetPathG(m_sName,bBattery?"oni score frame":"score frame") ); m_sprScoreFrame.SetName( "ScoreFrame" ); ActorUtil::LoadAllCommands( m_sprScoreFrame, m_sName ); - SET_XY( m_sprScoreFrame ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprScoreFrame ); this->AddChild( &m_sprScoreFrame ); @@ -523,7 +523,7 @@ void ScreenGameplay::Init() m_pCombinedLifeMeter = new CombinedLifeMeterTug; m_pCombinedLifeMeter->SetName( "CombinedLife" ); ActorUtil::LoadAllCommands( *m_pCombinedLifeMeter, m_sName ); - SET_XY( *m_pCombinedLifeMeter ); + LOAD_ALL_COMMANDS_AND_SET_XY( *m_pCombinedLifeMeter ); this->AddChild( m_pCombinedLifeMeter ); break; } @@ -556,7 +556,7 @@ void ScreenGameplay::Init() pi->m_pLifeMeter->Load( pi->GetPlayerState(), pi->GetPlayerStageStats() ); pi->m_pLifeMeter->SetName( ssprintf("Life%s",pi->GetName().c_str()) ); ActorUtil::LoadAllCommands( *pi->m_pLifeMeter, m_sName ); - SET_XY( pi->m_pLifeMeter ); + LOAD_ALL_COMMANDS_AND_SET_XY( pi->m_pLifeMeter ); this->AddChild( pi->m_pLifeMeter ); } break; @@ -581,7 +581,7 @@ void ScreenGameplay::Init() m_Scoreboard[col].SetShadowLength( 0 ); m_Scoreboard[col].SetName( ssprintf("ScoreboardC%iP%i",col+1,pn+1) ); ActorUtil::LoadAllCommands( m_Scoreboard[col], m_sName ); - SET_XY( m_Scoreboard[col] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_Scoreboard[col] ); m_Scoreboard[col].SetText( NSMAN->m_Scoreboard[col] ); m_Scoreboard[col].SetVertAlign( align_top ); this->AddChild( &m_Scoreboard[col] ); @@ -593,7 +593,7 @@ void ScreenGameplay::Init() m_MaxCombo.LoadFromFont( THEME->GetPathF(m_sName,"max combo") ); m_MaxCombo.SetName( "MaxCombo" ); ActorUtil::LoadAllCommands( m_MaxCombo, m_sName ); - SET_XY( m_MaxCombo ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_MaxCombo ); m_MaxCombo.SetText( ssprintf("%d", m_vPlayerInfo[0].GetPlayerStageStats()->m_iMaxCombo) ); // TODO: Make this work for both players this->AddChild( &m_MaxCombo ); @@ -605,7 +605,7 @@ void ScreenGameplay::Init() { pi->m_pPrimaryScoreDisplay->SetName( ssprintf("Score%s",pi->GetName().c_str()) ); ActorUtil::LoadAllCommands( *pi->m_pPrimaryScoreDisplay, m_sName ); - SET_XY( pi->m_pPrimaryScoreDisplay ); + LOAD_ALL_COMMANDS_AND_SET_XY( pi->m_pPrimaryScoreDisplay ); if( GAMESTATE->m_PlayMode != PLAY_MODE_RAVE || SHOW_SCORE_IN_RAVE ) /* XXX: ugly */ this->AddChild( pi->m_pPrimaryScoreDisplay ); } @@ -616,7 +616,7 @@ void ScreenGameplay::Init() { pi->m_pSecondaryScoreDisplay->SetName( ssprintf("SecondaryScore%s",pi->GetName().c_str()) ); ActorUtil::LoadAllCommands( *pi->m_pSecondaryScoreDisplay, m_sName ); - SET_XY( pi->m_pSecondaryScoreDisplay ); + LOAD_ALL_COMMANDS_AND_SET_XY( pi->m_pSecondaryScoreDisplay ); this->AddChild( pi->m_pSecondaryScoreDisplay ); } } @@ -626,7 +626,7 @@ void ScreenGameplay::Init() // m_sprCourseSongNumber.SetName( "CourseSongNumber" ); ActorUtil::LoadAllCommands( m_sprCourseSongNumber, m_sName ); - SET_XY( m_sprCourseSongNumber ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprCourseSongNumber ); if( GAMESTATE->IsCourseMode() ) this->AddChild( &m_sprCourseSongNumber ); @@ -640,7 +640,7 @@ void ScreenGameplay::Init() pi->m_ptextCourseSongNumber->SetShadowLength( 0 ); pi->m_ptextCourseSongNumber->SetName( ssprintf("SongNumber%s",pi->GetName().c_str()) ); ActorUtil::LoadAllCommands( *pi->m_ptextCourseSongNumber, m_sName ); - SET_XY( pi->m_ptextCourseSongNumber ); + LOAD_ALL_COMMANDS_AND_SET_XY( pi->m_ptextCourseSongNumber ); pi->m_ptextCourseSongNumber->SetText( "" ); pi->m_ptextCourseSongNumber->SetDiffuse( RageColor(0,0.5f,1,1) ); // light blue this->AddChild( pi->m_ptextCourseSongNumber ); @@ -651,7 +651,7 @@ void ScreenGameplay::Init() pi->m_ptextStepsDescription->LoadFromFont( THEME->GetPathF(m_sName,"StepsDescription") ); pi->m_ptextStepsDescription->SetName( ssprintf("StepsDescription%s",pi->GetName().c_str()) ); ActorUtil::LoadAllCommands( *pi->m_ptextStepsDescription, m_sName ); - SET_XY( pi->m_ptextStepsDescription ); + LOAD_ALL_COMMANDS_AND_SET_XY( pi->m_ptextStepsDescription ); this->AddChild( pi->m_ptextStepsDescription ); // @@ -663,7 +663,7 @@ void ScreenGameplay::Init() pi->m_ptextPlayerOptions->SetShadowLength( 0 ); pi->m_ptextPlayerOptions->SetName( ssprintf("PlayerOptions%s",pi->GetName().c_str()) ); ActorUtil::LoadAllCommands( *pi->m_ptextPlayerOptions, m_sName ); - SET_XY( pi->m_ptextPlayerOptions ); + LOAD_ALL_COMMANDS_AND_SET_XY( pi->m_ptextPlayerOptions ); this->AddChild( pi->m_ptextPlayerOptions ); // @@ -697,7 +697,7 @@ void ScreenGameplay::Init() m_textSongOptions.SetShadowLength( 0 ); m_textSongOptions.SetName( "SongOptions" ); ActorUtil::LoadAllCommands( m_textSongOptions, m_sName ); - SET_XY( m_textSongOptions ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_textSongOptions ); m_textSongOptions.SetText( GAMESTATE->m_SongOptions.GetStage().GetLocalizedString() ); this->AddChild( &m_textSongOptions ); @@ -709,7 +709,7 @@ void ScreenGameplay::Init() pi->m_pActiveAttackList->Init( pi->GetPlayerState() ); pi->m_pActiveAttackList->SetName( ssprintf("ActiveAttackList%s",pi->GetName().c_str()) ); ActorUtil::LoadAllCommands( *pi->m_pActiveAttackList, m_sName ); - SET_XY( pi->m_pActiveAttackList ); + LOAD_ALL_COMMANDS_AND_SET_XY( pi->m_pActiveAttackList ); this->AddChild( pi->m_pActiveAttackList ); } @@ -734,7 +734,7 @@ void ScreenGameplay::Init() m_textDebug.LoadFromFont( THEME->GetPathF("Common","normal") ); m_textDebug.SetName( "Debug" ); ActorUtil::LoadAllCommands( m_textDebug, m_sName ); - SET_XY( m_textDebug ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_textDebug ); m_textDebug.SetDrawOrder( DRAW_ORDER_TRANSITIONS-1 ); // just under transitions, over the foreground this->AddChild( &m_textDebug ); @@ -746,7 +746,7 @@ void ScreenGameplay::Init() m_textSurviveTime.SetShadowLength( 0 ); m_textSurviveTime.SetName( "SurviveTime" ); ActorUtil::LoadAllCommands( m_textSurviveTime, m_sName ); - SET_XY( m_textSurviveTime ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_textSurviveTime ); m_textSurviveTime.SetDrawOrder( DRAW_ORDER_TRANSITIONS-1 ); m_textSurviveTime.SetDiffuse( RageColor(1,1,1,0) ); this->AddChild( &m_textSurviveTime ); @@ -1087,7 +1087,7 @@ void ScreenGameplay::LoadNextSong() pi->m_pActiveAttackList->Refresh(); // reset oni game over graphic - SET_XY_AND_ON_COMMAND( pi->m_sprOniGameOver ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( pi->m_sprOniGameOver ); if( GAMESTATE->m_SongOptions.GetCurrent().m_LifeType==SongOptions::LIFE_BATTERY && pi->GetPlayerStageStats()->m_bFailed ) // already failed pi->ShowOniGameOver(); @@ -1152,13 +1152,13 @@ void ScreenGameplay::LoadNextSong() if( pi->m_pDifficultyIcon ) { pi->m_pDifficultyIcon->SetName( ssprintf("Difficulty%s%s",pi->GetName().c_str(),bReverse?"Reverse":"") ); - SET_XY( pi->m_pDifficultyIcon ); + LOAD_ALL_COMMANDS_AND_SET_XY( pi->m_pDifficultyIcon ); } if( pi->m_pDifficultyMeter ) { pi->m_pDifficultyMeter->SetName( ssprintf("DifficultyMeter%s%s",pi->GetName().c_str(),bReverse?"Reverse":"") ); - SET_XY( pi->m_pDifficultyMeter ); + LOAD_ALL_COMMANDS_AND_SET_XY( pi->m_pDifficultyMeter ); } } @@ -1167,7 +1167,7 @@ void ScreenGameplay::LoadNextSong() * player is in reverse and the other isn't. What to do? */ m_LyricDisplay.SetName( ssprintf( "Lyrics%s", bAllReverse? "Reverse": (bAtLeastOneReverse? "OneReverse": "")) ); ActorUtil::LoadAllCommands( m_LyricDisplay, m_sName ); - SET_XY( m_LyricDisplay ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_LyricDisplay ); m_SongFinished.Reset(); @@ -2530,7 +2530,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) FOREACH_EnabledPlayer(p) fMaxSurviveSeconds = max( fMaxSurviveSeconds, STATSMAN->m_CurStageStats.m_player[p].m_fAliveSeconds ); m_textSurviveTime.SetText( "TIME: " + SecondsToMMSSMsMs(fMaxSurviveSeconds) ); - SET_XY_AND_ON_COMMAND( m_textSurviveTime ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textSurviveTime ); } if( GAMESTATE->IsCourseMode() ) diff --git a/stepmania/src/ScreenHowToPlay.cpp b/stepmania/src/ScreenHowToPlay.cpp index b616b95702..99a9e51fd7 100644 --- a/stepmania/src/ScreenHowToPlay.cpp +++ b/stepmania/src/ScreenHowToPlay.cpp @@ -84,7 +84,7 @@ void ScreenHowToPlay::Init() m_pmDancePad->SetName( "Pad" ); m_pmDancePad->LoadMilkshapeAscii( GetAnimPath(ANIM_DANCE_PAD) ); m_pmDancePad->SetRotationX( 35 ); - SET_XY_AND_ON_COMMAND( m_pmDancePad ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_pmDancePad ); } // Display random character @@ -114,7 +114,7 @@ void ScreenHowToPlay::Init() m_pmCharacter->SetRotationX( 40 ); m_pmCharacter->SetCullMode( CULL_NONE ); // many of the models floating around have the vertex order flipped - SET_XY_AND_ON_COMMAND( m_pmCharacter ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_pmCharacter ); } } @@ -124,7 +124,7 @@ void ScreenHowToPlay::Init() m_pLifeMeterBar = new LifeMeterBar; m_pLifeMeterBar->SetName("LifeMeterBar"); m_pLifeMeterBar->Load( GAMESTATE->m_pPlayerState[PLAYER_1], &STATSMAN->m_CurStageStats.m_player[PLAYER_1] ); - SET_XY_AND_ON_COMMAND( m_pLifeMeterBar ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_pLifeMeterBar ); m_pLifeMeterBar->FillForHowToPlay( NUM_W2S, NUM_MISSES ); } @@ -162,7 +162,7 @@ void ScreenHowToPlay::Init() m_Player.Load( m_NoteData ); m_Player->SetName( "Player" ); this->AddChild( m_Player ); - SET_XY_AND_ON_COMMAND( m_Player ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_Player ); // Don't show judgement PO_GROUP_ASSIGN( GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions, ModsLevel_Stage, m_fBlind, 1.0f ); diff --git a/stepmania/src/ScreenMapControllers.cpp b/stepmania/src/ScreenMapControllers.cpp index 53481d5660..85e7ca7370 100644 --- a/stepmania/src/ScreenMapControllers.cpp +++ b/stepmania/src/ScreenMapControllers.cpp @@ -36,7 +36,7 @@ void ScreenMapControllers::Init() m_textDevices.LoadFromFont( THEME->GetPathF("Common","normal") ); m_textDevices.SetName( "Devices" ); - SET_XY_AND_ON_COMMAND( m_textDevices ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textDevices ); this->AddChild( &m_textDevices ); diff --git a/stepmania/src/ScreenNameEntryTraditional.cpp b/stepmania/src/ScreenNameEntryTraditional.cpp index b3b912873f..274adadff6 100644 --- a/stepmania/src/ScreenNameEntryTraditional.cpp +++ b/stepmania/src/ScreenNameEntryTraditional.cpp @@ -47,14 +47,14 @@ void HighScoreWheelItem::Load( int iRankIndex, const HighScore& hs ) m_textRank.SetText( ssprintf("%d", iRankIndex+1) ); m_textRank.SetShadowLength( 2 ); this->AddChild( &m_textRank ); - SET_XY_AND_ON_COMMAND( m_textRank ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textRank ); m_textName.SetName( "Name" ); m_textName.LoadFromFont( THEME->GetPathF(m_sName,"name") ); m_textName.SetText( hs.GetDisplayName() ); m_textName.SetShadowLength( 2 ); this->AddChild( &m_textName ); - SET_XY_AND_ON_COMMAND( m_textName ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textName ); m_textScore.SetName( "Score" ); m_textScore.LoadFromFont( THEME->GetPathF(m_sName,"score") ); @@ -64,14 +64,14 @@ void HighScoreWheelItem::Load( int iRankIndex, const HighScore& hs ) m_textScore.SetText( ssprintf("%i", hs.GetScore()) ); m_textScore.SetShadowLength( 2 ); this->AddChild( &m_textScore ); - SET_XY_AND_ON_COMMAND( m_textScore ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textScore ); m_textDate.SetName( "Date" ); m_textDate.LoadFromFont( THEME->GetPathF(m_sName,"date") ); m_textDate.SetText( ssprintf("%02d/%02d", hs.GetDateTime().tm_mon+1, hs.GetDateTime().tm_mday) ); m_textDate.SetShadowLength( 2 ); this->AddChild( &m_textDate ); - SET_XY_AND_ON_COMMAND( m_textDate ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textDate ); } void HighScoreWheelItem::LoadBlank( int iRankIndex ) @@ -213,7 +213,7 @@ void ScreenNameEntryTraditional::Init() { m_sprOutOfRanking[p].Load( THEME->GetPathG( m_sName,ssprintf("OutOfRankingP%i",p+1)) ); m_sprOutOfRanking[p]->SetName( ssprintf("OutOfRankingP%i",p+1) ); - SET_XY_AND_ON_COMMAND( m_sprOutOfRanking[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_sprOutOfRanking[p] ); this->AddChild( m_sprOutOfRanking[p] ); continue; // skip @@ -221,11 +221,11 @@ void ScreenNameEntryTraditional::Init() m_sprNameFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("name frame p%i",p+1)) ); m_sprNameFrame[p]->SetName( ssprintf("EntryFrameP%i",p+1) ); - SET_XY_AND_ON_COMMAND( m_sprNameFrame[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_sprNameFrame[p] ); this->AddChild( m_sprNameFrame[p] ); m_Keyboard[p].SetName( ssprintf("KeyboardP%i",p+1) ); - SET_XY_AND_ON_COMMAND( m_Keyboard[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_Keyboard[p] ); this->AddChild( &m_Keyboard[p] ); /* Add letters to m_Keyboard. */ @@ -286,7 +286,7 @@ void ScreenNameEntryTraditional::Init() m_textSelection[p].SetName( ssprintf("SelectionP%i",p+1) ); m_textSelection[p].LoadFromFont( THEME->GetPathF(m_sName,"entry") ); - SET_XY_AND_ON_COMMAND( m_textSelection[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textSelection[p] ); this->AddChild( &m_textSelection[p] ); m_SelectedChar[p] = 0; @@ -321,7 +321,7 @@ void ScreenNameEntryTraditional::Init() * all actors, even if we're going to hide it anyway, so any style commands * are run. */ #define SET_ON( actor ) \ - SET_XY_AND_ON_COMMAND( actor ); \ + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( actor ); \ if( m_FeatDisplay[p].size()>1 ) \ { \ (actor).FinishTweening(); \ @@ -433,7 +433,7 @@ void ScreenNameEntryTraditional::Init() * itself is ugly. */ display.m_sprBannerFrame.Load( THEME->GetPathG(m_sName,ssprintf("banner frame p%i",p+1)) ); display.m_sprBannerFrame->SetName( ssprintf("BannerFrameP%i",p+1) ); - SET_XY_AND_ON_COMMAND( display.m_sprBannerFrame ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( display.m_sprBannerFrame ); this->AddChild( display.m_sprBannerFrame ); } #undef SET_ON diff --git a/stepmania/src/ScreenNetRoom.cpp b/stepmania/src/ScreenNetRoom.cpp index 4aaa493738..19590ad47c 100644 --- a/stepmania/src/ScreenNetRoom.cpp +++ b/stepmania/src/ScreenNetRoom.cpp @@ -50,20 +50,20 @@ void ScreenNetRoom::Init() m_sprTitleBG.SetName( "TitleBG" ); m_sprTitleBG.SetWidth( TITLEBG_WIDTH ); m_sprTitleBG.SetHeight( TITLEBG_HEIGHT ); - SET_XY_AND_ON_COMMAND( m_sprTitleBG ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_sprTitleBG ); this->AddChild( &m_sprTitleBG); m_textTitle.LoadFromFont( THEME->GetPathF(m_sName,"wheel") ); m_textTitle.SetShadowLength( 0 ); m_textTitle.SetName( "Title" ); m_textTitle.SetMaxWidth( TITLEBG_WIDTH ); - SET_XY_AND_ON_COMMAND( m_textTitle ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textTitle ); this->AddChild( &m_textTitle); m_RoomWheel.SetName( "RoomWheel" ); m_RoomWheel.Load( "RoomWheel" ); m_RoomWheel.BeginScreen(); - SET_XY_AND_ON_COMMAND( m_RoomWheel ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_RoomWheel ); this->AddChild( &m_RoomWheel ); m_roomInfo.SetName( "RoomInfoDisplay" ); diff --git a/stepmania/src/ScreenNetSelectBase.cpp b/stepmania/src/ScreenNetSelectBase.cpp index 90fb7d76e0..809f0f410c 100644 --- a/stepmania/src/ScreenNetSelectBase.cpp +++ b/stepmania/src/ScreenNetSelectBase.cpp @@ -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" ) ); diff --git a/stepmania/src/ScreenNetSelectMusic.cpp b/stepmania/src/ScreenNetSelectMusic.cpp index e647b34b2b..b85b88074e 100644 --- a/stepmania/src/ScreenNetSelectMusic.cpp +++ b/stepmania/src/ScreenNetSelectMusic.cpp @@ -53,7 +53,7 @@ void ScreenNetSelectMusic::Init() m_sprDiff.SetName( "DiffBG" ); m_sprDiff.SetWidth( DIFFBG_WIDTH ); m_sprDiff.SetHeight( DIFFBG_HEIGHT ); - SET_XY_AND_ON_COMMAND( m_sprDiff ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_sprDiff ); this->AddChild( &m_sprDiff); FOREACH_EnabledPlayer (p) @@ -62,20 +62,20 @@ void ScreenNetSelectMusic::Init() m_DifficultyIcon[p].Load( THEME->GetPathG( "ScreenSelectMusic", ssprintf("difficulty icons 1x%d", NUM_Difficulty)) ); - SET_XY( m_DifficultyIcon[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_DifficultyIcon[p] ); this->AddChild( &m_DifficultyIcon[p] ); ON_COMMAND( m_DifficultyIcon[p] ); m_DC[p] = GAMESTATE->m_PreferredDifficulty[p]; m_DifficultyMeters[p].SetName( ssprintf("MeterP%d",p+1) ); m_DifficultyMeters[p].Load( "DifficultyMeter" ); - SET_XY_AND_ON_COMMAND( m_DifficultyMeters[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_DifficultyMeters[p] ); this->AddChild( &m_DifficultyMeters[p] ); } m_MusicWheel.SetName( "MusicWheel" ); m_MusicWheel.Load( "MusicWheel" ); - SET_XY( m_MusicWheel ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_MusicWheel ); m_MusicWheel.BeginScreen(); ON_COMMAND( m_MusicWheel ); this->AddChild( &m_MusicWheel ); @@ -86,7 +86,7 @@ void ScreenNetSelectMusic::Init() m_BPMDisplay.SetName( "BPMDisplay" ); m_BPMDisplay.LoadFromFont( THEME->GetPathF("BPMDisplay","bpm") ); m_BPMDisplay.Load(); - SET_XY_AND_ON_COMMAND( m_BPMDisplay ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_BPMDisplay ); this->AddChild( &m_BPMDisplay ); FOREACH_EnabledPlayer( p ) @@ -94,7 +94,7 @@ void ScreenNetSelectMusic::Init() m_OptionIconRow[p].SetName( ssprintf("OptionIconsP%d",p+1) ); m_OptionIconRow[p].Load(); m_OptionIconRow[p].SetFromGameState( p ); - SET_XY_AND_ON_COMMAND( m_OptionIconRow[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_OptionIconRow[p] ); this->AddChild( &m_OptionIconRow[p] ); } diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index 6ac1db961e..f826b2b571 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -116,7 +116,7 @@ void ScreenOptions::Init() m_sprPage.Load( THEME->GetPathG(m_sName,"page") ); m_sprPage->SetName( "Page" ); - SET_XY( m_sprPage ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprPage ); m_framePage.AddChild( m_sprPage ); // init line line highlights @@ -145,7 +145,7 @@ void ScreenOptions::Init() m_textExplanation[p].LoadFromFont( THEME->GetPathF(m_sName,"explanation") ); m_textExplanation[p].SetDrawOrder( 2 ); m_textExplanation[p].SetName( "Explanation" + PlayerNumberToString(p) ); - SET_XY( m_textExplanation[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_textExplanation[p] ); m_framePage.AddChild( &m_textExplanation[p] ); } @@ -154,7 +154,7 @@ void ScreenOptions::Init() m_textExplanationTogether.LoadFromFont( THEME->GetPathF(m_sName,"explanation") ); m_textExplanationTogether.SetDrawOrder( 2 ); m_textExplanationTogether.SetName( "ExplanationTogether" ); - SET_XY( m_textExplanationTogether ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_textExplanationTogether ); m_framePage.AddChild( &m_textExplanationTogether ); break; default: @@ -169,14 +169,14 @@ void ScreenOptions::Init() m_ScrollBar.Load( "DualScrollBar" ); FOREACH_PlayerNumber( p ) m_ScrollBar.EnablePlayer( p, GAMESTATE->IsHumanPlayer(p) ); - SET_XY( m_ScrollBar ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_ScrollBar ); m_ScrollBar.SetDrawOrder( 2 ); m_framePage.AddChild( &m_ScrollBar ); } m_sprMore.Load( THEME->GetPathG( m_sName,"more") ); m_sprMore->SetName( "More" ); - SET_XY( m_sprMore ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprMore ); m_sprMore->SetDrawOrder( 2 ); m_sprMore->PlayCommand( "LoseFocus" ); m_framePage.AddChild( m_sprMore ); diff --git a/stepmania/src/ScreenPackages.cpp b/stepmania/src/ScreenPackages.cpp index eda03c7ded..e24b09ecde 100644 --- a/stepmania/src/ScreenPackages.cpp +++ b/stepmania/src/ScreenPackages.cpp @@ -42,12 +42,12 @@ void ScreenPackages::Init() m_sprExistingBG.SetName( "PackagesBG" ); m_sprExistingBG.Load( THEME->GetPathG( m_sName, "PackagesBG" ) ); - SET_XY_AND_ON_COMMAND( m_sprExistingBG ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_sprExistingBG ); this->AddChild( &m_sprExistingBG ); m_sprWebBG.SetName( "WebBG" ); m_sprWebBG.Load( THEME->GetPathG( m_sName, "WebBG" ) ); - SET_XY_AND_ON_COMMAND( m_sprWebBG ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_sprWebBG ); this->AddChild( &m_sprWebBG ); COMMAND( m_sprExistingBG, "Back" ); @@ -58,7 +58,7 @@ void ScreenPackages::Init() m_textPackages.SetShadowLength( 0 ); m_textPackages.SetName( "Packages" ); m_textPackages.SetMaxWidth( EXISTINGBG_WIDTH ); - SET_XY_AND_ON_COMMAND( m_textPackages ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textPackages ); this->AddChild( &m_textPackages ); RefreshPackages(); @@ -66,7 +66,7 @@ void ScreenPackages::Init() m_textWeb.SetShadowLength( 0 ); m_textWeb.SetName( "Web" ); m_textWeb.SetMaxWidth( WEBBG_WIDTH ); - SET_XY_AND_ON_COMMAND( m_textWeb ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textWeb ); this->AddChild( &m_textWeb); m_Links.push_back( " " ); m_LinkTitles.push_back( "--Visit URL--" ); @@ -74,31 +74,31 @@ void ScreenPackages::Init() m_textURL.LoadFromFont( THEME->GetPathF( m_sName,"default") ); m_textURL.SetShadowLength( 0 ); m_textURL.SetName( "WebURL" ); - SET_XY_AND_ON_COMMAND( m_textURL ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textURL ); this->AddChild( &m_textURL ); UpdateLinksList(); m_sprWebSel.SetName( "WebSel" ); m_sprWebSel.Load( THEME->GetPathG( m_sName, "WebSel" ) ); - SET_XY_AND_ON_COMMAND( m_sprWebSel ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_sprWebSel ); this->AddChild( &m_sprWebSel ); m_sprDLBG.SetName( "Download" ); m_sprDLBG.Load( THEME->GetPathG( m_sName, "DownloadBG" ) ); - SET_XY_AND_ON_COMMAND( m_sprDLBG ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_sprDLBG ); this->AddChild( &m_sprDLBG ); //(HTTP ELEMENTS) m_sprDL.SetName( "Download" ); m_sprDL.Load( THEME->GetPathG( m_sName, "Download" ) ); - SET_XY_AND_ON_COMMAND( m_sprDL ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_sprDL ); this->AddChild( &m_sprDL ); m_sprDL.RunCommands( THEME->GetMetricA( m_sName, "DownloadProgressCommand" ) ); m_textStatus.LoadFromFont( THEME->GetPathF(m_sName,"default") ); m_textStatus.SetShadowLength( 0 ); m_textStatus.SetName( "DownloadStatus" ); - SET_XY_AND_ON_COMMAND( m_textStatus ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textStatus ); this->AddChild( &m_textStatus ); UpdateProgress(); diff --git a/stepmania/src/ScreenPlayerOptions.cpp b/stepmania/src/ScreenPlayerOptions.cpp index 3ef64c6219..ac39cf3050 100644 --- a/stepmania/src/ScreenPlayerOptions.cpp +++ b/stepmania/src/ScreenPlayerOptions.cpp @@ -24,7 +24,7 @@ void ScreenPlayerOptions::Init() { m_sprDisqualify[p].Load( THEME->GetPathG(m_sName,"disqualify") ); m_sprDisqualify[p]->SetName( ssprintf("DisqualifyP%i",p+1) ); - SET_XY( m_sprDisqualify[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprDisqualify[p] ); m_sprDisqualify[p]->SetVisible( false ); // unhide later if handicapping options are discovered m_sprDisqualify[p]->SetDrawOrder( 2 ); m_framePage.AddChild( m_sprDisqualify[p] ); diff --git a/stepmania/src/ScreenPrompt.cpp b/stepmania/src/ScreenPrompt.cpp index ef25b0f210..988d520446 100644 --- a/stepmania/src/ScreenPrompt.cpp +++ b/stepmania/src/ScreenPrompt.cpp @@ -80,7 +80,7 @@ void ScreenPrompt::BeginScreen() ENUM_CLAMP( m_Answer, PromptAnswer(0), PromptAnswer(g_PromptType) ); m_textQuestion.SetText( g_sText ); - SET_XY_AND_ON_COMMAND( m_textQuestion ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textQuestion ); ON_COMMAND( m_sprCursor ); @@ -94,7 +94,7 @@ void ScreenPrompt::BeginScreen() sAnswer = "OK"; m_textAnswer[i].SetText( ANSWER_TEXT(sAnswer) ); - SET_XY_AND_ON_COMMAND( m_textAnswer[i] ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textAnswer[i] ); } for( int i=g_PromptType+1; iGetPathG(m_sName,ssprintf("picture%d",c+1)) ); - SET_XY( m_sprPicture[page][choice] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprPicture[page][choice] ); m_framePages.AddChild( &m_sprPicture[page][choice] ); m_sprInfo[page][choice].SetName( ssprintf("InfoPage%dChoice%d",page+1,choice+1) ); m_sprInfo[page][choice].Load( THEME->GetPathG(m_sName,ssprintf("info%d",c+1)) ); - SET_XY( m_sprInfo[page][choice] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprInfo[page][choice] ); m_framePages.AddChild( &m_sprInfo[page][choice] ); } m_sprMore[page].SetName( ssprintf("MorePage%d",page+1) ); m_sprMore[page].Load( THEME->GetPathG(m_sName,ssprintf("more page%d",page+1)) ); - SET_XY( m_sprMore[page] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprMore[page] ); m_framePages.AddChild( &m_sprMore[page] ); m_sprExplanation[page].SetName( ssprintf("ExplanationPage%d",page+1) ); m_sprExplanation[page].Load( THEME->GetPathG(m_sName,"explanation") ); m_sprExplanation[page].StopAnimating(); m_sprExplanation[page].SetState( page ); - SET_XY( m_sprExplanation[page] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprExplanation[page] ); m_framePages.AddChild( &m_sprExplanation[page] ); } @@ -109,6 +109,7 @@ void ScreenSelectDifficulty::Init() m_sprOK[p].SetName( "OK" ); m_sprOK[p].Load( THEME->GetPathG(m_sName,"ok 2x1") ); + ActorUtil::LoadAllCommands( m_sprOK[p], m_sName ); m_sprOK[p].SetState( p ); m_sprOK[p].StopAnimating(); m_sprOK[p].SetDiffuse( RageColor(1,1,1,0) ); diff --git a/stepmania/src/ScreenSelectGroup.cpp b/stepmania/src/ScreenSelectGroup.cpp index b53d96110c..0d883426c5 100644 --- a/stepmania/src/ScreenSelectGroup.cpp +++ b/stepmania/src/ScreenSelectGroup.cpp @@ -238,13 +238,13 @@ void ScreenSelectGroup::TweenOffScreen() void ScreenSelectGroup::TweenOnScreen() { - SET_XY_AND_ON_COMMAND( m_sprExplanation ); - SET_XY_AND_ON_COMMAND( m_sprFrame ); - SET_XY_AND_ON_COMMAND( m_Banner ); - SET_XY_AND_ON_COMMAND( m_textNumber ); - SET_XY_AND_ON_COMMAND( m_sprContents ); - SET_XY_AND_ON_COMMAND( m_MusicList ); - SET_XY_AND_ON_COMMAND( m_GroupList ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_sprExplanation ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_sprFrame ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_Banner ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textNumber ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_sprContents ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_MusicList ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_GroupList ); m_MusicList.TweenOnScreen(); m_GroupList.TweenOnScreen(); diff --git a/stepmania/src/ScreenSelectMaster.cpp b/stepmania/src/ScreenSelectMaster.cpp index cfac4558bb..5c49cef113 100644 --- a/stepmania/src/ScreenSelectMaster.cpp +++ b/stepmania/src/ScreenSelectMaster.cpp @@ -795,7 +795,7 @@ void ScreenSelectMaster::TweenOnScreen() m_vsprIcon[c]->PlayCommand( (int(c) == m_iChoice[0])? "GainFocus":"LoseFocus" ); m_vsprIcon[c]->FinishTweening(); if( USE_ICON_METRICS ) - SET_XY_AND_ON_COMMAND( m_vsprIcon[c] ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_vsprIcon[c] ); else m_vsprIcon[c]->PlayCommand( "On" ); } @@ -814,7 +814,7 @@ void ScreenSelectMaster::TweenOnScreen() } m_Scroller[*p].SetCurrentAndDestinationItem( (float)m_iChoice[*p] ); - SET_XY_AND_ON_COMMAND( m_Scroller[*p] ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_Scroller[*p] ); } } diff --git a/stepmania/src/ScreenSelectMode.cpp b/stepmania/src/ScreenSelectMode.cpp index 2d2071a09a..7627652f61 100644 --- a/stepmania/src/ScreenSelectMode.cpp +++ b/stepmania/src/ScreenSelectMode.cpp @@ -44,7 +44,7 @@ void ScreenSelectMode::Init() { m_iCurrentChar[pn]= -1; // minus 1 indicates no character. m_CurChar[pn].SetName(ssprintf("CharacterIconP%d",pn+1)); - SET_XY( m_CurChar[pn] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_CurChar[pn] ); } m_bSelected = false; m_ChoiceListFrame.Load( THEME->GetPathG("ScreenSelectMode","list frame")); diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 883377125d..50df626439 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -113,24 +113,24 @@ void ScreenSelectMusic::Init() m_MusicWheel.SetName( "MusicWheel" ); m_MusicWheel.Load( MUSIC_WHEEL_TYPE ); - SET_XY( m_MusicWheel ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_MusicWheel ); this->AddChild( &m_MusicWheel ); // this is loaded SetSong and TweenToSong m_Banner.SetName( "Banner" ); m_Banner.SetZTestMode( ZTEST_WRITE_ON_PASS ); // do have to pass the z test - SET_XY( m_Banner ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_Banner ); this->AddChild( &m_Banner ); m_sprCDTitleFront.SetName( "CDTitle" ); m_sprCDTitleFront.Load( THEME->GetPathG(m_sName,"fallback cdtitle") ); - SET_XY( m_sprCDTitleFront ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprCDTitleFront ); COMMAND( m_sprCDTitleFront, "Front" ); this->AddChild( &m_sprCDTitleFront ); m_sprCDTitleBack.SetName( "CDTitle" ); m_sprCDTitleBack.Load( THEME->GetPathG(m_sName,"fallback cdtitle") ); - SET_XY( m_sprCDTitleBack ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprCDTitleBack ); COMMAND( m_sprCDTitleBack, "Back" ); this->AddChild( &m_sprCDTitleBack ); @@ -138,14 +138,14 @@ void ScreenSelectMusic::Init() { m_sprHighScoreFrame[p].SetName( ssprintf("ScoreFrameP%d",p+1) ); m_sprHighScoreFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("score frame p%d",p+1)) ); - SET_XY( m_sprHighScoreFrame[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprHighScoreFrame[p] ); this->AddChild( &m_sprHighScoreFrame[p] ); m_textHighScore[p].SetName( ssprintf("ScoreP%d",p+1) ); m_textHighScore[p].LoadFromFont( THEME->GetPathF(m_sName,"score") ); m_textHighScore[p].SetShadowLength( 0 ); m_textHighScore[p].RunCommands( CommonMetrics::PLAYER_COLOR.GetValue(p) ); - SET_XY( m_textHighScore[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_textHighScore[p] ); this->AddChild( &m_textHighScore[p] ); } diff --git a/stepmania/src/ScreenSelectStyle.cpp b/stepmania/src/ScreenSelectStyle.cpp index db0dd6ca22..64a595af44 100644 --- a/stepmania/src/ScreenSelectStyle.cpp +++ b/stepmania/src/ScreenSelectStyle.cpp @@ -121,12 +121,12 @@ void ScreenSelectStyle::Init() // for( unsigned i=0; iGetPathF(m_sName,"stats") ); m_textStats.SetName( "Stats" ); - SET_XY_AND_ON_COMMAND( m_textStats ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textStats ); this->AddChild( &m_textStats ); /* "Was that a skip?" This displays a message when an update takes diff --git a/stepmania/src/ScreenTestFonts.cpp b/stepmania/src/ScreenTestFonts.cpp index 12fe9ffae8..23b339c455 100644 --- a/stepmania/src/ScreenTestFonts.cpp +++ b/stepmania/src/ScreenTestFonts.cpp @@ -52,7 +52,7 @@ void ScreenTestFonts::Init() txt.SetName( "Text" ); SetFont( THEME->GetPathF("", FONT(1)) ); - SET_XY_AND_ON_COMMAND( txt ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( txt ); SetText( "Foo" ); } diff --git a/stepmania/src/ScreenTestLights.cpp b/stepmania/src/ScreenTestLights.cpp index a492fb97a2..eb77ff1126 100644 --- a/stepmania/src/ScreenTestLights.cpp +++ b/stepmania/src/ScreenTestLights.cpp @@ -22,7 +22,7 @@ void ScreenTestLights::Init() m_textInputs.SetName( "Text" ); m_textInputs.LoadFromFont( THEME->GetPathF("Common","normal") ); m_textInputs.SetText( "" ); - SET_XY_AND_ON_COMMAND( m_textInputs ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textInputs ); this->AddChild( &m_textInputs ); } diff --git a/stepmania/src/ScreenTextEntry.cpp b/stepmania/src/ScreenTextEntry.cpp index 3587e1c239..d10316c874 100644 --- a/stepmania/src/ScreenTextEntry.cpp +++ b/stepmania/src/ScreenTextEntry.cpp @@ -135,8 +135,8 @@ void ScreenTextEntry::BeginScreen() ScreenWithMenuElements::BeginScreen(); m_textQuestion.SetText( g_sQuestion ); - SET_XY_AND_ON_COMMAND( m_textQuestion ); - SET_XY_AND_ON_COMMAND( m_textAnswer ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textQuestion ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textAnswer ); UpdateAnswerText(); } diff --git a/stepmania/src/ScreenUnlockBrowse.cpp b/stepmania/src/ScreenUnlockBrowse.cpp index 103db4bd71..d356479fc8 100644 --- a/stepmania/src/ScreenUnlockBrowse.cpp +++ b/stepmania/src/ScreenUnlockBrowse.cpp @@ -52,7 +52,7 @@ void ScreenUnlockBrowse::MenuStart( const InputEventPlus &input ) void ScreenUnlockBrowse::TweenOnScreen() { - SET_XY_AND_ON_COMMAND( m_banner ); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_banner ); ScreenSelectMaster::TweenOnScreen(); } diff --git a/stepmania/src/ScreenUnlockStatus.cpp b/stepmania/src/ScreenUnlockStatus.cpp index 897b7b24c3..5d66111040 100644 --- a/stepmania/src/ScreenUnlockStatus.cpp +++ b/stepmania/src/ScreenUnlockStatus.cpp @@ -60,7 +60,7 @@ void ScreenUnlockStatus::Init() // set graphic location pSpr->SetName( ssprintf("Unlock%04d",i) ); - SET_XY( pSpr ); + LOAD_ALL_COMMANDS_AND_SET_XY( pSpr ); pSpr->RunCommands(IconCommand); Unlocks.push_back(pSpr); @@ -303,7 +303,7 @@ void ScreenUnlockStatus::Init() } PointsUntilNextUnlock.SetZoom( POINTS_ZOOM ); - SET_XY( PointsUntilNextUnlock ); + LOAD_ALL_COMMANDS_AND_SET_XY( PointsUntilNextUnlock ); this->AddChild( &PointsUntilNextUnlock ); this->ClearMessageQueue( SM_BeginFadingOut ); // ignore ScreenAttract's SecsToShow diff --git a/stepmania/src/ScreenWithMenuElements.cpp b/stepmania/src/ScreenWithMenuElements.cpp index 15c1d592cf..455a849168 100644 --- a/stepmania/src/ScreenWithMenuElements.cpp +++ b/stepmania/src/ScreenWithMenuElements.cpp @@ -42,14 +42,14 @@ void ScreenWithMenuElements::Init() m_autoHeader.Load( THEME->GetPathG(m_sName,"header") ); m_autoHeader->SetName("Header"); - SET_XY( m_autoHeader ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_autoHeader ); this->AddChild( m_autoHeader ); if( SHOW_STAGE ) { m_sprStage.Load( THEME->GetPathG(m_sName,"stage") ); m_sprStage->SetName( "Stage" ); - SET_XY( m_sprStage ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprStage ); this->AddChild( m_sprStage ); } @@ -61,7 +61,7 @@ void ScreenWithMenuElements::Init() m_MemoryCardDisplay[p] = new MemoryCardDisplay; m_MemoryCardDisplay[p]->Load( p ); m_MemoryCardDisplay[p]->SetName( ssprintf("MemoryCardDisplayP%d",p+1) ); - SET_XY( m_MemoryCardDisplay[p] ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_MemoryCardDisplay[p] ); this->AddChild( m_MemoryCardDisplay[p] ); } } @@ -74,33 +74,33 @@ void ScreenWithMenuElements::Init() m_MenuTimer->SetName( "Timer" ); if( TIMER_STEALTH ) m_MenuTimer->EnableStealth( true ); - SET_XY( m_MenuTimer ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_MenuTimer ); ResetTimer(); this->AddChild( m_MenuTimer ); } m_autoFooter.Load( THEME->GetPathG(m_sName,"footer") ); m_autoFooter->SetName("Footer"); - SET_XY( m_autoFooter ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_autoFooter ); this->AddChild( m_autoFooter ); m_textHelp->SetName( "Help" ); m_textHelp->Load( "HelpDisplay" ); m_textHelp->LoadFromFont( THEME->GetPathF("HelpDisplay","text") ); - SET_XY( m_textHelp ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_textHelp ); LoadHelpText(); this->AddChild( m_textHelp ); m_sprUnderlay.Load( THEME->GetPathB(m_sName,"underlay") ); m_sprUnderlay->SetName("Underlay"); m_sprUnderlay->SetDrawOrder( DRAW_ORDER_UNDERLAY ); - SET_XY( m_sprUnderlay ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprUnderlay ); this->AddChild( m_sprUnderlay ); m_sprOverlay.Load( THEME->GetPathB(m_sName,"overlay") ); m_sprOverlay->SetName("Overlay"); m_sprOverlay->SetDrawOrder( DRAW_ORDER_OVERLAY ); - SET_XY( m_sprOverlay ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprOverlay ); this->AddChild( m_sprOverlay ); m_In.SetName( "In" ); diff --git a/stepmania/src/TextBanner.cpp b/stepmania/src/TextBanner.cpp index 3fb26593d8..69ede6704b 100644 --- a/stepmania/src/TextBanner.cpp +++ b/stepmania/src/TextBanner.cpp @@ -33,9 +33,9 @@ void TextBanner::Load( RString sType ) THREE_LINES_SUBTITLE_COMMAND .Load(sType,"ThreeLinesSubtitleCommand"); THREE_LINES_ARTIST_COMMAND .Load(sType,"ThreeLinesArtistCommand"); - ActorUtil::SetXYAndOnCommand( m_textTitle, sType ); - ActorUtil::SetXYAndOnCommand( m_textSubTitle, sType ); - ActorUtil::SetXYAndOnCommand( m_textArtist, sType ); + ActorUtil::LoadAllCommandsAndSetXYAndOnCommand( m_textTitle, sType ); + ActorUtil::LoadAllCommandsAndSetXYAndOnCommand( m_textSubTitle, sType ); + ActorUtil::LoadAllCommandsAndSetXYAndOnCommand( m_textArtist, sType ); } TextBanner::TextBanner()