OptionRow: member name cleanup, add focus commands

This commit is contained in:
Chris Danford
2005-07-06 06:11:56 +00:00
parent 488c6e952e
commit 848d6c89e2
15 changed files with 334 additions and 291 deletions
+75 -51
View File
@@ -120,12 +120,16 @@ void OptionRow::LoadMetrics( const CString &sType )
ARROWS_X .Load(m_sType,"ArrowsX");
LABELS_X .Load(m_sType,"LabelsX");
LABELS_ON_COMMAND .Load(m_sType,"LabelsOnCommand");
LABEL_GAIN_FOCUS_COMMAND .Load(m_sType,"LabelGainFocusCommand");
LABEL_LOSE_FOCUS_COMMAND .Load(m_sType,"LabelLoseFocusCommand");
ITEMS_START_X .Load(m_sType,"ItemsStartX");
ITEMS_END_X .Load(m_sType,"ItemsEndX");
ITEMS_GAP_X .Load(m_sType,"ItemsGapX");
ITEMS_LONG_ROW_X .Load(m_sType,ITEMS_LONG_ROW_X_NAME,NUM_PLAYERS);
ITEMS_LONG_ROW_SHARED_X .Load(m_sType,"ItemsLongRowSharedX");
ITEMS_ON_COMMAND .Load(m_sType,"ItemsOnCommand");
ITEM_GAIN_FOCUS_COMMAND .Load(m_sType,"ItemGainFocusCommand");
ITEM_LOSE_FOCUS_COMMAND .Load(m_sType,"ItemLoseFocusCommand");
ICONS_X .Load(m_sType,ICONS_X_NAME,NUM_PLAYERS);
ICONS_ON_COMMAND .Load(m_sType,"IconsOnCommand");
COLOR_SELECTED .Load(m_sType,"ColorSelected");
@@ -161,17 +165,17 @@ void OptionRow::LoadNormal( const OptionRowDefinition &def, OptionRowHandler *pH
{
vector<bool> &vbSelected = m_vbSelected[p];
vbSelected.resize( 0 );
vbSelected.resize( m_RowDef.choices.size(), false );
vbSelected.resize( m_RowDef.m_vsChoices.size(), false );
// set select the first item if a SELECT_ONE row
if( vbSelected.size() && m_RowDef.selectType == SELECT_ONE )
if( vbSelected.size() && m_RowDef.m_selectType == SELECT_ONE )
vbSelected[0] = true;
}
// TRICKY: Insert a down arrow as the first choice in the row.
if( m_bFirstItemGoesDown )
{
m_RowDef.choices.insert( m_RowDef.choices.begin(), NEXT_ROW_NAME );
m_RowDef.m_vsChoices.insert( m_RowDef.m_vsChoices.begin(), NEXT_ROW_NAME );
FOREACH_PlayerNumber( p )
m_vbSelected[p].insert( m_vbSelected[p].begin(), false );
}
@@ -179,7 +183,7 @@ void OptionRow::LoadNormal( const OptionRowDefinition &def, OptionRowHandler *pH
CString OptionRow::GetRowTitle() const
{
CString sLineName = m_RowDef.name;
CString sLineName = m_RowDef.m_sName;
CString sTitle = OptionTitle(sLineName);
// HACK: tack the BPM onto the name of the speed line
@@ -230,7 +234,7 @@ void OptionRow::AfterImportOptions()
// Make all selections the same if bOneChoiceForAllPlayers
// Hack: we only import active players, so if only player 2 is imported,
// we need to copy p2 to p1, not p1 to p2.
if( m_RowDef.bOneChoiceForAllPlayers )
if( m_RowDef.m_bOneChoiceForAllPlayers )
{
PlayerNumber pnCopyFrom = GAMESTATE->m_MasterPlayerNumber;
if( GAMESTATE->m_MasterPlayerNumber == PLAYER_INVALID )
@@ -241,7 +245,7 @@ void OptionRow::AfterImportOptions()
FOREACH_PlayerNumber( p )
{
switch( m_RowDef.selectType )
switch( m_RowDef.m_selectType )
{
case SELECT_ONE:
{
@@ -283,20 +287,20 @@ void OptionRow::AfterImportOptions()
float fX = ITEMS_START_X;
for( unsigned c=0; c<m_RowDef.choices.size(); c++ )
for( unsigned c=0; c<m_RowDef.m_vsChoices.size(); c++ )
{
CString sText = m_RowDef.choices[c];
CString sText = m_RowDef.m_vsChoices[c];
PrepareItemText( sText );
bt.SetText( sText );
fX += bt.GetZoomedWidth();
if( c != m_RowDef.choices.size()-1 )
if( c != m_RowDef.m_vsChoices.size()-1 )
fX += ITEMS_GAP_X;
if( fX > ITEMS_END_X )
{
m_RowDef.layoutType = LAYOUT_SHOW_ONE_IN_ROW;
m_RowDef.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
break;
}
}
@@ -305,7 +309,7 @@ void OptionRow::AfterImportOptions()
//
// load m_textItems
//
switch( m_RowDef.layoutType )
switch( m_RowDef.m_layoutType )
{
case LAYOUT_SHOW_ONE_IN_ROW:
// init text
@@ -317,13 +321,13 @@ void OptionRow::AfterImportOptions()
const int iChoiceInRowWithFocus = m_iChoiceInRowWithFocus[p];
bt->LoadFromFont( THEME->GetPathF(m_sType,"item") );
CString sText = (iChoiceInRowWithFocus==-1) ? "" : m_RowDef.choices[iChoiceInRowWithFocus];
CString sText = (iChoiceInRowWithFocus==-1) ? "" : m_RowDef.m_vsChoices[iChoiceInRowWithFocus];
PrepareItemText( sText );
bt->SetText( sText );
bt->RunCommands( ITEMS_ON_COMMAND );
bt->SetShadowLength( 0 );
if( m_RowDef.bOneChoiceForAllPlayers )
if( m_RowDef.m_bOneChoiceForAllPlayers )
{
bt->SetX( ITEMS_LONG_ROW_SHARED_X );
break; // only initialize one item since it's shared
@@ -351,13 +355,13 @@ void OptionRow::AfterImportOptions()
case LAYOUT_SHOW_ALL_IN_ROW:
{
float fX = ITEMS_START_X;
for( unsigned c=0; c<m_RowDef.choices.size(); c++ )
for( unsigned c=0; c<m_RowDef.m_vsChoices.size(); c++ )
{
// init text
BitmapText *bt = new BitmapText;
m_textItems.push_back( bt );
bt->LoadFromFont( THEME->GetPathF(m_sType,"item") );
CString sText = m_RowDef.choices[c];
CString sText = m_RowDef.m_vsChoices[c];
PrepareItemText( sText );
bt->SetText( sText );
bt->RunCommands( ITEMS_ON_COMMAND );
@@ -415,8 +419,8 @@ void OptionRow::AfterImportOptions()
void OptionRow::LoadExit()
{
m_RowType = OptionRow::ROW_EXIT;
m_RowDef.name = EXIT_NAME;
m_RowDef.choices.push_back( "" );
m_RowDef.m_sName = EXIT_NAME;
m_RowDef.m_vsChoices.push_back( "" );
BitmapText *bt = new BitmapText;
m_textItems.push_back( bt );
@@ -443,15 +447,15 @@ void OptionRow::PositionUnderlines( PlayerNumber pn )
vector<OptionsCursor*> &vpUnderlines = m_Underline[pn];
PlayerNumber pnTakeSelectedFrom = m_RowDef.bOneChoiceForAllPlayers ? PLAYER_1 : pn;
PlayerNumber pnTakeSelectedFrom = m_RowDef.m_bOneChoiceForAllPlayers ? PLAYER_1 : pn;
const int iNumUnderlines = (m_RowDef.layoutType == LAYOUT_SHOW_ONE_IN_ROW) ? 1 : vpUnderlines.size();
const int iNumUnderlines = (m_RowDef.m_layoutType == LAYOUT_SHOW_ONE_IN_ROW) ? 1 : vpUnderlines.size();
for( int i=0; i<iNumUnderlines; i++ )
{
OptionsCursor& ul = *vpUnderlines[i];
int iChoiceWithFocus = (m_RowDef.layoutType == LAYOUT_SHOW_ONE_IN_ROW) ? m_iChoiceInRowWithFocus[pnTakeSelectedFrom] : i;
int iChoiceWithFocus = (m_RowDef.m_layoutType == LAYOUT_SHOW_ONE_IN_ROW) ? m_iChoiceInRowWithFocus[pnTakeSelectedFrom] : i;
/* Don't tween X movement and color changes. */
int iWidth, iX, iY;
@@ -459,7 +463,7 @@ void OptionRow::PositionUnderlines( PlayerNumber pn )
ul.SetGlobalX( (float)iX );
ul.SetGlobalDiffuseColor( RageColor(1,1,1, 1.0f) );
ASSERT( m_vbSelected[pnTakeSelectedFrom].size() == m_RowDef.choices.size() );
ASSERT( m_vbSelected[pnTakeSelectedFrom].size() == m_RowDef.m_vsChoices.size() );
bool bSelected = (iChoiceWithFocus==-1) ? false : m_vbSelected[pnTakeSelectedFrom][ iChoiceWithFocus ];
bool bHidden = !bSelected || m_bHidden;
@@ -489,15 +493,15 @@ void OptionRow::PositionIcons()
void OptionRow::UpdateText()
{
switch( m_RowDef.layoutType )
switch( m_RowDef.m_layoutType )
{
case LAYOUT_SHOW_ONE_IN_ROW:
FOREACH_HumanPlayer( p )
{
unsigned pn = m_RowDef.bOneChoiceForAllPlayers ? 0 : p;
unsigned pn = m_RowDef.m_bOneChoiceForAllPlayers ? 0 : p;
int iChoiceWithFocus = m_iChoiceInRowWithFocus[pn];
CString sText = m_RowDef.choices[iChoiceWithFocus];
CString sText = m_RowDef.m_vsChoices[iChoiceWithFocus];
PrepareItemText( sText );
// If player_no is 2 and there is no player 1:
@@ -519,13 +523,6 @@ void OptionRow::SetRowFocus( bool bRowHasFocus[NUM_PLAYERS] )
void OptionRow::UpdateEnabledDisabled()
{
/*
COLOR_SELECTED,
COLOR_NOT_SELECTED,
COLOR_DISABLED,
TWEEN_SECONDS
*/
bool bThisRowHasFocusByAny = false;
FOREACH_HumanPlayer( p )
bThisRowHasFocusByAny |= m_bRowHasFocus[p];
@@ -542,6 +539,11 @@ void OptionRow::UpdateEnabledDisabled()
m_Frame.SetY( m_fY );
}
if( bThisRowHasFocusByAny )
m_textTitle.RunCommands( LABEL_GAIN_FOCUS_COMMAND );
else
m_textTitle.RunCommands( LABEL_LOSE_FOCUS_COMMAND );
/* Don't tween selection colors at all. */
RageColor color;
if( bThisRowHasFocusByAny ) color = COLOR_SELECTED;
@@ -554,7 +556,29 @@ void OptionRow::UpdateEnabledDisabled()
m_sprBullet.SetGlobalDiffuseColor( color );
m_textTitle.SetGlobalDiffuseColor( color );
switch( m_RowDef.layoutType )
for( unsigned j=0; j<m_textItems.size(); j++ )
{
bool bThisItemHasFocusByAny = false;
FOREACH_HumanPlayer( p )
{
if( m_bRowHasFocus[p] )
{
if( (int)j == GetChoiceInRowWithFocus(p) )
{
bThisItemHasFocusByAny = true;
break;
}
}
}
if( bThisItemHasFocusByAny )
m_textItems[j]->RunCommands( ITEM_GAIN_FOCUS_COMMAND );
else
m_textItems[j]->RunCommands( ITEM_LOSE_FOCUS_COMMAND );
}
switch( m_RowDef.m_layoutType )
{
case LAYOUT_SHOW_ALL_IN_ROW:
for( unsigned j=0; j<m_textItems.size(); j++ )
@@ -579,7 +603,7 @@ void OptionRow::UpdateEnabledDisabled()
if( m_bHidden )
color.a = 0;
unsigned item_no = m_RowDef.bOneChoiceForAllPlayers ? 0 : pn;
unsigned item_no = m_RowDef.m_bOneChoiceForAllPlayers ? 0 : pn;
// If player_no is 2 and there is no player 1:
item_no = min( item_no, m_textItems.size()-1 );
@@ -632,9 +656,9 @@ BitmapText &OptionRow::GetTextItemForRow( PlayerNumber pn, int iChoiceOnRow )
if( m_RowType == OptionRow::ROW_EXIT )
return *m_textItems[0];
bool bOneChoice = m_RowDef.bOneChoiceForAllPlayers;
bool bOneChoice = m_RowDef.m_bOneChoiceForAllPlayers;
int index = -1;
switch( m_RowDef.layoutType )
switch( m_RowDef.m_layoutType )
{
case LAYOUT_SHOW_ONE_IN_ROW:
index = bOneChoice ? 0 : pn;
@@ -699,9 +723,9 @@ void OptionRow::SetOneSharedSelection( int iChoice )
int OptionRow::GetChoiceInRowWithFocus( PlayerNumber pn ) const
{
if( m_RowDef.bOneChoiceForAllPlayers )
if( m_RowDef.m_bOneChoiceForAllPlayers )
pn = PLAYER_1;
if( m_RowDef.choices.empty() )
if( m_RowDef.m_vsChoices.empty() )
return -1;
int iChoice = m_iChoiceInRowWithFocus[pn];
return iChoice;
@@ -714,9 +738,9 @@ int OptionRow::GetChoiceInRowWithFocusShared() const
void OptionRow::SetChoiceInRowWithFocus( PlayerNumber pn, int iChoice )
{
if( m_RowDef.bOneChoiceForAllPlayers )
if( m_RowDef.m_bOneChoiceForAllPlayers )
pn = PLAYER_1;
ASSERT(iChoice >= 0 && iChoice < (int)m_RowDef.choices.size());
ASSERT(iChoice >= 0 && iChoice < (int)m_RowDef.m_vsChoices.size());
m_iChoiceInRowWithFocus[pn] = iChoice;
}
@@ -755,15 +779,15 @@ void OptionRow::Reload( const OptionRowDefinition &def )
m_RowDef = def;
else
m_pHand->Reload( m_RowDef );
ASSERT( !m_RowDef.choices.empty() );
ASSERT( !m_RowDef.m_vsChoices.empty() );
FOREACH_PlayerNumber( p )
m_vbSelected[p].resize( m_RowDef.choices.size(), false );
m_vbSelected[p].resize( m_RowDef.m_vsChoices.size(), false );
// TODO: Nothing uses this yet and it causes skips when changing options.
//ImportOptions( vpns );
switch( m_RowDef.selectType )
switch( m_RowDef.m_selectType )
{
case SELECT_ONE:
FOREACH_HumanPlayer( p )
@@ -775,7 +799,7 @@ void OptionRow::Reload( const OptionRowDefinition &def )
break;
case SELECT_MULTIPLE:
FOREACH_HumanPlayer( p )
CLAMP( m_iChoiceInRowWithFocus[p], 0, m_RowDef.choices.size()-1 );
CLAMP( m_iChoiceInRowWithFocus[p], 0, m_RowDef.m_vsChoices.size()-1 );
break;
default:
ASSERT(0);
@@ -838,7 +862,7 @@ void OptionRow::ImportOptions( const vector<PlayerNumber> &vpns )
if( m_pHand == NULL )
return;
ASSERT( m_RowDef.choices.size() > 0 );
ASSERT( m_RowDef.m_vsChoices.size() > 0 );
FOREACH_CONST( PlayerNumber, vpns, iter )
{
@@ -847,7 +871,7 @@ void OptionRow::ImportOptions( const vector<PlayerNumber> &vpns )
FOREACH( bool, m_vbSelected[p], b )
*b = false;
ASSERT( m_vbSelected[p].size() == m_RowDef.choices.size() );
ASSERT( m_vbSelected[p].size() == m_RowDef.m_vsChoices.size() );
ERASE_ONE_BOOL_AT_FRONT_IF_NEEDED( m_vbSelected[p] );
}
@@ -858,7 +882,7 @@ void OptionRow::ImportOptions( const vector<PlayerNumber> &vpns )
PlayerNumber p = *iter;
INSERT_ONE_BOOL_AT_FRONT_IF_NEEDED( m_vbSelected[p] );
VerifySelected( m_RowDef.selectType, m_vbSelected[p], m_RowDef.name );
VerifySelected( m_RowDef.m_selectType, m_vbSelected[p], m_RowDef.m_sName );
}
}
@@ -867,7 +891,7 @@ int OptionRow::ExportOptions( const vector<PlayerNumber> &vpns, bool bRowHasFocu
if( m_pHand == NULL )
return 0;
ASSERT( m_RowDef.choices.size() > 0 );
ASSERT( m_RowDef.m_vsChoices.size() > 0 );
int iChangeMask = 0;
@@ -876,14 +900,14 @@ int OptionRow::ExportOptions( const vector<PlayerNumber> &vpns, bool bRowHasFocu
PlayerNumber p = *iter;
bool bFocus = bRowHasFocus[p];
VerifySelected( m_RowDef.selectType, m_vbSelected[p], m_RowDef.name );
ASSERT( m_vbSelected[p].size() == m_RowDef.choices.size() );
VerifySelected( m_RowDef.m_selectType, m_vbSelected[p], m_RowDef.m_sName );
ASSERT( m_vbSelected[p].size() == m_RowDef.m_vsChoices.size() );
ERASE_ONE_BOOL_AT_FRONT_IF_NEEDED( m_vbSelected[p] );
// SELECT_NONE rows get exported if they have focus when the user presses
// Start.
int iChoice = GetChoiceInRowWithFocus( p );
if( m_RowDef.selectType == SELECT_NONE && bFocus )
if( m_RowDef.m_selectType == SELECT_NONE && bFocus )
m_vbSelected[p][iChoice] = true;
}
@@ -895,7 +919,7 @@ int OptionRow::ExportOptions( const vector<PlayerNumber> &vpns, bool bRowHasFocu
bool bFocus = bRowHasFocus[p];
int iChoice = GetChoiceInRowWithFocus( p );
if( m_RowDef.selectType == SELECT_NONE && bFocus )
if( m_RowDef.m_selectType == SELECT_NONE && bFocus )
m_vbSelected[p][iChoice] = false;
INSERT_ONE_BOOL_AT_FRONT_IF_NEEDED( m_vbSelected[p] );
+21 -17
View File
@@ -34,11 +34,11 @@ LayoutType StringToLayoutType( const CString& s );
struct OptionRowDefinition
{
CString name;
bool bOneChoiceForAllPlayers;
SelectType selectType;
LayoutType layoutType;
vector<CString> choices;
CString m_sName;
bool m_bOneChoiceForAllPlayers;
SelectType m_selectType;
LayoutType m_layoutType;
vector<CString> m_vsChoices;
set<PlayerNumber> m_vEnabledForPlayers; // only players in this set may change focus to this row
bool m_bExportOnChange;
bool m_bAllowThemeItems; // if false, ignores ScreenOptions::THEME_ITEMS
@@ -54,11 +54,11 @@ struct OptionRowDefinition
OptionRowDefinition() { Init(); }
void Init()
{
name = "";
bOneChoiceForAllPlayers = false;
selectType = SELECT_ONE;
layoutType = LAYOUT_SHOW_ALL_IN_ROW;
choices.clear();
m_sName = "";
m_bOneChoiceForAllPlayers = false;
m_selectType = SELECT_ONE;
m_layoutType = LAYOUT_SHOW_ALL_IN_ROW;
m_vsChoices.clear();
m_vEnabledForPlayers.clear();
FOREACH_PlayerNumber( pn )
m_vEnabledForPlayers.insert( pn );
@@ -72,11 +72,11 @@ struct OptionRowDefinition
OptionRowDefinition( const char *n, bool b, const char *c0=NULL, const char *c1=NULL, const char *c2=NULL, const char *c3=NULL, const char *c4=NULL, const char *c5=NULL, const char *c6=NULL, const char *c7=NULL, const char *c8=NULL, const char *c9=NULL, const char *c10=NULL, const char *c11=NULL, const char *c12=NULL, const char *c13=NULL, const char *c14=NULL, const char *c15=NULL, const char *c16=NULL, const char *c17=NULL, const char *c18=NULL, const char *c19=NULL )
{
Init();
name=n;
bOneChoiceForAllPlayers=b;
selectType=SELECT_ONE;
layoutType=LAYOUT_SHOW_ALL_IN_ROW;
#define PUSH( c ) if(c) choices.push_back(c);
m_sName=n;
m_bOneChoiceForAllPlayers=b;
m_selectType=SELECT_ONE;
m_layoutType=LAYOUT_SHOW_ALL_IN_ROW;
#define PUSH( c ) if(c) m_vsChoices.push_back(c);
PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5);PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11);PUSH(c12);PUSH(c13);PUSH(c14);PUSH(c15);PUSH(c16);PUSH(c17);PUSH(c18);PUSH(c19);
#undef PUSH
}
@@ -120,13 +120,13 @@ public:
bool GetSelected( PlayerNumber pn, int iChoice ) const
{
if( m_RowDef.bOneChoiceForAllPlayers )
if( m_RowDef.m_bOneChoiceForAllPlayers )
pn = PLAYER_1;
return m_vbSelected[pn][iChoice];
}
void SetSelected( PlayerNumber pn, int iChoice, bool b )
{
if( m_RowDef.bOneChoiceForAllPlayers )
if( m_RowDef.m_bOneChoiceForAllPlayers )
pn = PLAYER_1;
m_vbSelected[pn][iChoice] = b;
}
@@ -190,12 +190,16 @@ protected:
ThemeMetric<float> ARROWS_X;
ThemeMetric<float> LABELS_X;
ThemeMetric<apActorCommands> LABELS_ON_COMMAND;
ThemeMetric<apActorCommands> LABEL_GAIN_FOCUS_COMMAND;
ThemeMetric<apActorCommands> LABEL_LOSE_FOCUS_COMMAND;
ThemeMetric<float> ITEMS_START_X;
ThemeMetric<float> ITEMS_END_X;
ThemeMetric<float> ITEMS_GAP_X;
ThemeMetric1D<float> ITEMS_LONG_ROW_X;
ThemeMetric<float> ITEMS_LONG_ROW_SHARED_X;
ThemeMetric<apActorCommands> ITEMS_ON_COMMAND;
ThemeMetric<apActorCommands> ITEM_GAIN_FOCUS_COMMAND;
ThemeMetric<apActorCommands> ITEM_LOSE_FOCUS_COMMAND;
ThemeMetric1D<float> ICONS_X;
ThemeMetric<apActorCommands> ICONS_ON_COMMAND;
ThemeMetric<RageColor> COLOR_SELECTED;
+64 -64
View File
@@ -83,7 +83,7 @@ public:
m_bUseModNameForIcon = true;
defOut.name = sParam;
defOut.m_sName = sParam;
Default.Load( -1, ParseCommands(ENTRY_DEFAULT(sParam)) );
@@ -92,18 +92,18 @@ public:
if( cmds.v.size() < 1 )
RageException::Throw( "Parse error in ScreenOptionsMaster::%s", sParam.c_str() );
defOut.bOneChoiceForAllPlayers = false;
defOut.m_bOneChoiceForAllPlayers = false;
const int NumCols = atoi( cmds.v[0].m_vsArgs[0] );
for( unsigned i=1; i<cmds.v.size(); i++ )
{
const Command &cmd = cmds.v[i];
CString sName = cmd.GetName();
if( sName == "together" ) defOut.bOneChoiceForAllPlayers = true;
else if( sName == "selectmultiple" ) defOut.selectType = SELECT_MULTIPLE;
else if( sName == "selectone" ) defOut.selectType = SELECT_ONE;
else if( sName == "selectnone" ) defOut.selectType = SELECT_NONE;
else if( sName == "showoneinrow" ) defOut.layoutType = LAYOUT_SHOW_ONE_IN_ROW;
if( sName == "together" ) defOut.m_bOneChoiceForAllPlayers = true;
else if( sName == "selectmultiple" ) defOut.m_selectType = SELECT_MULTIPLE;
else if( sName == "selectone" ) defOut.m_selectType = SELECT_ONE;
else if( sName == "selectnone" ) defOut.m_selectType = SELECT_NONE;
else if( sName == "showoneinrow" ) defOut.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
else if( sName == "reloadrowmessages" )
{
for( unsigned a=1; a<cmd.m_vsArgs.size(); a++ )
@@ -150,7 +150,7 @@ public:
CString sName = mc.m_sName;
CString sChoice = mc.m_sName;
defOut.choices.push_back( sChoice );
defOut.m_vsChoices.push_back( sChoice );
}
}
void ImportOption( const OptionRowDefinition &def, const vector<PlayerNumber> &vpns, vector<bool> vbSelectedOut[NUM_PLAYERS] ) const
@@ -174,17 +174,17 @@ public:
/* The entry has no effect. This is usually a default "none of the
* above" entry. It will always return true for DescribesCurrentMode().
* It's only the selected choice if nothing else matches. */
if( def.selectType != SELECT_MULTIPLE )
if( def.m_selectType != SELECT_MULTIPLE )
iFallbackOption = e;
continue;
}
if( def.bOneChoiceForAllPlayers )
if( def.m_bOneChoiceForAllPlayers )
{
if( mc.DescribesCurrentModeForAllPlayers() )
{
bUseFallbackOption = false;
if( def.selectType != SELECT_MULTIPLE )
if( def.m_selectType != SELECT_MULTIPLE )
SelectExactlyOne( e, vbSelOut );
else
vbSelOut[e] = true;
@@ -195,7 +195,7 @@ public:
if( mc.DescribesCurrentMode( p) )
{
bUseFallbackOption = false;
if( def.selectType != SELECT_MULTIPLE )
if( def.m_selectType != SELECT_MULTIPLE )
SelectExactlyOne( e, vbSelOut );
else
vbSelOut[e] = true;
@@ -203,7 +203,7 @@ public:
}
}
if( def.selectType == SELECT_ONE && bUseFallbackOption )
if( def.m_selectType == SELECT_ONE && bUseFallbackOption )
{
if( iFallbackOption == -1 )
{
@@ -216,7 +216,7 @@ public:
SelectExactlyOne( iFallbackOption, vbSelOut );
}
VerifySelected( def.selectType, vbSelOut, def.name );
VerifySelected( def.m_selectType, vbSelOut, def.m_sName );
}
}
@@ -243,7 +243,7 @@ public:
{
return m_bUseModNameForIcon ?
ListEntries[iFirstSelection].m_sModifiers :
def.choices[iFirstSelection];
def.m_vsChoices[iFirstSelection];
}
virtual bool HasScreen( int iChoice ) const
{
@@ -259,8 +259,8 @@ public:
ASSERT( sParam.size() );
m_sName = sParam;
defOut.name = "NoteSkins";
defOut.bOneChoiceForAllPlayers = false;
defOut.m_sName = "NoteSkins";
defOut.m_bOneChoiceForAllPlayers = false;
defOut.m_bAllowThemeItems = false; // we theme the text ourself
CStringArray arraySkinNames;
@@ -272,7 +272,7 @@ public:
GameCommand mc;
mc.m_sModifiers = arraySkinNames[skin];
ListEntries.push_back( mc );
defOut.choices.push_back( arraySkinNames[skin] );
defOut.m_vsChoices.push_back( arraySkinNames[skin] );
}
}
@@ -284,19 +284,19 @@ public:
ASSERT( sParam.size() );
m_sName = sParam;
defOut.name = "Steps";
defOut.bOneChoiceForAllPlayers = bLockedTogether;
defOut.m_sName = "Steps";
defOut.m_bOneChoiceForAllPlayers = bLockedTogether;
defOut.m_bAllowThemeItems = false; // we theme the text ourself
// fill in difficulty names
if( GAMESTATE->m_bEditing )
{
defOut.choices.push_back( "" );
defOut.m_vsChoices.push_back( "" );
ListEntries.push_back( GameCommand() );
}
else if( GAMESTATE->IsCourseMode() ) // playing a course
{
defOut.bOneChoiceForAllPlayers = (bool)PREFSMAN->m_bLockCourseDifficulties;
defOut.m_bOneChoiceForAllPlayers = (bool)PREFSMAN->m_bLockCourseDifficulties;
vector<Trail*> vTrails;
GAMESTATE->m_pCurCourse->GetTrails( vTrails, GAMESTATE->GetCurrentStyle()->m_StepsType );
@@ -306,7 +306,7 @@ public:
CString s = CourseDifficultyToThemedString( pTrail->m_CourseDifficulty );
s += ssprintf( " %d", pTrail->GetMeter() );
defOut.choices.push_back( s );
defOut.m_vsChoices.push_back( s );
GameCommand mc;
mc.m_pTrail = pTrail;
ListEntries.push_back( mc );
@@ -329,7 +329,7 @@ public:
else
s = DifficultyToThemedString( pSteps->GetDifficulty() );
s += ssprintf( " %d", pSteps->GetMeter() );
defOut.choices.push_back( s );
defOut.m_vsChoices.push_back( s );
GameCommand mc;
mc.m_pSteps = pSteps;
mc.m_dc = pSteps->GetDifficulty();
@@ -346,13 +346,13 @@ public:
ASSERT( sParam.size() );
m_sName = sParam;
defOut.bOneChoiceForAllPlayers = false;
defOut.m_bOneChoiceForAllPlayers = false;
defOut.m_bAllowThemeItems = false;
defOut.name = "Characters";
defOut.m_sName = "Characters";
Default.m_pCharacter = GAMESTATE->GetDefaultCharacter();
{
defOut.choices.push_back( "Off" );
defOut.m_vsChoices.push_back( "Off" );
GameCommand mc;
mc.m_pCharacter = NULL;
ListEntries.push_back( mc );
@@ -366,7 +366,7 @@ public:
CString s = pCharacter->m_sName;
s.MakeUpper();
defOut.choices.push_back( s );
defOut.m_vsChoices.push_back( s );
GameCommand mc;
mc.m_pCharacter = pCharacter;
ListEntries.push_back( mc );
@@ -381,8 +381,8 @@ public:
ASSERT( sParam.size() );
m_sName = sParam;
defOut.bOneChoiceForAllPlayers = true;
defOut.name = "Style";
defOut.m_bOneChoiceForAllPlayers = true;
defOut.m_sName = "Style";
defOut.m_bAllowThemeItems = false; // we theme the text ourself
vector<const Style*> vStyles;
@@ -390,7 +390,7 @@ public:
ASSERT( vStyles.size() );
FOREACH_CONST( const Style*, vStyles, s )
{
defOut.choices.push_back( GAMEMAN->StyleToThemedString(*s) );
defOut.m_vsChoices.push_back( GAMEMAN->StyleToThemedString(*s) );
GameCommand mc;
mc.m_pStyle = *s;
ListEntries.push_back( mc );
@@ -407,9 +407,9 @@ public:
ASSERT( sParam.size() );
m_sName = sParam;
defOut.bOneChoiceForAllPlayers = true;
defOut.m_bOneChoiceForAllPlayers = true;
defOut.m_bAllowThemeItems = false; // we theme the text ourself
defOut.name = "Group";
defOut.m_sName = "Group";
Default.m_sSongGroup = GROUP_ALL;
vector<CString> vSongGroups;
@@ -417,7 +417,7 @@ public:
ASSERT( vSongGroups.size() );
{
defOut.choices.push_back( "AllGroups" );
defOut.m_vsChoices.push_back( "AllGroups" );
GameCommand mc;
mc.m_sSongGroup = GROUP_ALL;
ListEntries.push_back( mc );
@@ -425,7 +425,7 @@ public:
FOREACH_CONST( CString, vSongGroups, g )
{
defOut.choices.push_back( *g );
defOut.m_vsChoices.push_back( *g );
GameCommand mc;
mc.m_sSongGroup = *g;
ListEntries.push_back( mc );
@@ -440,13 +440,13 @@ public:
ASSERT( sParam.size() );
m_sName = sParam;
defOut.bOneChoiceForAllPlayers = true;
defOut.name = "Difficulty";
defOut.m_bOneChoiceForAllPlayers = true;
defOut.m_sName = "Difficulty";
Default.m_dc = DIFFICULTY_INVALID;
defOut.m_bAllowThemeItems = false; // we theme the text ourself
{
defOut.choices.push_back( "AllDifficulties" );
defOut.m_vsChoices.push_back( "AllDifficulties" );
GameCommand mc;
mc.m_dc = DIFFICULTY_INVALID;
ListEntries.push_back( mc );
@@ -456,7 +456,7 @@ public:
{
CString s = DifficultyToThemedString( *d );
defOut.choices.push_back( s );
defOut.m_vsChoices.push_back( s );
GameCommand mc;
mc.m_dc = *d;
ListEntries.push_back( mc );
@@ -477,14 +477,14 @@ public:
if( GAMESTATE->m_pCurSong == NULL )
GAMESTATE->m_pCurSong.Set( vpSongs[0] );
defOut.name = "SongsInCurrentSongGroup";
defOut.bOneChoiceForAllPlayers = true;
defOut.layoutType = LAYOUT_SHOW_ONE_IN_ROW;
defOut.m_sName = "SongsInCurrentSongGroup";
defOut.m_bOneChoiceForAllPlayers = true;
defOut.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
defOut.m_bExportOnChange = true;
FOREACH_CONST( Song*, vpSongs, p )
{
defOut.choices.push_back( (*p)->GetTranslitFullTitle() );
defOut.m_vsChoices.push_back( (*p)->GetTranslitFullTitle() );
GameCommand mc;
mc.m_pSong = *p;
ListEntries.push_back( mc );
@@ -529,13 +529,13 @@ public:
const char *pStr = lua_tostring( L, -1 );
if( pStr == NULL )
RageException::Throw( "\"%s\" \"Name\" entry is not a string", sLuaFunction.c_str() );
defOut.name = pStr;
defOut.m_sName = pStr;
lua_pop( L, 1 );
lua_pushstring( L, "OneChoiceForAllPlayers" );
lua_gettable( L, -2 );
defOut.bOneChoiceForAllPlayers = !!lua_toboolean( L, -1 );
defOut.m_bOneChoiceForAllPlayers = !!lua_toboolean( L, -1 );
lua_pop( L, 1 );
@@ -550,8 +550,8 @@ public:
pStr = lua_tostring( L, -1 );
if( pStr == NULL )
RageException::Throw( "\"%s\" \"LayoutType\" entry is not a string", sLuaFunction.c_str() );
defOut.layoutType = StringToLayoutType( pStr );
ASSERT( defOut.layoutType != LAYOUT_INVALID );
defOut.m_layoutType = StringToLayoutType( pStr );
ASSERT( defOut.m_layoutType != LAYOUT_INVALID );
lua_pop( L, 1 );
@@ -560,8 +560,8 @@ public:
pStr = lua_tostring( L, -1 );
if( pStr == NULL )
RageException::Throw( "\"%s\" \"SelectType\" entry is not a string", sLuaFunction.c_str() );
defOut.selectType = StringToSelectType( pStr );
ASSERT( defOut.selectType != SELECT_INVALID );
defOut.m_selectType = StringToSelectType( pStr );
ASSERT( defOut.m_selectType != SELECT_INVALID );
lua_pop( L, 1 );
@@ -580,7 +580,7 @@ public:
RageException::Throw( "\"%s\" Column entry is not a string", sLuaFunction.c_str() );
// LOG->Trace( "'%s'", pValue);
defOut.choices.push_back( pValue );
defOut.m_vsChoices.push_back( pValue );
lua_pop( L, 1 ); /* removes `value'; keeps `key' for next iteration */
}
@@ -723,7 +723,7 @@ public:
lua_pushstring( L, "LoadSelections" );
lua_gettable( L, -2 );
if( !lua_isfunction( L, -1 ) )
RageException::Throw( "\"%s\" \"LoadSelections\" entry is not a function", def.name.c_str() );
RageException::Throw( "\"%s\" \"LoadSelections\" entry is not a function", def.m_sName.c_str() );
/* Argument 1 (self): */
m_pLuaTable->PushSelf( L );
@@ -777,7 +777,7 @@ public:
lua_pushstring( L, "SaveSelections" );
lua_gettable( L, -2 );
if( !lua_isfunction( L, -1 ) )
RageException::Throw( "\"%s\" \"SaveSelections\" entry is not a function", def.name.c_str() );
RageException::Throw( "\"%s\" \"SaveSelections\" entry is not a function", def.m_sName.c_str() );
/* Argument 1 (self): */
m_pLuaTable->PushSelf( L );
@@ -825,7 +825,7 @@ public:
defOut.Init();
/* Configuration values are never per-player. */
defOut.bOneChoiceForAllPlayers = true;
defOut.m_bOneChoiceForAllPlayers = true;
ConfOption *pConfOption = ConfOption::Find( sParam );
if( pConfOption == NULL )
@@ -834,9 +834,9 @@ public:
pConfOption->UpdateAvailableOptions();
opt = pConfOption;
opt->MakeOptionsList( defOut.choices );
opt->MakeOptionsList( defOut.m_vsChoices );
defOut.name = opt->name;
defOut.m_sName = opt->name;
}
virtual void ImportOption( const OptionRowDefinition &def, const vector<PlayerNumber> &vpns, vector<bool> vbSelectedOut[NUM_PLAYERS] ) const
{
@@ -917,9 +917,9 @@ public:
}
m_sName = sParam;
defOut.name = sParam;
defOut.bOneChoiceForAllPlayers = true;
defOut.layoutType = LAYOUT_SHOW_ONE_IN_ROW;
defOut.m_sName = sParam;
defOut.m_bOneChoiceForAllPlayers = true;
defOut.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
defOut.m_bExportOnChange = true;
defOut.m_bAllowThemeItems = false; // we theme the text ourself
@@ -929,7 +929,7 @@ public:
FOREACH_CONST( StepsType, m_vStepsTypesToShow, st )
{
CString s = GAMEMAN->StepsTypeToThemedString( *st );
defOut.choices.push_back( s );
defOut.m_vsChoices.push_back( s );
}
if( *m_pstToFill == STEPS_TYPE_INVALID )
@@ -1019,9 +1019,9 @@ public:
}
m_sName = sParam;
defOut.name = sParam;
defOut.bOneChoiceForAllPlayers = true;
defOut.layoutType = LAYOUT_SHOW_ONE_IN_ROW;
defOut.m_sName = sParam;
defOut.m_bOneChoiceForAllPlayers = true;
defOut.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
defOut.m_bExportOnChange = true;
defOut.m_bAllowThemeItems = false; // we theme the text ourself
m_vsReloadRowMessages.push_back( MessageToString(MESSAGE_CURRENT_SONG_CHANGED) );
@@ -1062,14 +1062,14 @@ public:
{
s = DifficultyToThemedString( dc );
}
defOut.choices.push_back( s );
defOut.m_vsChoices.push_back( s );
}
}
else
{
m_vDifficulties.push_back( DIFFICULTY_EDIT );
m_vSteps.push_back( NULL );
defOut.choices.push_back( "none" );
defOut.m_vsChoices.push_back( "none" );
}
if( m_pDifficultyToFill )
+16 -16
View File
@@ -58,23 +58,23 @@ void ScreenCourseManager::Init()
vector<OptionRowHandler*> vHands;
OptionRowDefinition def;
def.layoutType = LAYOUT_SHOW_ONE_IN_ROW;
def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
def.name = "Group";
def.choices.clear();
SONGMAN->GetCourseGroupNames( def.choices );
def.m_sName = "Group";
def.m_vsChoices.clear();
SONGMAN->GetCourseGroupNames( def.m_vsChoices );
vDefs.push_back( def );
vHands.push_back( NULL );
def.name = "Course Group";
def.choices.clear();
def.choices.push_back( "" );
def.m_sName = "Course Group";
def.m_vsChoices.clear();
def.m_vsChoices.push_back( "" );
vDefs.push_back( def );
vHands.push_back( NULL );
def.name = "Action";
def.choices.clear();
def.choices.push_back( "" );
def.m_sName = "Action";
def.m_vsChoices.clear();
def.m_vsChoices.push_back( "" );
vDefs.push_back( def );
vHands.push_back( NULL );
@@ -102,7 +102,7 @@ void ScreenCourseManager::AfterChangeValueInRow( PlayerNumber pn )
{
OptionRow &row = *m_pRows[ROW_COURSE_GROUP];
int iChoice = row.GetChoiceInRowWithFocus(pn);
CString sCourseGroup = row.GetRowDef().choices[iChoice];
CString sCourseGroup = row.GetRowDef().m_vsChoices[iChoice];
GAMESTATE->m_sPreferredCourseGroup.Set( sCourseGroup );
}
// Refresh courses
@@ -111,10 +111,10 @@ void ScreenCourseManager::AfterChangeValueInRow( PlayerNumber pn )
vector<Course*> vpCourses;
SONGMAN->GetCoursesInGroup( vpCourses, GAMESTATE->m_sPreferredCourseGroup.Get(), false );
OptionRowDefinition def = row.GetRowDef();
def.choices.clear();
def.m_vsChoices.clear();
FOREACH_CONST( Course*, vpCourses, c )
def.choices.push_back( (*c)->GetTranslitFullTitle() );
def.choices.push_back( NULL ); // new course
def.m_vsChoices.push_back( (*c)->GetTranslitFullTitle() );
def.m_vsChoices.push_back( NULL ); // new course
row.Reload( def );
}
// fall through
@@ -132,11 +132,11 @@ void ScreenCourseManager::AfterChangeValueInRow( PlayerNumber pn )
{
OptionRow &row = *m_pRows[ROW_ACTION];
OptionRowDefinition def = row.GetRowDef();
def.choices.clear();
def.m_vsChoices.clear();
vector<CourseManagerAction> vActions;
GetPossibleActions( vActions );
FOREACH_CONST( CourseManagerAction, vActions, a )
def.choices.push_back( CourseManagerActionToString(*a) );
def.m_vsChoices.push_back( CourseManagerActionToString(*a) );
row.Reload( def );
}
// fall through
+33 -33
View File
@@ -67,59 +67,59 @@ void ScreenEditCourse::Init()
vector<OptionRowHandler*> vHands;
OptionRowDefinition def;
def.layoutType = LAYOUT_SHOW_ONE_IN_ROW;
def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
def.name = "Title";
def.choices.clear();
def.choices.push_back( pCourse->GetTranslitFullTitle() );
def.m_sName = "Title";
def.m_vsChoices.clear();
def.m_vsChoices.push_back( pCourse->GetTranslitFullTitle() );
vDefs.push_back( def );
vHands.push_back( NULL );
def.name = "Repeat";
def.choices.clear();
def.choices.push_back( "NO" );
def.choices.push_back( "YES" );
def.m_sName = "Repeat";
def.m_vsChoices.clear();
def.m_vsChoices.push_back( "NO" );
def.m_vsChoices.push_back( "YES" );
vDefs.push_back( def );
vHands.push_back( NULL );
def.name = "Randomize";
def.choices.clear();
def.choices.push_back( "NO" );
def.choices.push_back( "YES" );
def.m_sName = "Randomize";
def.m_vsChoices.clear();
def.m_vsChoices.push_back( "NO" );
def.m_vsChoices.push_back( "YES" );
vDefs.push_back( def );
vHands.push_back( NULL );
def.name = "Lives";
def.choices.clear();
def.choices.push_back( "Use Bar Life" );
def.m_sName = "Lives";
def.m_vsChoices.clear();
def.m_vsChoices.push_back( "Use Bar Life" );
for( int i=1; i<=10; i++ )
def.choices.push_back( ssprintf("%d",i) );
def.m_vsChoices.push_back( ssprintf("%d",i) );
vDefs.push_back( def );
vHands.push_back( NULL );
def.name = "Type";
def.choices.clear();
def.m_sName = "Type";
def.m_vsChoices.clear();
FOREACH_CONST( StepsType, STEPS_TYPES_TO_SHOW.GetValue(), st )
def.choices.push_back( GAMEMAN->StepsTypeToString(*st) );
def.m_vsChoices.push_back( GAMEMAN->StepsTypeToString(*st) );
vDefs.push_back( def );
vHands.push_back( NULL );
def.name = "Type Meter";
def.choices.clear();
def.m_sName = "Type Meter";
def.m_vsChoices.clear();
for( int i=MIN_METER; i<=MAX_METER; i++ )
def.choices.push_back( ssprintf("%d",i) );
def.m_vsChoices.push_back( ssprintf("%d",i) );
vDefs.push_back( def );
vHands.push_back( NULL );
def.name = "Edit Entry";
def.choices.clear();
def.m_sName = "Edit Entry";
def.m_vsChoices.clear();
for( unsigned i=0; i<pCourse->m_vEntries.size(); i++ )
def.choices.push_back( ssprintf("%u of %u",i+1,pCourse->m_vEntries.size()) );
def.m_vsChoices.push_back( ssprintf("%u of %u",i+1,pCourse->m_vEntries.size()) );
vDefs.push_back( def );
vHands.push_back( NULL );
def.name = "Insert Entry";
def.choices.clear();
def.m_sName = "Insert Entry";
def.m_vsChoices.clear();
for( unsigned i=0; i<=pCourse->m_vEntries.size(); i++ )
{
CString s;
@@ -127,15 +127,15 @@ void ScreenEditCourse::Init()
s = ssprintf("After %u",i);
else
s = ssprintf("Before %u",i+1);
def.choices.push_back( s );
def.m_vsChoices.push_back( s );
}
vDefs.push_back( def );
vHands.push_back( NULL );
def.name = "Delete Entry";
def.choices.clear();
def.m_sName = "Delete Entry";
def.m_vsChoices.clear();
for( unsigned i=0; i<pCourse->m_vEntries.size(); i++ )
def.choices.push_back( ssprintf("%u of %u",i+1,pCourse->m_vEntries.size()) );
def.m_vsChoices.push_back( ssprintf("%u of %u",i+1,pCourse->m_vEntries.size()) );
vDefs.push_back( def );
vHands.push_back( NULL );
@@ -173,9 +173,9 @@ void ScreenEditCourse::AfterChangeValueInRow( PlayerNumber pn )
{
OptionRow &row = *m_pRows[ROW_TYPE];
OptionRowDefinition def = row.GetRowDef();
def.choices.clear();
def.m_vsChoices.clear();
vector<StepsTypeAndDifficulty> vThrowAway;
GetStepsTypeAndDifficulty( vThrowAway, def.choices );
GetStepsTypeAndDifficulty( vThrowAway, def.m_vsChoices );
row.Reload( def );
}
// fall through
+35 -35
View File
@@ -43,65 +43,65 @@ void ScreenEditCourseEntry::Init()
vector<OptionRowHandler*> vHands;
OptionRowDefinition def;
def.layoutType = LAYOUT_SHOW_ONE_IN_ROW;
def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
def.name = "Song Group";
def.choices.clear();
def.m_sName = "Song Group";
def.m_vsChoices.clear();
vector<CString> vsSongGroups;
SONGMAN->GetSongGroupNames( vsSongGroups );
def.choices.push_back( "(any)" );
def.m_vsChoices.push_back( "(any)" );
FOREACH_CONST( CString, vsSongGroups, s )
def.choices.push_back( *s );
def.m_vsChoices.push_back( *s );
vDefs.push_back( def );
vHands.push_back( NULL );
def.name = "Song";
def.choices.clear();
def.choices.push_back( "" );
def.m_sName = "Song";
def.m_vsChoices.clear();
def.m_vsChoices.push_back( "" );
vDefs.push_back( def );
vHands.push_back( NULL );
def.name = "Base Difficulty";
def.choices.clear();
def.choices.push_back( "(any)" );
def.m_sName = "Base Difficulty";
def.m_vsChoices.clear();
def.m_vsChoices.push_back( "(any)" );
FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), dc )
def.choices.push_back( DifficultyToThemedString(*dc) );
def.m_vsChoices.push_back( DifficultyToThemedString(*dc) );
vDefs.push_back( def );
vHands.push_back( NULL );
def.name = "Low Meter";
def.choices.clear();
def.choices.push_back( "(any)" );
def.m_sName = "Low Meter";
def.m_vsChoices.clear();
def.m_vsChoices.push_back( "(any)" );
for( int i=MIN_METER; i<=MAX_METER; i++ )
def.choices.push_back( ssprintf("%i",i) );
def.m_vsChoices.push_back( ssprintf("%i",i) );
vDefs.push_back( def );
vHands.push_back( NULL );
def.name = "High Meter";
def.choices.clear();
def.choices.push_back( "(any)" );
def.m_sName = "High Meter";
def.m_vsChoices.clear();
def.m_vsChoices.push_back( "(any)" );
for( int i=MIN_METER; i<=MAX_METER; i++ )
def.choices.push_back( ssprintf("%i",i) );
def.m_vsChoices.push_back( ssprintf("%i",i) );
vDefs.push_back( def );
vHands.push_back( NULL );
def.name = "Sort";
def.choices.clear();
def.m_sName = "Sort";
def.m_vsChoices.clear();
FOREACH_SongSort( i )
def.choices.push_back( SongSortToThemedString(i) );
def.m_vsChoices.push_back( SongSortToThemedString(i) );
vDefs.push_back( def );
vHands.push_back( NULL );
def.name = "Choose";
def.choices.clear();
def.m_sName = "Choose";
def.m_vsChoices.clear();
for( int i=0; i<20; i++ )
def.choices.push_back( FormatNumberAndSuffix(i+1) );
def.m_vsChoices.push_back( FormatNumberAndSuffix(i+1) );
vDefs.push_back( def );
vHands.push_back( NULL );
def.name = "Set Mods";
def.choices.clear();
def.choices.push_back( "Set Mods" );
def.m_sName = "Set Mods";
def.m_vsChoices.clear();
def.m_vsChoices.push_back( "Set Mods" );
vDefs.push_back( def );
vHands.push_back( NULL );
@@ -131,21 +131,21 @@ void ScreenEditCourseEntry::AfterChangeValueInRow( PlayerNumber pn )
if( iChoice == 0 )
ce.sSongGroup = "";
else
ce.sSongGroup = row.GetRowDef().choices[ iChoice ];
ce.sSongGroup = row.GetRowDef().m_vsChoices[ iChoice ];
}
// refresh songs
{
OptionRow &row = *m_pRows[ROW_SONG];
OptionRowDefinition def = row.GetRowDef();
def.choices.clear();
def.choices.push_back( "(any)" );
def.m_vsChoices.clear();
def.m_vsChoices.push_back( "(any)" );
vector<Song*> vpSongs;
if( ce.sSongGroup.empty() )
SONGMAN->GetSongs( vpSongs );
else
SONGMAN->GetSongs( vpSongs, ce.sSongGroup );
FOREACH_CONST( Song*, vpSongs, s )
def.choices.push_back( (*s)->GetTranslitFullTitle() );
def.m_vsChoices.push_back( (*s)->GetTranslitFullTitle() );
vector<Song*>::const_iterator iter = find( vpSongs.begin(), vpSongs.end(), ce.pSong );
if( iter != vpSongs.end() )
{
@@ -235,11 +235,11 @@ void ScreenEditCourseEntry::ImportAllOptions()
// import song group
{
OptionRow &row = *m_pRows[ROW_SONG_GROUP];
FOREACH_CONST( CString, row.GetRowDef().choices, s )
FOREACH_CONST( CString, row.GetRowDef().m_vsChoices, s )
{
if( *s == ce.sSongGroup )
{
int iChoice = s - row.GetRowDef().choices.begin();
int iChoice = s - row.GetRowDef().m_vsChoices.begin();
row.SetOneSharedSelection( iChoice );
AfterChangeValueInRow( GAMESTATE->m_MasterPlayerNumber );
break;
+12 -8
View File
@@ -15,13 +15,15 @@
AutoScreenMessage( SM_GoToOK )
AutoScreenMessage( SM_GoToCancel )
bool ScreenMiniMenu::s_bCancelled = false;
int ScreenMiniMenu::s_iLastRowCode = -1;
vector<int> ScreenMiniMenu::s_viLastAnswers;
void ScreenMiniMenu::MiniMenu( MenuDef* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel )
void ScreenMiniMenu::MiniMenu( MenuDef* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel, float fX, float fY )
{
ScreenMiniMenu *pNewScreen = new ScreenMiniMenu( pDef->sClassName );
pNewScreen->Init( pDef, SM_SendOnOK, SM_SendOnCancel );
pNewScreen->SetXY( fX, fY );
SCREENMAN->ZeroNextUpdate();
SCREENMAN->SetFromNewScreen( pNewScreen );
}
@@ -63,8 +65,8 @@ void ScreenMiniMenu::Init( const MenuDef* pDef, ScreenMessage SM_SendOnOK, Scree
const MenuRowDef &mr = m_vMenuRows[r];
OptionRowDefinition &def = vDefs[r];
def.name = mr.sName;
FontCharAliases::ReplaceMarkers( def.name ); // Allow special characters
def.m_sName = mr.sName;
FontCharAliases::ReplaceMarkers( def.m_sName ); // Allow special characters
if( mr.bEnabled )
{
@@ -77,14 +79,14 @@ void ScreenMiniMenu::Init( const MenuDef* pDef, ScreenMessage SM_SendOnOK, Scree
def.m_vEnabledForPlayers.clear();
}
def.bOneChoiceForAllPlayers = true;
def.selectType = SELECT_ONE;
def.layoutType = LAYOUT_SHOW_ONE_IN_ROW;
def.m_bOneChoiceForAllPlayers = true;
def.m_selectType = SELECT_ONE;
def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
def.m_bExportOnChange = false;
def.choices = mr.choices;
def.m_vsChoices = mr.choices;
FOREACH( CString, def.choices, c )
FOREACH( CString, def.m_vsChoices, c )
FontCharAliases::ReplaceMarkers( *c ); // Allow special characters
}
@@ -135,11 +137,13 @@ void ScreenMiniMenu::ExportOptions( int r, const vector<PlayerNumber> &vpns )
void ScreenMiniMenu::GoToNextScreen()
{
s_bCancelled = false;
SCREENMAN->PopTopScreen( m_SMSendOnOK );
}
void ScreenMiniMenu::GoToPrevScreen()
{
s_bCancelled = true;
SCREENMAN->PopTopScreen( m_SMSendOnCancel );
}
+2 -1
View File
@@ -80,7 +80,7 @@ struct MenuDef
class ScreenMiniMenu : public ScreenOptions
{
public:
static void MiniMenu( MenuDef* pDef, ScreenMessage smSendOnOK, ScreenMessage smSendOnCancel = SM_None );
static void MiniMenu( MenuDef* pDef, ScreenMessage smSendOnOK, ScreenMessage smSendOnCancel = SM_None, float fX = 0, float fY = 0 );
ScreenMiniMenu( CString sScreenClass );
void Init( const MenuDef* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel );
@@ -103,6 +103,7 @@ protected:
vector<MenuRowDef> m_vMenuRows;
public:
static bool s_bCancelled;
static int s_iLastRowCode;
static vector<int> s_viLastAnswers;
};
+6 -6
View File
@@ -45,15 +45,15 @@ void ScreenNetworkOptions::Init()
{
ScreenOptions::Init();
g_NetworkOptionsLines[PO_CONNECTION].choices.clear();
g_NetworkOptionsLines[PO_CONNECTION].m_vsChoices.clear();
if ( NSMAN->useSMserver )
g_NetworkOptionsLines[PO_CONNECTION].choices.push_back("Disconnect from "+NSMAN->GetServerName());
g_NetworkOptionsLines[PO_CONNECTION].m_vsChoices.push_back("Disconnect from "+NSMAN->GetServerName());
else
g_NetworkOptionsLines[PO_CONNECTION].choices.push_back("Connect...");
g_NetworkOptionsLines[PO_CONNECTION].m_vsChoices.push_back("Connect...");
g_NetworkOptionsLines[PO_SERVER].choices.clear();
g_NetworkOptionsLines[PO_SERVER].choices.push_back("Stop");
g_NetworkOptionsLines[PO_SERVER].choices.push_back("Start...");
g_NetworkOptionsLines[PO_SERVER].m_vsChoices.clear();
g_NetworkOptionsLines[PO_SERVER].m_vsChoices.push_back("Stop");
g_NetworkOptionsLines[PO_SERVER].m_vsChoices.push_back("Start...");
//Enable all lines for all players
for ( unsigned int i = 0; i < NUM_NETWORK_OPTIONS_LINES; i++ )
+14 -13
View File
@@ -85,6 +85,7 @@ ScreenOptions::ScreenOptions( CString sClassName ) : ScreenWithMenuElements(sCla
SHOW_SCROLL_BAR (m_sName,"ShowScrollBar"),
SCROLL_BAR_HEIGHT (m_sName,"ScrollBarHeight"),
SCROLL_BAR_TIME (m_sName,"ScrollBarTime"),
LINE_HIGHLIGHT_X (m_sName,"LineHighlightX"),
EXPLANATION_ZOOM (m_sName,"ExplanationZoom"),
SHOW_EXIT_ROW (m_sName,"ShowExitRow"),
SEPARATE_EXIT_ROW (m_sName,"SeparateExitRow"),
@@ -157,7 +158,7 @@ void ScreenOptions::InitMenu( InputMode im, const vector<OptionRowDefinition> &v
vpns.push_back( p );
this->ImportOptions( r, vpns );
CHECKPOINT_M( ssprintf("row %i: %s", r, row.GetRowDef().name.c_str()) );
CHECKPOINT_M( ssprintf("row %i: %s", r, row.GetRowDef().m_sName.c_str()) );
row.AfterImportOptions();
}
@@ -172,7 +173,7 @@ void ScreenOptions::InitMenu( InputMode im, const vector<OptionRowDefinition> &v
{
m_sprLineHighlight[p].Load( THEME->GetPathG(m_sName,"line highlight") );
m_sprLineHighlight[p].SetName( "LineHighlight" );
m_sprLineHighlight[p].SetX( SCREEN_CENTER_X );
m_sprLineHighlight[p].SetX( LINE_HIGHLIGHT_X );
m_framePage.AddChild( &m_sprLineHighlight[p] );
ON_COMMAND( m_sprLineHighlight[p] );
}
@@ -317,7 +318,7 @@ CString ScreenOptions::GetExplanationText( int iRow ) const
{
OptionRow &row = *m_pRows[iRow];
CString sLineName = row.GetRowDef().name;
CString sLineName = row.GetRowDef().m_sName;
ASSERT( !sLineName.empty() );
bool bAllowExplanation = row.GetRowDef().m_bAllowExplanation;
@@ -830,7 +831,7 @@ void ScreenOptions::ProcessMenuStart( PlayerNumber pn, const InputEventType type
}
}
if( row.GetRowDef().selectType == SELECT_MULTIPLE )
if( row.GetRowDef().m_selectType == SELECT_MULTIPLE )
{
int iChoiceInRow = row.GetChoiceInRowWithFocus(pn);
bool bSelected = !row.GetSelected( pn, iChoiceInRow );
@@ -862,10 +863,10 @@ void ScreenOptions::ProcessMenuStart( PlayerNumber pn, const InputEventType type
break;
case NAV_TOGGLE_THREE_KEY:
case NAV_TOGGLE_FIVE_KEY:
if( row.GetRowDef().selectType != SELECT_MULTIPLE )
if( row.GetRowDef().m_selectType != SELECT_MULTIPLE )
{
int iChoiceInRow = row.GetChoiceInRowWithFocus(pn);
if( row.GetRowDef().bOneChoiceForAllPlayers )
if( row.GetRowDef().m_bOneChoiceForAllPlayers )
row.SetOneSharedSelection( iChoiceInRow );
else
row.SetOneSelection( pn, iChoiceInRow );
@@ -894,7 +895,7 @@ void ScreenOptions::StoreFocus( PlayerNumber pn )
/* Long rows always put us in the center, so don't update the focus. */
int iCurrentRow = m_iCurrentRow[pn];
const OptionRow &row = *m_pRows[iCurrentRow];
if( row.GetRowDef().layoutType == LAYOUT_SHOW_ONE_IN_ROW )
if( row.GetRowDef().m_layoutType == LAYOUT_SHOW_ONE_IN_ROW )
return;
int iWidth, iY;
@@ -912,7 +913,7 @@ void ScreenOptions::ChangeValueInRow( PlayerNumber pn, int iDelta, bool Repeat )
OptionRow &row = *m_pRows[iCurRow];
const int iNumChoices = row.GetRowDef().choices.size();
const int iNumChoices = row.GetRowDef().m_vsChoices.size();
if( m_OptionsNavigation == NAV_THREE_KEY_MENU && iNumChoices <= 1 ) // 1 or 0
{
@@ -945,7 +946,7 @@ void ScreenOptions::ChangeValueInRow( PlayerNumber pn, int iDelta, bool Repeat )
row.SetChoiceInRowWithFocus( pn, iNewChoiceWithFocus );
StoreFocus( pn );
if( row.GetRowDef().bOneChoiceForAllPlayers )
if( row.GetRowDef().m_bOneChoiceForAllPlayers )
{
/* If this row is bOneChoiceForAllPlayers, then lock the cursors together
* for this row. Don't do this in toggle modes, since the current selection
@@ -953,7 +954,7 @@ void ScreenOptions::ChangeValueInRow( PlayerNumber pn, int iDelta, bool Repeat )
bool bForceFocusedChoiceTogether = false;
if( m_OptionsNavigation!=NAV_TOGGLE_THREE_KEY &&
m_OptionsNavigation!=NAV_TOGGLE_FIVE_KEY &&
row.GetRowDef().bOneChoiceForAllPlayers )
row.GetRowDef().m_bOneChoiceForAllPlayers )
{
bForceFocusedChoiceTogether = true;
}
@@ -980,7 +981,7 @@ void ScreenOptions::ChangeValueInRow( PlayerNumber pn, int iDelta, bool Repeat )
}
else
{
if( row.GetRowDef().selectType == SELECT_MULTIPLE )
if( row.GetRowDef().m_selectType == SELECT_MULTIPLE )
; // do nothing. User must press Start to toggle the selection.
else
row.SetOneSelection( p, iNewChoiceWithFocus );
@@ -995,7 +996,7 @@ void ScreenOptions::ChangeValueInRow( PlayerNumber pn, int iDelta, bool Repeat )
}
else
{
if( row.GetRowDef().selectType == SELECT_MULTIPLE )
if( row.GetRowDef().m_selectType == SELECT_MULTIPLE )
; // do nothing. User must press Start to toggle the selection.
else
row.SetOneSelection( pn, iNewChoiceWithFocus );
@@ -1059,7 +1060,7 @@ void ScreenOptions::MoveRow( PlayerNumber pn, int dir, bool Repeat )
{
case NAV_TOGGLE_THREE_KEY:
case NAV_TOGGLE_FIVE_KEY:
if( row.GetRowDef().layoutType != LAYOUT_SHOW_ONE_IN_ROW )
if( row.GetRowDef().m_layoutType != LAYOUT_SHOW_ONE_IN_ROW )
{
int iSelectionDist = -1;
for( unsigned i = 0; i < row.GetTextItemsSize(); ++i )
+1
View File
@@ -137,6 +137,7 @@ protected:
ThemeMetric<bool> SHOW_SCROLL_BAR;
ThemeMetric<float> SCROLL_BAR_HEIGHT;
ThemeMetric<float> SCROLL_BAR_TIME;
ThemeMetric<float> LINE_HIGHLIGHT_X;
ThemeMetric<float> EXPLANATION_ZOOM;
ThemeMetric<bool> SHOW_EXIT_ROW;
ThemeMetric<bool> SEPARATE_EXIT_ROW;
+1 -1
View File
@@ -204,7 +204,7 @@ void ScreenOptionsMaster::RefreshIcons( int r, PlayerNumber pn )
/* XXX: hack to not display text in the song options menu */
if( def.bOneChoiceForAllPlayers )
if( def.m_bOneChoiceForAllPlayers )
sIcon = "";
LoadOptionIcon( pn, r, sIcon );
+34 -26
View File
@@ -71,13 +71,14 @@ void ScreenOptionsProfiles::Init()
vector<OptionRowHandler*> vHands;
OptionRowDefinition def;
def.layoutType = LAYOUT_SHOW_ONE_IN_ROW;
def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
def.m_bOneChoiceForAllPlayers = true;
def.m_bAllowThemeItems = false;
def.m_bAllowThemeTitles = false;
def.m_bAllowExplanation = false;
def.name = "Create New";
def.choices.clear();
def.m_sName = "Create New";
def.m_vsChoices.clear();
vDefs.push_back( def );
vHands.push_back( NULL );
@@ -86,8 +87,8 @@ void ScreenOptionsProfiles::Init()
FOREACH_CONST( CString, vsProfileNames, s )
{
def.name = *s;
def.choices.clear();
def.m_sName = *s;
def.m_vsChoices.clear();
vDefs.push_back( def );
vHands.push_back( NULL );
}
@@ -152,29 +153,32 @@ void ScreenOptionsProfiles::HandleScreenMessage( const ScreenMessage SM )
}
else if( SM == SM_BackFromProfileContextMenu )
{
switch( ScreenMiniMenu::s_iLastRowCode )
if( !ScreenMiniMenu::s_bCancelled )
{
default:
ASSERT(0);
case A_EDIT:
SCREENMAN->SetNewScreen( "ScreenOptionsEditProfile" );
break;
case A_RENAME:
switch( ScreenMiniMenu::s_iLastRowCode )
{
CString sCurrentProfileName = PROFILEMAN->ProfileIDToName( s_sCurrentProfileID );
ScreenTextEntry::TextEntry( SM_BackFromEnterName, "Enter a name for a new profile.", sCurrentProfileName, PROFILE_MAX_NAME_LENGTH, ValidateProfileName );
default:
ASSERT(0);
case A_EDIT:
SCREENMAN->SetNewScreen( "ScreenOptionsEditProfile" );
break;
case A_RENAME:
{
CString sCurrentProfileName = PROFILEMAN->ProfileIDToName( s_sCurrentProfileID );
ScreenTextEntry::TextEntry( SM_BackFromEnterName, "Enter a name for a new profile.", sCurrentProfileName, PROFILE_MAX_NAME_LENGTH, ValidateProfileName );
}
break;
case A_DELETE:
{
CString sCurrentProfileName = PROFILEMAN->ProfileIDToName( s_sCurrentProfileID );
CString sMessage = ssprintf( "Are you sure you want to delete the profile '%s'?", sCurrentProfileName.c_str() );
ScreenPrompt::Prompt( SM_BackFromDelete, sMessage, PROMPT_YES_NO );
}
break;
case A_CANCEL:
SCREENMAN->PlayInvalidSound();
break;
}
break;
case A_DELETE:
{
CString sCurrentProfileName = PROFILEMAN->ProfileIDToName( s_sCurrentProfileID );
CString sMessage = ssprintf( "Are you sure you want to delete the profile '%s'?", sCurrentProfileName.c_str() );
ScreenPrompt::Prompt( SM_BackFromDelete, sMessage, PROMPT_YES_NO );
}
break;
case A_CANCEL:
SCREENMAN->PlayInvalidSound();
break;
}
}
else if( SM == SM_BackFromDelete )
@@ -185,6 +189,8 @@ void ScreenOptionsProfiles::HandleScreenMessage( const ScreenMessage SM )
SCREENMAN->SetNewScreen( m_sName ); // reload
}
}
ScreenOptions::HandleScreenMessage( SM );
}
void ScreenOptionsProfiles::ProcessMenuStart( PlayerNumber pn, const InputEventType type )
@@ -208,7 +214,9 @@ void ScreenOptionsProfiles::ProcessMenuStart( PlayerNumber pn, const InputEventT
vector<CString> vsProfileIDs;
PROFILEMAN->GetLocalProfileIDs( vsProfileIDs );
s_sCurrentProfileID = vsProfileIDs[ iProfileIndex ];
ScreenMiniMenu::MiniMenu( &g_ProfileContextMenu, SM_BackFromProfileContextMenu );
int iThrowAway, iX, iY;
GetWidthXY( PLAYER_1, iRow, 0, iThrowAway, iX, iY );
ScreenMiniMenu::MiniMenu( &g_ProfileContextMenu, SM_BackFromProfileContextMenu, SM_BackFromProfileContextMenu, (float)iX, (float)iY );
}
}
+17 -17
View File
@@ -46,31 +46,31 @@ void ScreenProfileOptions::Init()
{
ScreenOptions::Init();
g_ProfileOptionsLines[PO_PLAYER1].choices.clear();
g_ProfileOptionsLines[PO_PLAYER1].choices.push_back( "-NONE-" );
PROFILEMAN->GetLocalProfileNames( g_ProfileOptionsLines[PO_PLAYER1].choices );
g_ProfileOptionsLines[PO_PLAYER1].m_vsChoices.clear();
g_ProfileOptionsLines[PO_PLAYER1].m_vsChoices.push_back( "-NONE-" );
PROFILEMAN->GetLocalProfileNames( g_ProfileOptionsLines[PO_PLAYER1].m_vsChoices );
g_ProfileOptionsLines[PO_PLAYER2].choices.clear();
g_ProfileOptionsLines[PO_PLAYER2].choices.push_back( "-NONE-" );
PROFILEMAN->GetLocalProfileNames( g_ProfileOptionsLines[PO_PLAYER2].choices );
g_ProfileOptionsLines[PO_PLAYER2].m_vsChoices.clear();
g_ProfileOptionsLines[PO_PLAYER2].m_vsChoices.push_back( "-NONE-" );
PROFILEMAN->GetLocalProfileNames( g_ProfileOptionsLines[PO_PLAYER2].m_vsChoices );
g_ProfileOptionsLines[PO_DELETE_].choices.clear();
g_ProfileOptionsLines[PO_DELETE_].choices.push_back( "-NONE-" );
PROFILEMAN->GetLocalProfileNames( g_ProfileOptionsLines[PO_DELETE_].choices );
g_ProfileOptionsLines[PO_DELETE_].m_vsChoices.clear();
g_ProfileOptionsLines[PO_DELETE_].m_vsChoices.push_back( "-NONE-" );
PROFILEMAN->GetLocalProfileNames( g_ProfileOptionsLines[PO_DELETE_].m_vsChoices );
g_ProfileOptionsLines[PO_RENAME_].choices.clear();
g_ProfileOptionsLines[PO_RENAME_].choices.push_back( "-NONE-" );
PROFILEMAN->GetLocalProfileNames( g_ProfileOptionsLines[PO_RENAME_].choices );
g_ProfileOptionsLines[PO_RENAME_].m_vsChoices.clear();
g_ProfileOptionsLines[PO_RENAME_].m_vsChoices.push_back( "-NONE-" );
PROFILEMAN->GetLocalProfileNames( g_ProfileOptionsLines[PO_RENAME_].m_vsChoices );
if( PREFSMAN->GetMemoryCardOsMountPoint(PLAYER_1).Get().empty() )
g_ProfileOptionsLines[PO_OS_MOUNT_1].choices[0] = "-NOT SET IN INI-";
g_ProfileOptionsLines[PO_OS_MOUNT_1].m_vsChoices[0] = "-NOT SET IN INI-";
else
g_ProfileOptionsLines[PO_OS_MOUNT_1].choices[0] = PREFSMAN->GetMemoryCardOsMountPoint(PLAYER_1).Get();
g_ProfileOptionsLines[PO_OS_MOUNT_1].m_vsChoices[0] = PREFSMAN->GetMemoryCardOsMountPoint(PLAYER_1).Get();
if( PREFSMAN->GetMemoryCardOsMountPoint(PLAYER_2).Get().empty() )
g_ProfileOptionsLines[PO_OS_MOUNT_2].choices[0] = "-NOT SET IN INI-";
g_ProfileOptionsLines[PO_OS_MOUNT_2].m_vsChoices[0] = "-NOT SET IN INI-";
else
g_ProfileOptionsLines[PO_OS_MOUNT_2].choices[0] = PREFSMAN->GetMemoryCardOsMountPoint(PLAYER_2).Get();
g_ProfileOptionsLines[PO_OS_MOUNT_2].m_vsChoices[0] = PREFSMAN->GetMemoryCardOsMountPoint(PLAYER_2).Get();
//Enable all lines for all players
for ( unsigned int i = 0; i < NUM_PROFILE_OPTIONS_LINES; i++ )
@@ -235,7 +235,7 @@ CString ScreenProfileOptions::GetSelectedProfileName()
const int Selection = row.GetOneSharedSelection();
if( !Selection )
return "";
return g_ProfileOptionsLines[PO_PLAYER1].choices[ Selection ];
return g_ProfileOptionsLines[PO_PLAYER1].m_vsChoices[ Selection ];
}
/*
+3 -3
View File
@@ -34,10 +34,10 @@ void ScreenSMOnlineLogin::Init()
{
ScreenOptions::Init();
g_ProfileLine[0].choices.clear();
PROFILEMAN->GetLocalProfileNames( g_ProfileLine[0].choices );
g_ProfileLine[0].m_vsChoices.clear();
PROFILEMAN->GetLocalProfileNames( g_ProfileLine[0].m_vsChoices );
if(!g_ProfileLine[0].choices.size())
if(!g_ProfileLine[0].m_vsChoices.size())
{
SCREENMAN->SystemMessage("You Must Define A Profile!");
SCREENMAN->SetNewScreen("ScreenProfileOptions");