play nice with ShowExitRow=0

This commit is contained in:
Chris Danford
2005-08-15 16:00:41 +00:00
parent c12b9f504f
commit e18838aafa
@@ -114,6 +114,7 @@ void ScreenOptionsManageProfiles::Init()
{ {
ScreenOptions::Init(); ScreenOptions::Init();
SetNavigation( NAV_THREE_KEY_MENU );
SetInputMode( INPUTMODE_SHARE_CURSOR ); SetInputMode( INPUTMODE_SHARE_CURSOR );
m_pContextMenu = new ScreenMiniMenu( g_TempMenu.sClassName ); m_pContextMenu = new ScreenMiniMenu( g_TempMenu.sClassName );
@@ -195,7 +196,8 @@ void ScreenOptionsManageProfiles::HandleScreenMessage( const ScreenMessage SM )
if( SM == SM_GoToNextScreen ) if( SM == SM_GoToNextScreen )
{ {
int iCurRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; int iCurRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber];
if( iCurRow == (int)m_pRows.size() - 1 ) OptionRow &row = *m_pRows[iCurRow];
if( row.GetRowType() == OptionRow::ROW_EXIT )
{ {
this->HandleScreenMessage( SM_GoToPrevScreen ); this->HandleScreenMessage( SM_GoToPrevScreen );
return; // don't call base return; // don't call base
@@ -315,6 +317,7 @@ void ScreenOptionsManageProfiles::AfterChangeRow( PlayerNumber pn )
void ScreenOptionsManageProfiles::ProcessMenuStart( PlayerNumber pn, const InputEventType type ) void ScreenOptionsManageProfiles::ProcessMenuStart( PlayerNumber pn, const InputEventType type )
{ {
int iCurRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; int iCurRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber];
OptionRow &row = *m_pRows[iCurRow];
if( SHOW_CREATE_NEW && iCurRow == 0 ) // "create new" if( SHOW_CREATE_NEW && iCurRow == 0 ) // "create new"
{ {
@@ -336,7 +339,7 @@ void ScreenOptionsManageProfiles::ProcessMenuStart( PlayerNumber pn, const Input
PROFILE_MAX_DISPLAY_NAME_LENGTH, PROFILE_MAX_DISPLAY_NAME_LENGTH,
ValidateLocalProfileName ); ValidateLocalProfileName );
} }
else if( iCurRow == (int)m_pRows.size()-1 ) // "done" else if( row.GetRowType() == OptionRow::ROW_EXIT )
{ {
this->BeginFadingOut(); this->BeginFadingOut();
} }
@@ -383,9 +386,11 @@ void ScreenOptionsManageProfiles::ExportOptions( int iRow, const vector<PlayerNu
CString ScreenOptionsManageProfiles::GetLocalProfileIDWithFocus() const CString ScreenOptionsManageProfiles::GetLocalProfileIDWithFocus() const
{ {
int iCurRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; int iCurRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber];
OptionRow &row = *m_pRows[iCurRow];
if( SHOW_CREATE_NEW && iCurRow == 0 ) // "create new" if( SHOW_CREATE_NEW && iCurRow == 0 ) // "create new"
return NULL; return NULL;
else if( iCurRow == (int)m_pRows.size()-1 ) // "done" else if( row.GetRowType() == OptionRow::ROW_EXIT )
return NULL; return NULL;
// a profile // a profile