cleanup: override SM_GoToNextScreen instead of having a different path

This commit is contained in:
Glenn Maynard
2005-07-12 06:33:00 +00:00
parent 57cef3fb5a
commit c570457834
20 changed files with 260 additions and 267 deletions
+52 -52
View File
@@ -86,6 +86,58 @@ void ScreenCourseManager::Init()
void ScreenCourseManager::HandleScreenMessage( const ScreenMessage SM )
{
if( SM == SM_GoToNextScreen )
{
switch( m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber] )
{
default:
ASSERT(0);
case ROW_COURSE_GROUP:
SCREENMAN->PlayInvalidSound();
break;
case ROW_COURSE:
SCREENMAN->PlayInvalidSound();
break;
case ROW_ACTION:
{
OptionRow &row = *m_pRows[ROW_ACTION];
int iChoice = row.GetChoiceInRowWithFocus( GAMESTATE->m_MasterPlayerNumber );
vector<CourseManagerAction> vActions;
GetPossibleActions( vActions );
CourseManagerAction action = vActions[iChoice];
switch( action )
{
default:
ASSERT(0);
case ACTION_EDIT:
GAMESTATE->m_iEditCourseEntryIndex.Set( 0 );
SCREENMAN->SetNewScreen( "ScreenEditCourse" );
break;
case ACTION_DELETE:
SCREENMAN->PlayInvalidSound();
break;
case ACTION_COPY_TO_NEW:
SCREENMAN->PlayInvalidSound();
break;
case ACTION_CREATE_NEW:
SCREENMAN->PlayInvalidSound();
break;
}
}
break;
case ROW_DONE:
SCREENMAN->SetNewScreen( FIRST_ATTRACT_SCREEN );
break;
}
return;
}
else if( SM == SM_GoToPrevScreen )
{
SCREENMAN->SetNewScreen( FIRST_ATTRACT_SCREEN );
return;
}
ScreenOptions::HandleScreenMessage( SM );
}
@@ -178,58 +230,6 @@ void ScreenCourseManager::ExportOptions( int row, const vector<PlayerNumber> &vp
}
void ScreenCourseManager::GoToNextScreen()
{
switch( m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber] )
{
default:
ASSERT(0);
case ROW_COURSE_GROUP:
SCREENMAN->PlayInvalidSound();
break;
case ROW_COURSE:
SCREENMAN->PlayInvalidSound();
break;
case ROW_ACTION:
{
OptionRow &row = *m_pRows[ROW_ACTION];
int iChoice = row.GetChoiceInRowWithFocus( GAMESTATE->m_MasterPlayerNumber );
vector<CourseManagerAction> vActions;
GetPossibleActions( vActions );
CourseManagerAction action = vActions[iChoice];
switch( action )
{
default:
ASSERT(0);
case ACTION_EDIT:
GAMESTATE->m_iEditCourseEntryIndex.Set( 0 );
SCREENMAN->SetNewScreen( "ScreenEditCourse" );
break;
case ACTION_DELETE:
SCREENMAN->PlayInvalidSound();
break;
case ACTION_COPY_TO_NEW:
SCREENMAN->PlayInvalidSound();
break;
case ACTION_CREATE_NEW:
SCREENMAN->PlayInvalidSound();
break;
}
}
break;
case ROW_DONE:
SCREENMAN->SetNewScreen( FIRST_ATTRACT_SCREEN );
break;
}
}
void ScreenCourseManager::GoToPrevScreen()
{
SCREENMAN->SetNewScreen( FIRST_ATTRACT_SCREEN );
}
/*
* (c) 2002-2004 Chris Danford
* All rights reserved.