allow updating selections on a message

This commit is contained in:
Glenn Maynard
2005-03-10 19:41:37 +00:00
parent 2567f5992b
commit 22d64c8fd9
2 changed files with 19 additions and 0 deletions
+17
View File
@@ -27,6 +27,7 @@
#define NEXT_SCREEN( c ) THEME->GetMetric (m_sName,ssprintf("NextScreen%d",c+1))
#define IDLE_TIMEOUT_SCREEN THEME->GetMetric (m_sName,"IdleTimeoutScreen")
#define ALLOW_DISABLED_PLAYER_INPUT THEME->GetMetricB(m_sName,"AllowDisabledPlayerInput")
#define UPDATE_ON_MESSAGE THEME->GetMetric (m_sName,"UpdateOnMessage")
ScreenSelect::ScreenSelect( CString sClassName ) :
ScreenWithMenuElements(sClassName),
@@ -40,6 +41,13 @@ void ScreenSelect::Init()
{
ScreenWithMenuElements::Init();
//
// Load messages to update on
//
split( UPDATE_ON_MESSAGE, ",", m_asSubscribedMessages );
for( unsigned i = 0; i < m_asSubscribedMessages.size(); ++i )
MESSAGEMAN->Subscribe( this, m_asSubscribedMessages[i] );
//
// Load choices
//
@@ -95,6 +103,8 @@ void ScreenSelect::Init()
ScreenSelect::~ScreenSelect()
{
LOG->Trace( "ScreenSelect::~ScreenSelect()" );
for( unsigned i = 0; i < m_asSubscribedMessages.size(); ++i )
MESSAGEMAN->Unsubscribe( this, m_asSubscribedMessages[i] );
}
void ScreenSelect::Update( float fDelta )
@@ -248,6 +258,13 @@ void ScreenSelect::HandleScreenMessage( const ScreenMessage SM )
Screen::HandleScreenMessage( SM );
}
void ScreenSelect::HandleMessage( const CString &sMessage )
{
this->UpdateSelectableChoices();
Screen::HandleMessage( sMessage );
}
void ScreenSelect::MenuBack( PlayerNumber pn )
{
SOUND->StopMusic();
+2
View File
@@ -22,6 +22,7 @@ public:
virtual void DrawPrimitives();
virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
virtual void HandleScreenMessage( const ScreenMessage SM );
virtual void HandleMessage( const CString &sMessage );
virtual void MenuBack( PlayerNumber pn );
@@ -33,6 +34,7 @@ protected:
vector<CodeItem> m_aCodes;
vector<GameCommand> m_aCodeChoices;
vector<CString> m_asSubscribedMessages;
RageTimer m_timerIdleComment; // count up to time between idle comment announcer sounds
RageTimer m_timerIdleTimeout; // count up to go to the timeout screen