From 315daef12739cac8dec18ab22913ea3e3a3374e3 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 27 Sep 2003 03:11:37 +0000 Subject: [PATCH] use ModeChoice::IsPlayable --- stepmania/src/ScreenSelectDifficulty.cpp | 10 +++++----- stepmania/src/ScreenSelectMaster.cpp | 2 +- stepmania/src/ScreenSelectStyle.cpp | 8 ++++---- stepmania/src/ScreenTitleMenu.cpp | 8 +++++--- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/stepmania/src/ScreenSelectDifficulty.cpp b/stepmania/src/ScreenSelectDifficulty.cpp index ae6e6e539c..237415850e 100644 --- a/stepmania/src/ScreenSelectDifficulty.cpp +++ b/stepmania/src/ScreenSelectDifficulty.cpp @@ -164,7 +164,7 @@ void ScreenSelectDifficulty::UpdateSelectableChoices() { /* If the icon is text, use a dimmer diffuse, or we won't be * able to see the glow. */ - if( GAMESTATE->IsPlayable(m_ModeChoices[page][i]) ) + if( m_ModeChoices[page][i].IsPlayable() ) { m_sprInfo[page][i].SetDiffuse( RageColor(1,1,1,1) ); m_sprPicture[page][i].SetDiffuse( RageColor(1,1,1,1) ); @@ -198,7 +198,7 @@ void ScreenSelectDifficulty::MenuLeft( PlayerNumber pn ) int iSwitchToIndex = -1; for( int i=m_iChoiceOnPage[pn]-1; i>=0; i-- ) { - if( GAMESTATE->IsPlayable(m_ModeChoices[m_CurrentPage][i])) + if( m_ModeChoices[m_CurrentPage][i].IsPlayable() ) { iSwitchToIndex = i; break; @@ -226,7 +226,7 @@ void ScreenSelectDifficulty::MenuRight( PlayerNumber pn ) int iSwitchToIndex = -1; for( int i=m_iChoiceOnPage[pn]+1; i<(int) m_ModeChoices[m_CurrentPage].size(); i++ ) { - if( GAMESTATE->IsPlayable(m_ModeChoices[m_CurrentPage][i])) + if( m_ModeChoices[m_CurrentPage][i].IsPlayable() ) { iSwitchToIndex = i; break; @@ -270,7 +270,7 @@ void ScreenSelectDifficulty::ChangePage( Page newPage ) if( !bPageIncreasing ) { for( int i=m_ModeChoices[newPage].size()-1; i>=0; i-- ) { - if( GAMESTATE->IsPlayable(m_ModeChoices[newPage][i])) + if( m_ModeChoices[newPage][i].IsPlayable() ) { iSwitchToIndex = i; break; @@ -279,7 +279,7 @@ void ScreenSelectDifficulty::ChangePage( Page newPage ) } else { for( unsigned i=0; iIsPlayable(m_ModeChoices[newPage][i])) + if( m_ModeChoices[newPage][i].IsPlayable() ) { iSwitchToIndex = i; break; diff --git a/stepmania/src/ScreenSelectMaster.cpp b/stepmania/src/ScreenSelectMaster.cpp index e01029c154..29a3ccb9ef 100644 --- a/stepmania/src/ScreenSelectMaster.cpp +++ b/stepmania/src/ScreenSelectMaster.cpp @@ -204,7 +204,7 @@ void ScreenSelectMaster::UpdateSelectableChoices() * will be undone by the tween. Hmm. */ for( unsigned c=0; cIsPlayable(m_aModeChoices[c]) ) + if( m_aModeChoices[c].IsPlayable() ) for( int i=0; i=0; i-- ) { - if( GAMESTATE->IsPlayable(m_aModeChoices[i]) ) + if( m_aModeChoices[i].IsPlayable() ) { iSwitchToIndex = i; break; @@ -160,7 +160,7 @@ void ScreenSelectStyle::MenuRight( PlayerNumber pn ) int iSwitchToIndex = -1; // -1 means none found for( unsigned i=m_iSelection+1; iIsPlayable(m_aModeChoices[i]) ) + if( m_aModeChoices[i].IsPlayable() ) { iSwitchToIndex = i; break; @@ -223,7 +223,7 @@ void ScreenSelectStyle::UpdateSelectableChoices() { /* If the icon is text, use a dimmer diffuse, or we won't be * able to see the glow. */ - if( GAMESTATE->IsPlayable(m_aModeChoices[i]) ) + if( m_aModeChoices[i].IsPlayable() ) { m_sprIcon[i].SetDiffuse( RageColor(1,1,1,1) ); m_textIcon[i].SetDiffuse( RageColor(0.5f,0.5f,0.5f,1) ); // gray so glow is visible @@ -241,7 +241,7 @@ void ScreenSelectStyle::UpdateSelectableChoices() int iSwitchToStyleIndex = -1; // -1 means none found for( i=0; iIsPlayable(m_aModeChoices[i]) ) + if( m_aModeChoices[i].IsPlayable() ) { iSwitchToStyleIndex = i; break; diff --git a/stepmania/src/ScreenTitleMenu.cpp b/stepmania/src/ScreenTitleMenu.cpp index 594489fba4..e3a14c2227 100644 --- a/stepmania/src/ScreenTitleMenu.cpp +++ b/stepmania/src/ScreenTitleMenu.cpp @@ -222,11 +222,13 @@ void ScreenTitleMenu::Input( const DeviceInput& DeviceI, const InputEventType ty case MENU_BUTTON_START: /* return if the choice is invalid */ const ModeChoice &mc = m_aModeChoices[m_Choice]; - if( mc.m_bInvalid ) + CString why; + + if( !mc.IsPlayable( &why ) ) { m_soundInvalid.Play(); - if( mc.m_sInvalidReason != "" ) - SCREENMAN->SystemMessage( mc.m_sInvalidReason ); + if( why != "" ) + SCREENMAN->SystemMessage( why ); return; }