use ModeChoice::IsPlayable

This commit is contained in:
Glenn Maynard
2003-09-27 03:11:37 +00:00
parent 53c0a7b02e
commit 315daef127
4 changed files with 15 additions and 13 deletions
+5 -5
View File
@@ -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; i<m_ModeChoices[newPage].size(); i++ )
{
if( GAMESTATE->IsPlayable(m_ModeChoices[newPage][i]))
if( m_ModeChoices[newPage][i].IsPlayable() )
{
iSwitchToIndex = i;
break;
+1 -1
View File
@@ -204,7 +204,7 @@ void ScreenSelectMaster::UpdateSelectableChoices()
* will be undone by the tween. Hmm. */
for( unsigned c=0; c<m_aModeChoices.size(); c++ )
{
if( GAMESTATE->IsPlayable(m_aModeChoices[c]) )
if( m_aModeChoices[c].IsPlayable() )
for( int i=0; i<NUM_ICON_PARTS; i++ )
m_sprIcon[i][c].SetDiffuse( RageColor(1,1,1,1) );
else
+4 -4
View File
@@ -139,7 +139,7 @@ void ScreenSelectStyle::MenuLeft( PlayerNumber pn )
int iSwitchToIndex = -1; // -1 means none found
for( int i=m_iSelection-1; 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; i<m_aModeChoices.size(); i++ )
{
if( GAMESTATE->IsPlayable(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; i<m_aModeChoices.size(); i++ )
{
if( GAMESTATE->IsPlayable(m_aModeChoices[i]) )
if( m_aModeChoices[i].IsPlayable() )
{
iSwitchToStyleIndex = i;
break;
+5 -3
View File
@@ -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;
}