switch -> if

This commit is contained in:
Glenn Maynard
2006-02-24 00:20:41 +00:00
parent 2d27c7e037
commit 0ad99bffc2
8 changed files with 40 additions and 52 deletions
+7 -7
View File
@@ -208,24 +208,24 @@ void Screen::Input( const InputEventPlus &input )
void Screen::HandleScreenMessage( const ScreenMessage SM )
{
switch( SM )
if( SM == SM_MenuTimer )
{
case SM_MenuTimer:
FOREACH_HumanPlayer(p)
MenuStart( p );
break;
case SM_GoToNextScreen:
}
else if( SM == SM_GoToNextScreen )
{
if( SCREENMAN->IsStackedScreen(this) )
SCREENMAN->PopTopScreen( m_smSendOnPop );
else
SCREENMAN->SetNewScreen( GetNextScreen() );
break;
case SM_GoToPrevScreen:
}
else if( SM == SM_GoToPrevScreen )
{
if( SCREENMAN->IsStackedScreen(this) )
SCREENMAN->PopTopScreen( m_smSendOnPop );
else
SCREENMAN->SetNewScreen( GetPrevScreen() );
break;
}
}
+1 -3
View File
@@ -113,16 +113,14 @@ void ScreenEz2SelectPlayer::HandleScreenMessage( const ScreenMessage SM )
{
Screen::HandleScreenMessage( SM );
switch( SM )
if( SM == SM_MenuTimer )
{
case SM_MenuTimer:
if( GAMESTATE->GetNumSidesJoined() == 0 )
{
MenuStart(PLAYER_1);
}
StartTransitioningScreen( SM_GoToNextScreen );
break;
}
ScreenWithMenuElements::HandleScreenMessage( SM );
+7 -7
View File
@@ -280,18 +280,18 @@ void ScreenHowToPlay::Update( float fDelta )
void ScreenHowToPlay::HandleScreenMessage( const ScreenMessage SM )
{
switch( SM )
if( SM == SM_GainFocus )
{
case SM_GainFocus:
/* We do this ourself. */
SOUND->HandleSongTimer( false );
break;
case SM_LoseFocus:
}
else if( SM == SM_LoseFocus )
{
SOUND->HandleSongTimer( true );
break;
case SM_GoToNextScreen:
}
else if( SM == SM_GoToNextScreen )
{
GAMESTATE->Reset();
break;
}
ScreenAttract::HandleScreenMessage( SM );
}
+12 -15
View File
@@ -366,28 +366,25 @@ void ScreenNameEntry::Input( const InputEventPlus &input )
void ScreenNameEntry::HandleScreenMessage( const ScreenMessage SM )
{
switch( SM )
if( SM == SM_MenuTimer )
{
case SM_MenuTimer:
if( !m_Out.IsTransitioning() )
{
FOREACH_PlayerNumber( p )
this->MenuStart( p );
}
break;
case SM_GoToNextScreen:
{
GAMESTATE->RestoreSelectedOptions();
}
else if( SM == SM_GoToNextScreen )
{
GAMESTATE->RestoreSelectedOptions();
// There shouldn't be NameEntry in event mode. -Chris
// /* Hack: go back to the select course screen in event mode. */
// if( GAMESTATE->GetEventMode() && GAMESTATE->IsCourseMode() )
// {
// SCREENMAN->SetNewScreen( "ScreenSelectCourse" );
// break;
// }
}
break;
// There shouldn't be NameEntry in event mode. -Chris
// /* Hack: go back to the select course screen in event mode. */
// if( GAMESTATE->GetEventMode() && GAMESTATE->IsCourseMode() )
// {
// SCREENMAN->SetNewScreen( "ScreenSelectCourse" );
// break;
// }
}
Screen::HandleScreenMessage( SM );
+8 -6
View File
@@ -172,18 +172,20 @@ void ScreenSelectCharacter::Input( const InputEventPlus &input )
void ScreenSelectCharacter::HandleScreenMessage( const ScreenMessage SM )
{
switch( SM )
if( SM == SM_BeginFadingOut )
{
case SM_BeginFadingOut:
StartTransitioningScreen( SM_GoToNextScreen );
return;
case SM_MenuTimer:
}
else if( SM == SM_MenuTimer )
{
MenuStart(PLAYER_1);
if( !AllAreFinishedChoosing() )
ResetTimer();
return;
}
Screen::HandleScreenMessage( SM );
else
{
Screen::HandleScreenMessage( SM );
}
}
PlayerNumber ScreenSelectCharacter::GetAffectedPlayerNumber( PlayerNumber pn )
+1 -2
View File
@@ -138,9 +138,8 @@ void ScreenSelectGroup::Input( const InputEventPlus &input )
void ScreenSelectGroup::HandleScreenMessage( const ScreenMessage SM )
{
switch( SM )
if( SM == SM_BeginFadingOut )
{
case SM_BeginFadingOut:
StartTransitioningScreen( SM_GoToNextScreen );
return;
}
+3 -7
View File
@@ -243,14 +243,10 @@ void ScreenSelectMode::UpdateSelectableChoices()
void ScreenSelectMode::HandleScreenMessage( const ScreenMessage SM )
{
switch( SM )
if( SM == SM_MenuTimer )
{
case SM_MenuTimer:
{
m_bSelected = true;
SetCharacters();
}
break;
m_bSelected = true;
SetCharacters();
}
ScreenSelect::HandleScreenMessage(SM);
}
+1 -5
View File
@@ -98,12 +98,8 @@ void ScreenTestLights::Input( const InputEventPlus &input )
void ScreenTestLights::HandleScreenMessage( const ScreenMessage SM )
{
switch( SM )
{
case SM_LoseFocus:
if( SM == SM_LoseFocus )
LIGHTSMAN->SetLightsMode( LIGHTSMODE_MENU );
break;
}
}
void ScreenTestLights::MenuLeft( PlayerNumber pn )