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
+2 -2
View File
@@ -99,7 +99,7 @@ void ScreenManager::ThemeChanged()
m_SystemLayer = new ScreenSystemLayer;
m_SystemLayer->Init();
m_SystemLayer->ReloadCreditsText();
m_SystemLayer->RefreshCreditsMessages();
this->RefreshCreditsMessages();
}
void ScreenManager::EmptyDeleteQueue()
@@ -533,7 +533,7 @@ void ScreenManager::SystemMessageNoAnimate( const CString &sMessage )
void ScreenManager::RefreshCreditsMessages()
{
m_SystemLayer->RefreshCreditsMessages();
MESSAGEMAN->Broadcast( "RefreshCreditText" );
/* This is called when GAMESTATE->m_bSideIsJoined changes. */
CString joined;
+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 )
+3 -1
View File
@@ -13,11 +13,13 @@ class ScreenSystemLayer : public Screen
{
public:
ScreenSystemLayer();
virtual ~ScreenSystemLayer();
virtual void Init();
void HandleMessage( const CString &sCommandName );
void SystemMessage( const CString &sMessage );
void SystemMessageNoAnimate( const CString &sMessage );
void ReloadCreditsText();
void RefreshCreditsMessages();
void Update( float fDeltaTime );
private: