From 1470cfb900a32f5549ba702d5f59b1f26a242b6b Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Mon, 15 Aug 2005 07:50:11 +0000 Subject: [PATCH] don't show "Create New" if profiles are fixed --- stepmania/src/ScreenOptionsManageProfiles.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/stepmania/src/ScreenOptionsManageProfiles.cpp b/stepmania/src/ScreenOptionsManageProfiles.cpp index 0c1d0fbf8d..39f30ca341 100644 --- a/stepmania/src/ScreenOptionsManageProfiles.cpp +++ b/stepmania/src/ScreenOptionsManageProfiles.cpp @@ -13,6 +13,8 @@ static ThemeMetric NEW_PROFILE_DEFAULT_NAME( "ScreenOptionsManageProfiles", "NewProfileDefaultName" ); +#define SHOW_CREATE_NEW (!PROFILEMAN->FixedProfiles()) + AutoScreenMessage( SM_BackFromEnterNameForNew ) AutoScreenMessage( SM_BackFromRename ) AutoScreenMessage( SM_BackFromDeleteConfirm ) @@ -133,6 +135,7 @@ void ScreenOptionsManageProfiles::BeginScreen() int iIndex = 0; + if( SHOW_CREATE_NEW ) { def.m_vsChoices.clear(); def.m_vsChoices.push_back( "Create New" ); @@ -160,7 +163,7 @@ void ScreenOptionsManageProfiles::BeginScreen() OptionRowHandlerSimple *pHand = new OptionRowHandlerSimple; m_OptionRowHandlers.push_back( pHand ); GameCommand &gc = pHand->m_gc; - CString sCommand = "screen,ScreenOptionsEditProfile"; + CString sCommand = "screen,ScreenOptionsEditProfile;profileid,"+*s; gc.Load( iIndex++, ParseCommands(sCommand) ); } @@ -313,7 +316,7 @@ void ScreenOptionsManageProfiles::ProcessMenuStart( PlayerNumber pn, const Input { int iCurRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; - if( iCurRow == 0 ) // "create new" + if( SHOW_CREATE_NEW && iCurRow == 0 ) // "create new" { vector vsUsedNames; PROFILEMAN->GetLocalProfileDisplayNames( vsUsedNames ); @@ -337,7 +340,7 @@ void ScreenOptionsManageProfiles::ProcessMenuStart( PlayerNumber pn, const Input { this->BeginFadingOut(); } - else // a course + else // a profile { g_TempMenu.rows.clear(); @@ -380,13 +383,13 @@ void ScreenOptionsManageProfiles::ExportOptions( int iRow, const vectorm_MasterPlayerNumber]; - if( iCurRow == 0 ) + if( SHOW_CREATE_NEW && iCurRow == 0 ) // "create new" return NULL; else if( iCurRow == (int)m_pRows.size()-1 ) // "done" return NULL; // a profile - int iIndex = iCurRow - 1; + int iIndex = iCurRow + (SHOW_CREATE_NEW ? -1 : 0); return m_vsLocalProfileID[iIndex]; }