diff --git a/stepmania/src/TextBanner.cpp b/stepmania/src/TextBanner.cpp index f631b93222..ffdc31f340 100644 --- a/stepmania/src/TextBanner.cpp +++ b/stepmania/src/TextBanner.cpp @@ -56,12 +56,12 @@ void TextBanner::Load( RString sType ) m_textArtist.LoadFromFont( THEME->GetPathF(sType,"text") ); this->AddChild( &m_textArtist ); - AddCommand( "Set", THEME->GetMetricA(sType,"SetCommand") ); + AddCommand( "AfterSet", THEME->GetMetricA(sType,"AfterSetCommand") ); m_sArtistPrependString = THEME->GetMetric(sType,"ArtistPrependString"); - ActorUtil::LoadAllCommandsAndSetXYAndOnCommand( m_textTitle, sType ); - ActorUtil::LoadAllCommandsAndSetXYAndOnCommand( m_textSubTitle, sType ); - ActorUtil::LoadAllCommandsAndSetXYAndOnCommand( m_textArtist, sType ); + ActorUtil::LoadAllCommandsAndOnCommand( m_textTitle, sType ); + ActorUtil::LoadAllCommandsAndOnCommand( m_textSubTitle, sType ); + ActorUtil::LoadAllCommandsAndOnCommand( m_textArtist, sType ); } TextBanner::TextBanner() @@ -82,7 +82,7 @@ TextBanner::TextBanner( const TextBanner &cpy ): this->AddChild( &m_textArtist ); } -void TextBanner::LoadFromString( +void TextBanner::SetFromString( const RString &sDisplayTitle, const RString &sTranslitTitle, const RString &sDisplaySubTitle, const RString &sTranslitSubTitle, const RString &sDisplayArtist, const RString &sTranslitArtist ) @@ -93,17 +93,18 @@ void TextBanner::LoadFromString( m_textSubTitle.SetText( sDisplaySubTitle, sTranslitSubTitle ); m_textArtist.SetText( sDisplayArtist, sTranslitArtist ); - // Set command is called by parent on the whole music wheel item + Message msg("AfterSet"); + this->PlayCommandNoRecurse( msg ); } -void TextBanner::LoadFromSong( const Song *pSong ) +void TextBanner::SetFromSong( const Song *pSong ) { if( pSong == NULL ) { - LoadFromString( "", "", "", "", "", "" ); + SetFromString( "", "", "", "", "", "" ); return; } - LoadFromString( pSong->GetDisplayMainTitle(), pSong->GetTranslitMainTitle(), + SetFromString( pSong->GetDisplayMainTitle(), pSong->GetTranslitMainTitle(), pSong->GetDisplaySubTitle(), pSong->GetTranslitSubTitle(), m_sArtistPrependString + pSong->GetDisplayArtist(), m_sArtistPrependString + pSong->GetTranslitArtist() ); } @@ -114,14 +115,14 @@ void TextBanner::LoadFromSong( const Song *pSong ) class LunaTextBanner: public Luna { public: - static int LoadFromSong( T* p, lua_State *L ) + static int SetFromSong( T* p, lua_State *L ) { Song *pSong = Luna::check(L,1); - p->LoadFromSong( pSong ); + p->SetFromSong( pSong ); return 0; } - static int LoadFromString( T* p, lua_State *L ) + static int SetFromString( T* p, lua_State *L ) { RString sDisplayTitle = SArg(1); RString sTranslitTitle = SArg(2); @@ -129,14 +130,14 @@ public: RString sTranslitSubTitle = SArg(4); RString sDisplayArtist = SArg(5); RString sTranslitArtist = SArg(6); - p->LoadFromString( sDisplayTitle, sTranslitTitle, sDisplaySubTitle, sTranslitSubTitle, sDisplayArtist, sTranslitArtist ); + p->SetFromString( sDisplayTitle, sTranslitTitle, sDisplaySubTitle, sTranslitSubTitle, sDisplayArtist, sTranslitArtist ); return 0; } LunaTextBanner() { - ADD_METHOD( LoadFromSong ); - ADD_METHOD( LoadFromString ); + ADD_METHOD( SetFromSong ); + ADD_METHOD( SetFromString ); } }; diff --git a/stepmania/src/TextBanner.h b/stepmania/src/TextBanner.h index c6b7f662ca..6254b70d80 100644 --- a/stepmania/src/TextBanner.h +++ b/stepmania/src/TextBanner.h @@ -16,8 +16,8 @@ public: void LoadFromNode( const XNode* pNode ); void Load( RString sType ); // load metrics - void LoadFromSong( const Song *pSong ); - void LoadFromString( + void SetFromSong( const Song *pSong ); + void SetFromString( const RString &sDisplayTitle, const RString &sTranslitTitle, const RString &sDisplaySubTitle, const RString &sTranslitSubTitle, const RString &sDisplayArtist, const RString &sTranslitArtist );