use OptionRowHandler::m_Def

This commit is contained in:
Glenn Maynard
2006-01-17 21:23:26 +00:00
parent 3bd5beeb53
commit 2b9bb0ec44
5 changed files with 140 additions and 106 deletions
+34 -26
View File
@@ -11,6 +11,7 @@
#include "ScreenPrompt.h"
#include "CourseUtil.h"
#include "LocalizedString.h"
#include "OptionRowHandler.h"
enum EditCourseRow
{
@@ -59,42 +60,49 @@ void ScreenOptionsEditCourse::BeginScreen()
vector<OptionRowDefinition> vDefs;
vector<OptionRowHandler*> vHands;
OptionRowDefinition def;
def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
def.m_bExportOnChange = true;
def.m_sName = "Type";
def.m_vsChoices.clear();
OptionRowHandler *pHand = OptionRowHandlerUtil::MakeNull();
pHand->m_Def.m_sName = "Type";
pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
pHand->m_Def.m_bExportOnChange = true;
pHand->m_Def.m_vsChoices.clear();
FOREACH_CourseType( i )
def.m_vsChoices.push_back( CourseTypeToLocalizedString(i) );
vDefs.push_back( def );
vHands.push_back( NULL );
pHand->m_Def.m_vsChoices.push_back( CourseTypeToLocalizedString(i) );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand );
def.m_sName = "Meter";
def.m_vsChoices.clear();
def.m_vsChoices.push_back( "Auto" );
pHand = OptionRowHandlerUtil::MakeNull();
pHand->m_Def.m_sName = "Meter";
pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
pHand->m_Def.m_bExportOnChange = true;
pHand->m_Def.m_vsChoices.clear();
pHand->m_Def.m_vsChoices.push_back( "Auto" );
for( int i=MIN_METER; i<=MAX_METER; i++ )
def.m_vsChoices.push_back( ssprintf("%d",i) );
vDefs.push_back( def );
vHands.push_back( NULL );
pHand->m_Def.m_vsChoices.push_back( ssprintf("%d",i) );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand );
FOREACH_CONST( CourseEntry, pCourse->m_vEntries, ce )
{
pHand = OptionRowHandlerUtil::MakeNull();
int iEntryIndex = ce - pCourse->m_vEntries.begin();
def.m_sName = ssprintf( "Entry %d", iEntryIndex+1 );
def.m_vsChoices.clear();
pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
pHand->m_Def.m_bExportOnChange = true;
pHand->m_Def.m_sName = ssprintf( "Entry %d", iEntryIndex+1 );
pHand->m_Def.m_vsChoices.clear();
FOREACH_CONST( Song*, m_vpDisplayedSongs, s )
def.m_vsChoices.push_back( (*s)->GetTranslitFullTitle() );
vDefs.push_back( def );
vHands.push_back( NULL );
pHand->m_Def.m_vsChoices.push_back( (*s)->GetTranslitFullTitle() );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand );
}
def.m_sName = "";
def.m_vsChoices.clear();
def.m_vsChoices.push_back( "Insert Entry" );
vDefs.push_back( def );
vHands.push_back( NULL );
pHand = OptionRowHandlerUtil::MakeNull();
pHand->m_Def.m_sName = "";
pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
pHand->m_Def.m_bExportOnChange = true;
pHand->m_Def.m_vsChoices.clear();
pHand->m_Def.m_vsChoices.push_back( "Insert Entry" );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand );
ScreenOptions::InitMenu( vDefs, vHands );
+70 -48
View File
@@ -8,6 +8,7 @@
#include "GameManager.h"
#include "song.h"
#include "Steps.h"
#include "OptionRowHandler.h"
enum EditCourseEntryRow
{
@@ -63,70 +64,91 @@ void ScreenOptionsEditCourseEntry::BeginScreen()
vector<OptionRowDefinition> vDefs;
vector<OptionRowHandler*> vHands;
OptionRowDefinition def;
def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
def.m_bExportOnChange = true;
def.m_sName = "Song Group";
def.m_vsChoices.clear();
OptionRowHandler *pHand = OptionRowHandlerUtil::MakeNull();
vHands.push_back( OptionRowHandlerUtil::MakeNull() );
pHand->m_Def.m_sName = "Song Group";
pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
pHand->m_Def.m_bExportOnChange = true;
pHand->m_Def.m_vsChoices.clear();
vector<CString> vsSongGroups;
SONGMAN->GetSongGroupNames( vsSongGroups );
def.m_vsChoices.push_back( "(any)" );
pHand->m_Def.m_vsChoices.push_back( "(any)" );
FOREACH_CONST( CString, vsSongGroups, song )
def.m_vsChoices.push_back( *song );
vDefs.push_back( def );
vHands.push_back( NULL );
pHand->m_Def.m_vsChoices.push_back( *song );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand );
def.m_sName = "Song";
def.m_vsChoices.clear();
FillSongsAndChoices( ce.sSongGroup, m_vpDisplayedSongs, def.m_vsChoices );
vDefs.push_back( def );
vHands.push_back( NULL );
pHand = OptionRowHandlerUtil::MakeNull();
pHand->m_Def.m_sName = "Song";
pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
pHand->m_Def.m_bExportOnChange = true;
pHand->m_Def.m_vsChoices.clear();
FillSongsAndChoices( ce.sSongGroup, m_vpDisplayedSongs, pHand->m_Def.m_vsChoices );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand );
def.m_sName = "Base Difficulty";
def.m_vsChoices.clear();
def.m_vsChoices.push_back( "(any)" );
pHand = OptionRowHandlerUtil::MakeNull();
pHand->m_Def.m_sName = "Base Difficulty";
pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
pHand->m_Def.m_bExportOnChange = true;
pHand->m_Def.m_vsChoices.clear();
pHand->m_Def.m_vsChoices.push_back( "(any)" );
FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), dc )
def.m_vsChoices.push_back( DifficultyToLocalizedString(*dc) );
vDefs.push_back( def );
vHands.push_back( NULL );
pHand->m_Def.m_vsChoices.push_back( DifficultyToLocalizedString(*dc) );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand );
def.m_sName = "Low Meter";
def.m_vsChoices.clear();
def.m_vsChoices.push_back( "(any)" );
pHand = OptionRowHandlerUtil::MakeNull();
pHand->m_Def.m_sName = "Low Meter";
pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
pHand->m_Def.m_bExportOnChange = true;
pHand->m_Def.m_vsChoices.clear();
pHand->m_Def.m_vsChoices.push_back( "(any)" );
for( int i=MIN_METER; i<=MAX_METER; i++ )
def.m_vsChoices.push_back( ssprintf("%i",i) );
vDefs.push_back( def );
vHands.push_back( NULL );
pHand->m_Def.m_vsChoices.push_back( ssprintf("%i",i) );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand );
def.m_sName = "High Meter";
def.m_vsChoices.clear();
def.m_vsChoices.push_back( "(any)" );
pHand = OptionRowHandlerUtil::MakeNull();
pHand->m_Def.m_sName = "High Meter";
pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
pHand->m_Def.m_bExportOnChange = true;
pHand->m_Def.m_vsChoices.clear();
pHand->m_Def.m_vsChoices.push_back( "(any)" );
for( int i=MIN_METER; i<=MAX_METER; i++ )
def.m_vsChoices.push_back( ssprintf("%i",i) );
vDefs.push_back( def );
vHands.push_back( NULL );
pHand->m_Def.m_vsChoices.push_back( ssprintf("%i",i) );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand );
def.m_sName = "Sort";
def.m_vsChoices.clear();
pHand = OptionRowHandlerUtil::MakeNull();
pHand->m_Def.m_sName = "Sort";
pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
pHand->m_Def.m_bExportOnChange = true;
pHand->m_Def.m_vsChoices.clear();
FOREACH_SongSort( i )
def.m_vsChoices.push_back( SongSortToLocalizedString(i) );
vDefs.push_back( def );
vHands.push_back( NULL );
pHand->m_Def.m_vsChoices.push_back( SongSortToLocalizedString(i) );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand );
def.m_sName = "Choose";
def.m_vsChoices.clear();
pHand = OptionRowHandlerUtil::MakeNull();
pHand->m_Def.m_sName = "Choose";
pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
pHand->m_Def.m_bExportOnChange = true;
pHand->m_Def.m_vsChoices.clear();
for( int i=0; i<20; i++ )
def.m_vsChoices.push_back( FormatNumberAndSuffix(i+1) );
vDefs.push_back( def );
vHands.push_back( NULL );
pHand->m_Def.m_vsChoices.push_back( FormatNumberAndSuffix(i+1) );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand );
def.m_sName = "Set Mods";
def.m_vsChoices.clear();
pHand = OptionRowHandlerUtil::MakeNull();
pHand->m_Def.m_sName = "Set Mods";
pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
pHand->m_Def.m_bExportOnChange = true;
pHand->m_Def.m_vsChoices.clear();
CString s = ssprintf( "%d mod changes", ce.GetNumModChanges() );
def.m_vsChoices.push_back( s );
vDefs.push_back( def );
vHands.push_back( NULL );
pHand->m_Def.m_vsChoices.push_back( s );
vDefs.push_back( pHand->m_Def );
vHands.push_back( pHand );
ScreenOptions::InitMenu( vDefs, vHands );
+9 -9
View File
@@ -10,6 +10,7 @@
#include "Profile.h"
#include "Character.h"
#include "CharacterManager.h"
#include "OptionRowHandler.h"
enum EditProfileRow
{
@@ -30,18 +31,18 @@ void ScreenOptionsEditProfile::BeginScreen()
vector<OptionRowDefinition> vDefs;
vector<OptionRowHandler*> vHands;
OptionRowDefinition def;
def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
def.m_bOneChoiceForAllPlayers = true;
def.m_bAllowThemeItems = false;
def.m_bAllowThemeTitle = false;
def.m_bAllowExplanation = false;
def.m_bExportOnChange = true;
Profile *pProfile = PROFILEMAN->GetLocalProfile( GAMESTATE->m_sEditLocalProfileID );
ASSERT( pProfile );
{
vHands.push_back( OptionRowHandlerUtil::MakeNull() );
OptionRowDefinition &def = vHands.back()->m_Def;
def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
def.m_bOneChoiceForAllPlayers = true;
def.m_bAllowThemeItems = false;
def.m_bAllowThemeTitle = false;
def.m_bAllowExplanation = false;
def.m_bExportOnChange = true;
def.m_sName = "Character";
def.m_vsChoices.clear();
vector<Character*> vpCharacters;
@@ -49,7 +50,6 @@ void ScreenOptionsEditProfile::BeginScreen()
FOREACH_CONST( Character*, vpCharacters, c )
def.m_vsChoices.push_back( (*c)->GetDisplayName() );
vDefs.push_back( def );
vHands.push_back( NULL );
}
InitMenu( vDefs, vHands );
+8 -3
View File
@@ -7,6 +7,7 @@
#include "ScreenManager.h"
#include "ScreenPrompt.h"
#include "LocalizedString.h"
#include "OptionRowHandler.h"
REGISTER_SCREEN_CLASS( ScreenOptionsMemoryCard );
@@ -15,6 +16,8 @@ void ScreenOptionsMemoryCard::Init()
{
ScreenOptions::Init();
vector<OptionRowHandler*> vHands;
FOREACH_CONST( UsbStorageDevice, MEMCARDMAN->GetStorageDevices(), iter )
{
// TODO: Make these string themable
@@ -33,8 +36,12 @@ void ScreenOptionsMemoryCard::Init()
else
vs.push_back( ssprintf("%dMB",iter->iVolumeSizeMB) );
vHands.push_back( OptionRowHandlerUtil::MakeNull() );
OptionRowDefinition &def = vHands.back()->m_Def;
CString sDescription = join(", ", vs);
OptionRowDefinition def( sDescription, true, "" );
def.m_sName = sDescription;
def.m_vsChoices.push_back( "" );
def.m_sExplanationName = "Memory Card";
def.m_bAllowThemeTitle = false;
def.m_bOneChoiceForAllPlayers = true;
@@ -47,8 +54,6 @@ void ScreenOptionsMemoryCard::Init()
m_vDefs.push_back( def );
}
vector<OptionRowHandler*> vHands( m_vDefs.size(), NULL );
InitMenu( m_vDefs, vHands );
}
+19 -20
View File
@@ -14,44 +14,43 @@
#include "ScreenTextEntry.h"
#include "Profile.h"
#include "LocalizedString.h"
#include "OptionRowHandler.h"
REGISTER_SCREEN_CLASS(ScreenSMOnlineLogin);
AutoScreenMessage( SM_SMOnlinePack )
AutoScreenMessage( SM_PasswordDone )
OptionRowDefinition g_ProfileLine[1] = {
OptionRowDefinition("Profile",false)
};
static LocalizedString DEFINE_A_PROFILE( "ScreenSMOnlineLogin", "You must define a Profile." );
void ScreenSMOnlineLogin::Init()
{
ScreenOptions::Init();
m_iPlayer = 0;
g_ProfileLine[0].m_vsChoices.clear();
PROFILEMAN->GetLocalProfileDisplayNames( g_ProfileLine[0].m_vsChoices );
if( g_ProfileLine[0].m_vsChoices.empty() )
vector<OptionRowDefinition> vDefs;
vector<OptionRowHandler*> vHands;
vHands.push_back( OptionRowHandlerUtil::MakeNull() );
OptionRowDefinition &def = vHands.back()->m_Def;
def.m_sName = "Profile";
def.m_bOneChoiceForAllPlayers = false;
def.m_bAllowThemeItems = false;
def.m_vEnabledForPlayers.clear();
FOREACH_PlayerNumber( pn )
def.m_vEnabledForPlayers.insert( pn );
def.m_vsChoices.clear();
PROFILEMAN->GetLocalProfileDisplayNames( def.m_vsChoices );
if( def.m_vsChoices.empty() )
{
SCREENMAN->SystemMessage( DEFINE_A_PROFILE );
SCREENMAN->SetNewScreen("ScreenProfileOptions");
}
else
{
FOREACH_PlayerNumber( pn )
g_ProfileLine[0].m_vEnabledForPlayers.insert( pn );
g_ProfileLine[0].m_bAllowThemeItems = false;
vector<OptionRowDefinition> vDefs( &g_ProfileLine[0], &g_ProfileLine[ARRAYSIZE(g_ProfileLine)] );
vector<OptionRowHandler*> vHands( vDefs.size(), NULL );
vDefs.push_back( def );
InitMenu( vDefs, vHands );
SOUND->PlayMusic( THEME->GetPathS("ScreenMachineOptions", "music"));
OptionRow &row = *m_pRows.back();
row.SetExitText("Login");
}
InitMenu( vDefs, vHands );
SOUND->PlayMusic( THEME->GetPathS("ScreenMachineOptions", "music"));
OptionRow &row = *m_pRows.back();
row.SetExitText("Login");
}
void ScreenSMOnlineLogin::ImportOptions( int iRow, const vector<PlayerNumber> &vpns )