use a message to communicate credits line changes

This commit is contained in:
Glenn Maynard
2005-02-28 05:01:50 +00:00
parent 3a57d2559e
commit 7aef68aa7b
3 changed files with 20 additions and 7 deletions
+15 -4
View File
@@ -31,6 +31,12 @@
//REGISTER_SCREEN_CLASS( ScreenSystemLayer );
ScreenSystemLayer::ScreenSystemLayer() : Screen("ScreenSystemLayer")
{
MESSAGEMAN->Subscribe( this, "RefreshCreditText" );
}
ScreenSystemLayer::~ScreenSystemLayer()
{
MESSAGEMAN->Unsubscribe( this, "RefreshCreditText" );
}
void ScreenSystemLayer::Init()
@@ -210,11 +216,16 @@ CString ScreenSystemLayer::GetCreditsMessage( PlayerNumber pn ) const
}
}
void ScreenSystemLayer::RefreshCreditsMessages()
void ScreenSystemLayer::HandleMessage( const CString &sMessage )
{
// update joined
FOREACH_PlayerNumber( pn )
m_textCredits[pn].SetText( GetCreditsMessage(pn) );
if( sMessage == "RefreshCreditText" )
{
// update joined
FOREACH_PlayerNumber( pn )
m_textCredits[pn].SetText( GetCreditsMessage(pn) );
}
Screen::HandleMessage( sMessage );
}
void ScreenSystemLayer::AddTimestampLine( const CString &txt, const RageColor &color )