phase out vDefs param

This commit is contained in:
Glenn Maynard
2006-01-17 21:31:50 +00:00
parent 2b9bb0ec44
commit 8fd297bdfc
12 changed files with 17 additions and 47 deletions
+7 -4
View File
@@ -198,9 +198,12 @@ void ScreenOptions::Init()
void ScreenOptions::InitMenu( const vector<OptionRowDefinition> &vDefs, const vector<OptionRowHandler*> &vHands ) void ScreenOptions::InitMenu( const vector<OptionRowDefinition> &vDefs, const vector<OptionRowHandler*> &vHands )
{ {
LOG->Trace( "ScreenOptions::InitMenu()" ); InitMenu( vHands );
}
ASSERT( vDefs.size() == vHands.size() ); void ScreenOptions::InitMenu( const vector<OptionRowHandler*> &vHands )
{
LOG->Trace( "ScreenOptions::InitMenu()" );
for( unsigned i=0; i<m_pRows.size(); i++ ) for( unsigned i=0; i<m_pRows.size(); i++ )
{ {
@@ -209,15 +212,15 @@ void ScreenOptions::InitMenu( const vector<OptionRowDefinition> &vDefs, const ve
} }
m_pRows.clear(); m_pRows.clear();
for( unsigned r=0; r<vDefs.size(); r++ ) // foreach row for( unsigned r=0; r<vHands.size(); r++ ) // foreach row
{ {
m_pRows.push_back( new OptionRow(&m_OptionRowType) ); m_pRows.push_back( new OptionRow(&m_OptionRowType) );
OptionRow &row = *m_pRows.back(); OptionRow &row = *m_pRows.back();
row.SetDrawOrder( 1 ); row.SetDrawOrder( 1 );
m_framePage.AddChild( &row ); m_framePage.AddChild( &row );
const OptionRowDefinition &def = vDefs[r];
OptionRowHandler* hand = vHands[r]; OptionRowHandler* hand = vHands[r];
const OptionRowDefinition &def = vHands[r]->m_Def;
bool bFirstRowGoesDown = m_OptionsNavigation==NAV_TOGGLE_THREE_KEY; bool bFirstRowGoesDown = m_OptionsNavigation==NAV_TOGGLE_THREE_KEY;
+1
View File
@@ -34,6 +34,7 @@ public:
ScreenOptions(); ScreenOptions();
virtual void Init(); virtual void Init();
virtual void BeginScreen(); virtual void BeginScreen();
void InitMenu( const vector<OptionRowHandler*> &vHands );
void InitMenu( const vector<OptionRowDefinition> &vDefs, const vector<OptionRowHandler*> &vHands ); void InitMenu( const vector<OptionRowDefinition> &vDefs, const vector<OptionRowHandler*> &vHands );
virtual ~ScreenOptions(); virtual ~ScreenOptions();
virtual void Update( float fDeltaTime ); virtual void Update( float fDeltaTime );
+1 -6
View File
@@ -57,7 +57,6 @@ void ScreenOptionsEditCourse::BeginScreen()
SONGMAN->GetSongs( m_vpDisplayedSongs ); SONGMAN->GetSongs( m_vpDisplayedSongs );
vector<OptionRowDefinition> vDefs;
vector<OptionRowHandler*> vHands; vector<OptionRowHandler*> vHands;
OptionRowHandler *pHand = OptionRowHandlerUtil::MakeNull(); OptionRowHandler *pHand = OptionRowHandlerUtil::MakeNull();
@@ -67,7 +66,6 @@ void ScreenOptionsEditCourse::BeginScreen()
pHand->m_Def.m_vsChoices.clear(); pHand->m_Def.m_vsChoices.clear();
FOREACH_CourseType( i ) FOREACH_CourseType( i )
pHand->m_Def.m_vsChoices.push_back( CourseTypeToLocalizedString(i) ); pHand->m_Def.m_vsChoices.push_back( CourseTypeToLocalizedString(i) );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand ); vHands.push_back( pHand );
pHand = OptionRowHandlerUtil::MakeNull(); pHand = OptionRowHandlerUtil::MakeNull();
@@ -78,7 +76,6 @@ void ScreenOptionsEditCourse::BeginScreen()
pHand->m_Def.m_vsChoices.push_back( "Auto" ); pHand->m_Def.m_vsChoices.push_back( "Auto" );
for( int i=MIN_METER; i<=MAX_METER; i++ ) for( int i=MIN_METER; i<=MAX_METER; i++ )
pHand->m_Def.m_vsChoices.push_back( ssprintf("%d",i) ); pHand->m_Def.m_vsChoices.push_back( ssprintf("%d",i) );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand ); vHands.push_back( pHand );
FOREACH_CONST( CourseEntry, pCourse->m_vEntries, ce ) FOREACH_CONST( CourseEntry, pCourse->m_vEntries, ce )
@@ -91,7 +88,6 @@ void ScreenOptionsEditCourse::BeginScreen()
pHand->m_Def.m_vsChoices.clear(); pHand->m_Def.m_vsChoices.clear();
FOREACH_CONST( Song*, m_vpDisplayedSongs, s ) FOREACH_CONST( Song*, m_vpDisplayedSongs, s )
pHand->m_Def.m_vsChoices.push_back( (*s)->GetTranslitFullTitle() ); pHand->m_Def.m_vsChoices.push_back( (*s)->GetTranslitFullTitle() );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand ); vHands.push_back( pHand );
} }
@@ -101,10 +97,9 @@ void ScreenOptionsEditCourse::BeginScreen()
pHand->m_Def.m_bExportOnChange = true; pHand->m_Def.m_bExportOnChange = true;
pHand->m_Def.m_vsChoices.clear(); pHand->m_Def.m_vsChoices.clear();
pHand->m_Def.m_vsChoices.push_back( "Insert Entry" ); pHand->m_Def.m_vsChoices.push_back( "Insert Entry" );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand ); vHands.push_back( pHand );
ScreenOptions::InitMenu( vDefs, vHands ); ScreenOptions::InitMenu( vHands );
ScreenOptions::BeginScreen(); ScreenOptions::BeginScreen();
+1 -10
View File
@@ -61,7 +61,6 @@ void ScreenOptionsEditCourseEntry::BeginScreen()
m_Original = ce; m_Original = ce;
vector<OptionRowDefinition> vDefs;
vector<OptionRowHandler*> vHands; vector<OptionRowHandler*> vHands;
OptionRowHandler *pHand = OptionRowHandlerUtil::MakeNull(); OptionRowHandler *pHand = OptionRowHandlerUtil::MakeNull();
@@ -75,7 +74,6 @@ void ScreenOptionsEditCourseEntry::BeginScreen()
pHand->m_Def.m_vsChoices.push_back( "(any)" ); pHand->m_Def.m_vsChoices.push_back( "(any)" );
FOREACH_CONST( CString, vsSongGroups, song ) FOREACH_CONST( CString, vsSongGroups, song )
pHand->m_Def.m_vsChoices.push_back( *song ); pHand->m_Def.m_vsChoices.push_back( *song );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand ); vHands.push_back( pHand );
pHand = OptionRowHandlerUtil::MakeNull(); pHand = OptionRowHandlerUtil::MakeNull();
@@ -84,7 +82,6 @@ void ScreenOptionsEditCourseEntry::BeginScreen()
pHand->m_Def.m_bExportOnChange = true; pHand->m_Def.m_bExportOnChange = true;
pHand->m_Def.m_vsChoices.clear(); pHand->m_Def.m_vsChoices.clear();
FillSongsAndChoices( ce.sSongGroup, m_vpDisplayedSongs, pHand->m_Def.m_vsChoices ); FillSongsAndChoices( ce.sSongGroup, m_vpDisplayedSongs, pHand->m_Def.m_vsChoices );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand ); vHands.push_back( pHand );
pHand = OptionRowHandlerUtil::MakeNull(); pHand = OptionRowHandlerUtil::MakeNull();
@@ -95,7 +92,6 @@ void ScreenOptionsEditCourseEntry::BeginScreen()
pHand->m_Def.m_vsChoices.push_back( "(any)" ); pHand->m_Def.m_vsChoices.push_back( "(any)" );
FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), dc ) FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), dc )
pHand->m_Def.m_vsChoices.push_back( DifficultyToLocalizedString(*dc) ); pHand->m_Def.m_vsChoices.push_back( DifficultyToLocalizedString(*dc) );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand ); vHands.push_back( pHand );
pHand = OptionRowHandlerUtil::MakeNull(); pHand = OptionRowHandlerUtil::MakeNull();
@@ -106,7 +102,6 @@ void ScreenOptionsEditCourseEntry::BeginScreen()
pHand->m_Def.m_vsChoices.push_back( "(any)" ); pHand->m_Def.m_vsChoices.push_back( "(any)" );
for( int i=MIN_METER; i<=MAX_METER; i++ ) for( int i=MIN_METER; i<=MAX_METER; i++ )
pHand->m_Def.m_vsChoices.push_back( ssprintf("%i",i) ); pHand->m_Def.m_vsChoices.push_back( ssprintf("%i",i) );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand ); vHands.push_back( pHand );
pHand = OptionRowHandlerUtil::MakeNull(); pHand = OptionRowHandlerUtil::MakeNull();
@@ -117,7 +112,6 @@ void ScreenOptionsEditCourseEntry::BeginScreen()
pHand->m_Def.m_vsChoices.push_back( "(any)" ); pHand->m_Def.m_vsChoices.push_back( "(any)" );
for( int i=MIN_METER; i<=MAX_METER; i++ ) for( int i=MIN_METER; i<=MAX_METER; i++ )
pHand->m_Def.m_vsChoices.push_back( ssprintf("%i",i) ); pHand->m_Def.m_vsChoices.push_back( ssprintf("%i",i) );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand ); vHands.push_back( pHand );
pHand = OptionRowHandlerUtil::MakeNull(); pHand = OptionRowHandlerUtil::MakeNull();
@@ -127,7 +121,6 @@ void ScreenOptionsEditCourseEntry::BeginScreen()
pHand->m_Def.m_vsChoices.clear(); pHand->m_Def.m_vsChoices.clear();
FOREACH_SongSort( i ) FOREACH_SongSort( i )
pHand->m_Def.m_vsChoices.push_back( SongSortToLocalizedString(i) ); pHand->m_Def.m_vsChoices.push_back( SongSortToLocalizedString(i) );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand ); vHands.push_back( pHand );
pHand = OptionRowHandlerUtil::MakeNull(); pHand = OptionRowHandlerUtil::MakeNull();
@@ -137,7 +130,6 @@ void ScreenOptionsEditCourseEntry::BeginScreen()
pHand->m_Def.m_vsChoices.clear(); pHand->m_Def.m_vsChoices.clear();
for( int i=0; i<20; i++ ) for( int i=0; i<20; i++ )
pHand->m_Def.m_vsChoices.push_back( FormatNumberAndSuffix(i+1) ); pHand->m_Def.m_vsChoices.push_back( FormatNumberAndSuffix(i+1) );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand ); vHands.push_back( pHand );
pHand = OptionRowHandlerUtil::MakeNull(); pHand = OptionRowHandlerUtil::MakeNull();
@@ -147,10 +139,9 @@ void ScreenOptionsEditCourseEntry::BeginScreen()
pHand->m_Def.m_vsChoices.clear(); pHand->m_Def.m_vsChoices.clear();
CString s = ssprintf( "%d mod changes", ce.GetNumModChanges() ); CString s = ssprintf( "%d mod changes", ce.GetNumModChanges() );
pHand->m_Def.m_vsChoices.push_back( s ); pHand->m_Def.m_vsChoices.push_back( s );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand ); vHands.push_back( pHand );
ScreenOptions::InitMenu( vDefs, vHands ); ScreenOptions::InitMenu( vHands );
ScreenOptions::BeginScreen(); ScreenOptions::BeginScreen();
} }
+1 -3
View File
@@ -28,7 +28,6 @@ void ScreenOptionsEditProfile::BeginScreen()
{ {
m_Original = *GAMESTATE->GetEditLocalProfile(); m_Original = *GAMESTATE->GetEditLocalProfile();
vector<OptionRowDefinition> vDefs;
vector<OptionRowHandler*> vHands; vector<OptionRowHandler*> vHands;
Profile *pProfile = PROFILEMAN->GetLocalProfile( GAMESTATE->m_sEditLocalProfileID ); Profile *pProfile = PROFILEMAN->GetLocalProfile( GAMESTATE->m_sEditLocalProfileID );
@@ -49,10 +48,9 @@ void ScreenOptionsEditProfile::BeginScreen()
CHARMAN->GetCharacters( vpCharacters ); CHARMAN->GetCharacters( vpCharacters );
FOREACH_CONST( Character*, vpCharacters, c ) FOREACH_CONST( Character*, vpCharacters, c )
def.m_vsChoices.push_back( (*c)->GetDisplayName() ); def.m_vsChoices.push_back( (*c)->GetDisplayName() );
vDefs.push_back( def );
} }
InitMenu( vDefs, vHands ); InitMenu( vHands );
ScreenOptions::BeginScreen(); ScreenOptions::BeginScreen();
} }
+1 -4
View File
@@ -146,7 +146,6 @@ void ScreenOptionsManageCourses::BeginScreen()
} }
vector<OptionRowDefinition> vDefs;
vector<OptionRowHandler*> vHands; vector<OptionRowHandler*> vHands;
int iIndex = 0; int iIndex = 0;
@@ -158,7 +157,6 @@ void ScreenOptionsManageCourses::BeginScreen()
def.m_sName = ""; def.m_sName = "";
def.m_vsChoices.clear(); def.m_vsChoices.clear();
def.m_vsChoices.push_back( "Create New" ); def.m_vsChoices.push_back( "Create New" );
vDefs.push_back( def );
iIndex++; iIndex++;
} }
@@ -206,11 +204,10 @@ void ScreenOptionsManageCourses::BeginScreen()
def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW; def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
def.m_vsChoices.clear(); def.m_vsChoices.clear();
def.m_vsChoices.push_back( (*c)->GetDisplayFullTitle() ); def.m_vsChoices.push_back( (*c)->GetDisplayFullTitle() );
vDefs.push_back( def );
iIndex++; iIndex++;
} }
ScreenOptions::InitMenu( vDefs, vHands ); ScreenOptions::InitMenu( vHands );
ScreenOptions::BeginScreen(); ScreenOptions::BeginScreen();
@@ -74,7 +74,6 @@ void ScreenOptionsManageEditSteps::Init()
void ScreenOptionsManageEditSteps::BeginScreen() void ScreenOptionsManageEditSteps::BeginScreen()
{ {
vector<OptionRowDefinition> vDefs;
vector<OptionRowHandler*> vHands; vector<OptionRowHandler*> vHands;
int iIndex = 0; int iIndex = 0;
@@ -88,7 +87,6 @@ void ScreenOptionsManageEditSteps::BeginScreen()
def.m_sExplanationName = "Create New Edit Steps"; def.m_sExplanationName = "Create New Edit Steps";
def.m_vsChoices.clear(); def.m_vsChoices.clear();
def.m_vsChoices.push_back( "" ); def.m_vsChoices.push_back( "" );
vDefs.push_back( def );
iIndex++; iIndex++;
} }
@@ -105,11 +103,10 @@ void ScreenOptionsManageEditSteps::BeginScreen()
CString sType = GAMEMAN->StepsTypeToLocalizedString( (*s)->m_StepsType ); CString sType = GAMEMAN->StepsTypeToLocalizedString( (*s)->m_StepsType );
def.m_vsChoices.push_back( sType ); def.m_vsChoices.push_back( sType );
def.m_bAllowThemeItems = false; // already themed def.m_bAllowThemeItems = false; // already themed
vDefs.push_back( def );
iIndex++; iIndex++;
} }
ScreenOptions::InitMenu( vDefs, vHands ); ScreenOptions::InitMenu( vHands );
ScreenOptions::BeginScreen(); ScreenOptions::BeginScreen();
@@ -97,7 +97,6 @@ void ScreenOptionsManageProfiles::Init()
void ScreenOptionsManageProfiles::BeginScreen() void ScreenOptionsManageProfiles::BeginScreen()
{ {
int iIndex = 0; int iIndex = 0;
vector<OptionRowDefinition> vDefs;
vector<OptionRowHandler*> OptionRowHandlers; vector<OptionRowHandler*> OptionRowHandlers;
if( SHOW_CREATE_NEW ) if( SHOW_CREATE_NEW )
@@ -107,7 +106,6 @@ void ScreenOptionsManageProfiles::BeginScreen()
pHand->m_Def.m_bAllowThemeTitle = false; pHand->m_Def.m_bAllowThemeTitle = false;
pHand->m_Def.m_bAllowThemeItems = false; pHand->m_Def.m_bAllowThemeItems = false;
OptionRowHandlers.push_back( pHand ); OptionRowHandlers.push_back( pHand );
vDefs.push_back( pHand->m_Def );
// FIXME // FIXME
// gc.Load( iIndex++, ); // gc.Load( iIndex++, );
@@ -127,13 +125,12 @@ void ScreenOptionsManageProfiles::BeginScreen()
pHand->m_Def.m_bAllowThemeItems = false; pHand->m_Def.m_bAllowThemeItems = false;
pHand->m_Def.m_sName = ssprintf( "%d", iIndex ); pHand->m_Def.m_sName = ssprintf( "%d", iIndex );
OptionRowHandlers.push_back( pHand ); OptionRowHandlers.push_back( pHand );
vDefs.push_back( pHand->m_Def );
// FIXME // FIXME
// gc.Load( iIndex++, ); // gc.Load( iIndex++, );
} }
ScreenOptions::InitMenu( vDefs, OptionRowHandlers ); ScreenOptions::InitMenu( OptionRowHandlers );
ScreenOptions::BeginScreen(); ScreenOptions::BeginScreen();
+1 -3
View File
@@ -49,7 +49,6 @@ void ScreenOptionsMaster::Init()
// Call this after enabling players, if any. // Call this after enabling players, if any.
ScreenOptions::Init(); ScreenOptions::Init();
vector<OptionRowDefinition> OptionRowDefs;
vector<OptionRowHandler*> OptionRowHandlers; vector<OptionRowHandler*> OptionRowHandlers;
for( unsigned i = 0; i < asLineNames.size(); ++i ) for( unsigned i = 0; i < asLineNames.size(); ++i )
{ {
@@ -63,13 +62,12 @@ void ScreenOptionsMaster::Init()
if( pHand == NULL ) if( pHand == NULL )
RageException::Throw( "Invalid OptionRowHandler '%s' in %s::Line%i", cmds.GetOriginalCommandString().c_str(), m_sName.c_str(), i ); RageException::Throw( "Invalid OptionRowHandler '%s' in %s::Line%i", cmds.GetOriginalCommandString().c_str(), m_sName.c_str(), i );
OptionRowHandlers.push_back( pHand ); OptionRowHandlers.push_back( pHand );
OptionRowDefs.push_back( pHand->m_Def );
} }
ASSERT( OptionRowHandlers.size() == asLineNames.size() ); ASSERT( OptionRowHandlers.size() == asLineNames.size() );
InitMenu( OptionRowDefs, OptionRowHandlers ); InitMenu( OptionRowHandlers );
} }
void ScreenOptionsMaster::ImportOptions( int r, const vector<PlayerNumber> &vpns ) void ScreenOptionsMaster::ImportOptions( int r, const vector<PlayerNumber> &vpns )
+1 -3
View File
@@ -45,16 +45,14 @@ void ScreenOptionsMemoryCard::Init()
def.m_sExplanationName = "Memory Card"; def.m_sExplanationName = "Memory Card";
def.m_bAllowThemeTitle = false; def.m_bAllowThemeTitle = false;
def.m_bOneChoiceForAllPlayers = true; def.m_bOneChoiceForAllPlayers = true;
m_vDefs.push_back( def );
} }
if( MEMCARDMAN->GetStorageDevices().empty() ) if( MEMCARDMAN->GetStorageDevices().empty() )
{ {
OptionRowDefinition def( "No memory cards detected", true, "" ); OptionRowDefinition def( "No memory cards detected", true, "" );
m_vDefs.push_back( def );
} }
InitMenu( m_vDefs, vHands ); InitMenu( vHands );
} }
void ScreenOptionsMemoryCard::BeginScreen() void ScreenOptionsMemoryCard::BeginScreen()
-2
View File
@@ -18,8 +18,6 @@ private:
void HandleMessage( const CString& sMessage ); void HandleMessage( const CString& sMessage );
void ProcessMenuStart( const InputEventPlus &input ); void ProcessMenuStart( const InputEventPlus &input );
vector<OptionRowDefinition> m_vDefs;
}; };
#endif #endif
+1 -4
View File
@@ -27,7 +27,6 @@ void ScreenSMOnlineLogin::Init()
ScreenOptions::Init(); ScreenOptions::Init();
m_iPlayer = 0; m_iPlayer = 0;
vector<OptionRowDefinition> vDefs;
vector<OptionRowHandler*> vHands; vector<OptionRowHandler*> vHands;
vHands.push_back( OptionRowHandlerUtil::MakeNull() ); vHands.push_back( OptionRowHandlerUtil::MakeNull() );
OptionRowDefinition &def = vHands.back()->m_Def; OptionRowDefinition &def = vHands.back()->m_Def;
@@ -45,9 +44,7 @@ void ScreenSMOnlineLogin::Init()
SCREENMAN->SetNewScreen("ScreenProfileOptions"); SCREENMAN->SetNewScreen("ScreenProfileOptions");
} }
vDefs.push_back( def ); InitMenu( vHands );
InitMenu( vDefs, vHands );
SOUND->PlayMusic( THEME->GetPathS("ScreenMachineOptions", "music")); SOUND->PlayMusic( THEME->GetPathS("ScreenMachineOptions", "music"));
OptionRow &row = *m_pRows.back(); OptionRow &row = *m_pRows.back();
row.SetExitText("Login"); row.SetExitText("Login");