From e7936d8312f71beed00b4ff30629e770f9bf4541 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sat, 10 Jan 2004 05:09:51 +0000 Subject: [PATCH] remove MAX_OPTION_LINES, cleanup selection tracking --- stepmania/src/ScreenOptions.cpp | 240 +++++++++++++------------ stepmania/src/ScreenOptions.h | 17 +- stepmania/src/ScreenOptionsMaster.cpp | 40 ++--- stepmania/src/ScreenOptionsMaster.h | 16 +- stepmania/src/ScreenProfileOptions.cpp | 36 ++-- 5 files changed, 182 insertions(+), 167 deletions(-) diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index 90608b5ba8..83ce6ef7f5 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -105,9 +105,6 @@ ScreenOptions::ScreenOptions( CString sClassName ) : Screen(sClassName) { m_iCurrentRow[p] = 0; m_bWasOnExit[p] = false; - - for( unsigned l=0; lm_OptionIcons[pn].Load( pn, sText, false ); } -void ScreenOptions::Init( InputMode im, OptionRow OptionRows[], int iNumOptionLines ) +void ScreenOptions::Init( InputMode im, OptionRowData OptionRows[], int iNumOptionLines ) { LOG->Trace( "ScreenOptions::Set()" ); m_InputMode = im; - this->ImportOptions(); - - int r; - for( r=0; rm_RowDef = OptionRows[r]; + for( int r=0; rm_RowDef = OptionRows[r]; - if( m_Rows[r]->m_RowDef.bOneChoiceForAllPlayers ) - for( int p=1; pm_iSelection[p] = 0; + + if( m_Rows[r]->m_RowDef.bOneChoiceForAllPlayers ) + for( int p=1; pm_iSelection[p] = m_Rows[r]->m_iSelection[0]; + } } + this->ImportOptions(); - int p; + { + for( int r=0; rm_RowDef.bOneChoiceForAllPlayers ) + for( int p=1; pm_iSelection[p] = m_Rows[r]->m_iSelection[0]; + } + } m_sprPage.Load( THEME->GetPathToG(m_sName+" page") ); m_sprPage->SetName( "Page" ); @@ -146,109 +153,114 @@ void ScreenOptions::Init( InputMode im, OptionRow OptionRows[], int iNumOptionLi m_framePage.AddChild( m_sprPage ); // init highlights - for( p=0; pIsHumanPlayer(p) ) - continue; // skip + for( int p=0; pIsHumanPlayer(p) ) + continue; // skip - m_sprLineHighlight[p].Load( THEME->GetPathToG("ScreenOptions line highlight") ); - m_sprLineHighlight[p].SetName( "LineHighlight" ); - m_sprLineHighlight[p].SetX( CENTER_X ); - m_framePage.AddChild( &m_sprLineHighlight[p] ); - UtilOnCommand( m_sprLineHighlight[p], "ScreenOptions" ); + m_sprLineHighlight[p].Load( THEME->GetPathToG("ScreenOptions line highlight") ); + m_sprLineHighlight[p].SetName( "LineHighlight" ); + m_sprLineHighlight[p].SetX( CENTER_X ); + m_framePage.AddChild( &m_sprLineHighlight[p] ); + UtilOnCommand( m_sprLineHighlight[p], "ScreenOptions" ); - m_Highlight[p].Load( (PlayerNumber)p, false ); - m_framePage.AddChild( &m_Highlight[p] ); + m_Highlight[p].Load( (PlayerNumber)p, false ); + m_framePage.AddChild( &m_Highlight[p] ); + } } - // init underlines - for( p=0; pIsHumanPlayer(p) ) - continue; // skip + for( int p=0; pIsHumanPlayer(p) ) + continue; // skip - for( unsigned l=0; l & textItems = row.m_textItems; - const OptionRow &optline = m_Rows[r]->m_RowDef; - - unsigned c; - - m_framePage.AddChild( &row.m_sprBullet ); - m_framePage.AddChild( &row.m_textTitle ); - - float fX = ITEMS_START_X; // indent 70 pixels - for( c=0; cLoadFromFont( THEME->GetPathToF("ScreenOptions item") ); - bt->SetText( optline.choices[c] ); - bt->SetZoom( ITEMS_ZOOM ); - bt->EnableShadow( false ); + vector & textItems = row.m_textItems; + const OptionRowData &optline = m_Rows[r]->m_RowDef; - // set the X position of each item in the line - const float fItemWidth = bt->GetZoomedWidth(); - fX += fItemWidth/2; - bt->SetX( fX ); - fX += fItemWidth/2 + ITEMS_GAP_X; - } + unsigned c; - if( fX > SCREEN_RIGHT-40 ) - { - // It goes off the edge of the screen. Re-init with the "long row" style. - row.m_bRowIsLong = true; - for( unsigned j=0; jIsHumanPlayer(p) ) - continue; - BitmapText *bt = new BitmapText; textItems.push_back( bt ); - const int iChoiceInRow = m_iSelectedOption[p][r]; - bt->LoadFromFont( THEME->GetPathToF("ScreenOptions item") ); - bt->SetText( optline.choices[iChoiceInRow] ); + bt->SetText( optline.choices[c] ); bt->SetZoom( ITEMS_ZOOM ); bt->EnableShadow( false ); - /* if choices are locked together, center the item. */ - if( optline.bOneChoiceForAllPlayers ) - bt->SetX( (ITEM_X[0]+ITEM_X[1])/2 ); - else - bt->SetX( ITEM_X[p] ); - - /* If bOneChoiceForAllPlayers, then only initialize one text item. */ - if( optline.bOneChoiceForAllPlayers ) - break; + // set the X position of each item in the line + const float fItemWidth = bt->GetZoomedWidth(); + fX += fItemWidth/2; + bt->SetX( fX ); + fX += fItemWidth/2 + ITEMS_GAP_X; } - } - for( c=0; c SCREEN_RIGHT-40 ) + { + // It goes off the edge of the screen. Re-init with the "long row" style. + row.m_bRowIsLong = true; + for( unsigned j=0; jIsHumanPlayer(p) ) + continue; + + BitmapText *bt = new BitmapText; + textItems.push_back( bt ); + + const int iChoiceInRow = m_Rows[r]->m_iSelection[p]; + + bt->LoadFromFont( THEME->GetPathToF("ScreenOptions item") ); + bt->SetText( optline.choices[iChoiceInRow] ); + bt->SetZoom( ITEMS_ZOOM ); + bt->EnableShadow( false ); + + /* if choices are locked together, center the item. */ + if( optline.bOneChoiceForAllPlayers ) + bt->SetX( (ITEM_X[0]+ITEM_X[1])/2 ); + else + bt->SetX( ITEM_X[p] ); + + /* If bOneChoiceForAllPlayers, then only initialize one text item. */ + if( optline.bOneChoiceForAllPlayers ) + break; + } + } + + for( c=0; cGetPathToF("ScreenOptions explanation") ); - m_textExplanation[p].SetZoom( EXPLANATION_ZOOM ); - m_textExplanation[p].SetShadowLength( 0 ); - m_framePage.AddChild( &m_textExplanation[p] ); + for( int p=0; pGetPathToF("ScreenOptions explanation") ); + m_textExplanation[p].SetZoom( EXPLANATION_ZOOM ); + m_textExplanation[p].SetShadowLength( 0 ); + m_framePage.AddChild( &m_textExplanation[p] ); + } } /* Hack: if m_CurStyle is set, we're probably in the player or song options menu, so * the player name is meaningful. Otherwise, we're probably in the system menu. */ if( GAMESTATE->m_CurStyle != STYLE_INVALID ) { - for( p=0; pGetPathToF( "ScreenOptions player") ); m_textPlayerName[p].SetName( ssprintf("PlayerNameP%i",p+1) ); @@ -299,7 +313,7 @@ void ScreenOptions::Init( InputMode im, OptionRow OptionRows[], int iNumOptionLi m_ScrollBar.SetName( "DualScrollBar", "ScrollBar" ); m_ScrollBar.SetBarHeight( SCROLL_BAR_HEIGHT ); m_ScrollBar.SetBarTime( SCROLL_BAR_TIME ); - for( p=0; pIsHumanPlayer(p) ); m_ScrollBar.Load(); UtilSetXY( m_ScrollBar, "ScreenOptions" ); @@ -314,8 +328,10 @@ void ScreenOptions::Init( InputMode im, OptionRow OptionRows[], int iNumOptionLi switch( m_InputMode ) { case INPUTMODE_INDIVIDUAL: - for( p=0; pm_iSelection[pn]; return *row.m_textItems[iOptionInRow]; } @@ -615,9 +635,9 @@ void ScreenOptions::UpdateText( PlayerNumber player_no, int iRow ) if( !row.m_bRowIsLong ) return; - int iChoiceInRow = m_iSelectedOption[player_no][iRow]; + int iChoiceInRow = m_Rows[iRow]->m_iSelection[player_no]; - const OptionRow &optrow = m_Rows[iRow]->m_RowDef; + const OptionRowData &optrow = m_Rows[iRow]->m_RowDef; unsigned item_no = optrow.bOneChoiceForAllPlayers?0:player_no; @@ -1013,7 +1033,7 @@ void ScreenOptions::ChangeValue( PlayerNumber pn, int iDelta, bool Repeat ) { const int iCurRow = m_iCurrentRow[pn]; Row &row = *m_Rows[iCurRow]; - OptionRow &optrow = m_Rows[iCurRow]->m_RowDef; + OptionRowData &optrow = m_Rows[iCurRow]->m_RowDef; /* If START is being pressed, and in NAV_THREE_KEY, then we're holding left/right * and start to move backwards. Don't move left and right, too. */ @@ -1044,23 +1064,23 @@ void ScreenOptions::ChangeValue( PlayerNumber pn, int iDelta, bool Repeat ) if( p != pn ) continue; // skip - int iNewSel = m_iSelectedOption[p][iCurRow] + iDelta; + int iNewSel = m_Rows[iCurRow]->m_iSelection[p] + iDelta; wrap( iNewSel, iNumOptions ); - if( iNewSel != m_iSelectedOption[p][iCurRow] ) + if( iNewSel != m_Rows[iCurRow]->m_iSelection[p] ) bOneChanged = true; if( optrow.bOneChoiceForAllPlayers ) { for( int p2=0; p2m_iSelection[p2] = iNewSel; UpdateText( (PlayerNumber)p2, iCurRow ); } } else { - m_iSelectedOption[p][iCurRow] = iNewSel; + m_Rows[iCurRow]->m_iSelection[p] = iNewSel; UpdateText( (PlayerNumber)p, iCurRow ); } OnChange( (PlayerNumber)p ); diff --git a/stepmania/src/ScreenOptions.h b/stepmania/src/ScreenOptions.h index d8ab2cd99e..eca9261286 100644 --- a/stepmania/src/ScreenOptions.h +++ b/stepmania/src/ScreenOptions.h @@ -23,18 +23,16 @@ #include "DualScrollBar.h" -const unsigned MAX_OPTION_LINES = 40; - -struct OptionRow +struct OptionRowData { CString name; bool bOneChoiceForAllPlayers; vector choices; bool bMultiSelect; - OptionRow(): name(""), bOneChoiceForAllPlayers(false), bMultiSelect(false) { } + OptionRowData(): name(""), bOneChoiceForAllPlayers(false), bMultiSelect(false) { } - OptionRow( const char *n, int 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 ) + OptionRowData( const char *n, int 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 ) { name = n; bOneChoiceForAllPlayers = !!b; @@ -56,7 +54,7 @@ class ScreenOptions : public Screen { public: ScreenOptions( CString sClassName ); - void Init( InputMode im, OptionRow OptionRow[], int iNumOptionLines ); + void Init( InputMode im, OptionRowData OptionRowData[], int iNumOptionLines ); virtual ~ScreenOptions(); virtual void Update( float fDeltaTime ); virtual void DrawPrimitives(); @@ -96,14 +94,12 @@ protected: void MenuDown( PlayerNumber pn, const InputEventType type ) { Move( pn, +1, type != IET_FIRST_PRESS ); } void Move( PlayerNumber pn, int dir, bool Repeat ); - /* Returns -1 if on a row with no OptionRow (eg. EXIT). */ + /* Returns -1 if on a row with no OptionRowData (eg. EXIT). */ int GetCurrentRow(PlayerNumber pn = PLAYER_1) const; MenuElements m_Menu; protected: // derived classes need access to these - int m_iSelectedOption[NUM_PLAYERS][MAX_OPTION_LINES]; - void LoadOptionIcon( PlayerNumber pn, int iRow, CString sText ); enum Navigation { NAV_THREE_KEY, NAV_THREE_KEY_MENU, NAV_FIVE_KEY }; void SetNavigation( Navigation nav ) { m_OptionsNavigation = nav; } @@ -114,7 +110,7 @@ protected: { Row(); ~Row(); - OptionRow m_RowDef; + OptionRowData m_RowDef; enum { ROW_NORMAL, ROW_EXIT } Type; vector m_textItems; Sprite m_sprBullet; @@ -125,6 +121,7 @@ protected: float m_fY; bool m_bRowIsLong; // goes off edge of screen bool m_bHidden; // currently off screen + int m_iSelection[NUM_PLAYERS]; }; vector m_Rows; diff --git a/stepmania/src/ScreenOptionsMaster.cpp b/stepmania/src/ScreenOptionsMaster.cpp index 9d22090fb0..7b5dc29a31 100644 --- a/stepmania/src/ScreenOptionsMaster.cpp +++ b/stepmania/src/ScreenOptionsMaster.cpp @@ -35,7 +35,7 @@ // #define PREV_SCREEN( play_mode ) THEME->GetMetric (m_sName,"PrevScreen"+Capitalize(PlayModeToString(play_mode))) /* Add the list named "ListName" to the given row/handler. */ -void ScreenOptionsMaster::SetList( OptionRow &row, OptionRowHandler &hand, CString ListName, CString &TitleOut ) +void ScreenOptionsMaster::SetList( OptionRowData &row, OptionRowHandler &hand, CString ListName, CString &TitleOut ) { hand.type = ROW_LIST; @@ -89,7 +89,7 @@ void ScreenOptionsMaster::SetList( OptionRow &row, OptionRowHandler &hand, CStri } /* Add a list of difficulties/edits to the given row/handler. */ -void ScreenOptionsMaster::SetStep( OptionRow &row, OptionRowHandler &hand ) +void ScreenOptionsMaster::SetStep( OptionRowData &row, OptionRowHandler &hand ) { hand.type = ROW_STEP; row.bOneChoiceForAllPlayers = false; @@ -131,7 +131,7 @@ void ScreenOptionsMaster::SetStep( OptionRow &row, OptionRowHandler &hand ) /* Add the given configuration value to the given row/handler. */ -void ScreenOptionsMaster::SetConf( OptionRow &row, OptionRowHandler &hand, CString param, CString &TitleOut ) +void ScreenOptionsMaster::SetConf( OptionRowData &row, OptionRowHandler &hand, CString param, CString &TitleOut ) { /* Configuration values are never per-player. */ row.bOneChoiceForAllPlayers = true; @@ -147,7 +147,7 @@ void ScreenOptionsMaster::SetConf( OptionRow &row, OptionRowHandler &hand, CStri } /* Add a list of available characters to the given row/handler. */ -void ScreenOptionsMaster::SetCharacter( OptionRow &row, OptionRowHandler &hand ) +void ScreenOptionsMaster::SetCharacter( OptionRowData &row, OptionRowHandler &hand ) { hand.type = ROW_CHARACTER; row.bOneChoiceForAllPlayers = false; @@ -163,7 +163,7 @@ void ScreenOptionsMaster::SetCharacter( OptionRow &row, OptionRowHandler &hand ) } /* Add a list of available characters to the given row/handler. */ -void ScreenOptionsMaster::SetSaveToProfile( OptionRow &row, OptionRowHandler &hand ) +void ScreenOptionsMaster::SetSaveToProfile( OptionRowData &row, OptionRowHandler &hand ) { hand.type = ROW_SAVE_TO_PROFILE; row.bOneChoiceForAllPlayers = false; @@ -213,10 +213,10 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ): if( NumRows == -1 ) RageException::Throw( "%s::OptionMenuFlags is missing \"rows\" field", m_sName.c_str() ); - m_OptionRowAlloc = new OptionRow[NumRows]; + m_OptionRowAlloc = new OptionRowData[NumRows]; for( i = 0; (int) i < NumRows; ++i ) { - OptionRow &row = m_OptionRowAlloc[i]; + OptionRowData &row = m_OptionRowAlloc[i]; CStringArray asParts; split( ROW_LINE(i), ";", asParts ); @@ -271,7 +271,7 @@ ScreenOptionsMaster::~ScreenOptionsMaster() delete [] m_OptionRowAlloc; } -int ScreenOptionsMaster::ImportOption( const OptionRow &row, const OptionRowHandler &hand, int pn, int rowno ) +int ScreenOptionsMaster::ImportOption( const OptionRowData &row, const OptionRowHandler &hand, int pn, int rowno ) { /* Figure out which selection is the default. */ switch( hand.type ) @@ -362,13 +362,13 @@ void ScreenOptionsMaster::ImportOptions() for( unsigned i = 0; i < OptionRowHandlers.size(); ++i ) { const OptionRowHandler &hand = OptionRowHandlers[i]; - const OptionRow &row = m_OptionRowAlloc[i]; + const OptionRowData &row = m_OptionRowAlloc[i]; if( row.bOneChoiceForAllPlayers ) { int col = ImportOption( row, hand, 0, i ); - m_iSelectedOption[0][i] = col; - ASSERT( m_iSelectedOption[0][i] < (int)row.choices.size() ); + m_Rows[i]->m_iSelection[0] = col; + ASSERT( m_Rows[i]->m_iSelection[0] < (int)row.choices.size() ); } else for( int pn=0; pnm_iSelection[pn] = col; + ASSERT( m_Rows[i]->m_iSelection[pn] < (int)row.choices.size() ); } } } /* Returns an OPT mask. */ -int ScreenOptionsMaster::ExportOption( const OptionRow &row, const OptionRowHandler &hand, int pn, int sel ) +int ScreenOptionsMaster::ExportOption( const OptionRowData &row, const OptionRowHandler &hand, int pn, int sel ) { /* Figure out which selection is the default. */ switch( hand.type ) @@ -485,14 +485,14 @@ void ScreenOptionsMaster::ExportOptions() for( i = 0; i < OptionRowHandlers.size(); ++i ) { const OptionRowHandler &hand = OptionRowHandlers[i]; - const OptionRow &row = m_OptionRowAlloc[i]; + const OptionRowData &row = m_OptionRowAlloc[i]; for( int pn=0; pnIsHumanPlayer(pn) ) continue; - ChangeMask |= ExportOption( row, hand, pn, m_iSelectedOption[pn][i] ); + ChangeMask |= ExportOption( row, hand, pn, m_Rows[i]->m_iSelection[pn] ); } } @@ -507,7 +507,7 @@ void ScreenOptionsMaster::ExportOptions() const OptionRowHandler &hand = OptionRowHandlers[row]; if( hand.type == ROW_LIST ) { - const int sel = m_iSelectedOption[0][row]; + const int sel = m_Rows[row]->m_iSelection[0]; const ModeChoice &mc = hand.ListEntries[sel]; if( mc.m_sScreen != "" ) m_NextScreen = mc.m_sScreen; @@ -571,8 +571,6 @@ void ScreenOptionsMaster::GoToPrevState() void ScreenOptionsMaster::RefreshIcons() { - ASSERT( m_Rows.size() < MAX_OPTION_LINES ); - for( int p=0; pIsHumanPlayer(p) ) @@ -583,9 +581,9 @@ void ScreenOptionsMaster::RefreshIcons() if( m_Rows[i]->Type == Row::ROW_EXIT ) continue; // skip - const OptionRow &row = m_Rows[i]->m_RowDef; + const OptionRowData &row = m_Rows[i]->m_RowDef; - int iSelection = m_iSelectedOption[p][i]; + int iSelection = m_Rows[i]->m_iSelection[p]; if( iSelection >= (int)row.choices.size() ) { /* Invalid selection. Send debug output, to aid debugging. */ diff --git a/stepmania/src/ScreenOptionsMaster.h b/stepmania/src/ScreenOptionsMaster.h index 072abd000e..3f3e7a1d6b 100644 --- a/stepmania/src/ScreenOptionsMaster.h +++ b/stepmania/src/ScreenOptionsMaster.h @@ -39,15 +39,15 @@ private: CString m_NextScreen; vector OptionRowHandlers; - OptionRow *m_OptionRowAlloc; + OptionRowData *m_OptionRowAlloc; - int ExportOption( const OptionRow &row, const OptionRowHandler &hand, int pn, int sel ); - int ImportOption( const OptionRow &row, const OptionRowHandler &hand, int pn, int rowno ); - void SetList( OptionRow &row, OptionRowHandler &hand, CString param, CString &TitleOut ); - void SetStep( OptionRow &row, OptionRowHandler &hand ); - void SetConf( OptionRow &row, OptionRowHandler &hand, CString param, CString &TitleOut ); - void SetCharacter( OptionRow &row, OptionRowHandler &hand ); - void SetSaveToProfile( OptionRow &row, OptionRowHandler &hand ); + int ExportOption( const OptionRowData &row, const OptionRowHandler &hand, int pn, int sel ); + int ImportOption( const OptionRowData &row, const OptionRowHandler &hand, int pn, int rowno ); + void SetList( OptionRowData &row, OptionRowHandler &hand, CString param, CString &TitleOut ); + void SetStep( OptionRowData &row, OptionRowHandler &hand ); + void SetConf( OptionRowData &row, OptionRowHandler &hand, CString param, CString &TitleOut ); + void SetCharacter( OptionRowData &row, OptionRowHandler &hand ); + void SetSaveToProfile( OptionRowData &row, OptionRowHandler &hand ); protected: virtual void ImportOptions(); diff --git a/stepmania/src/ScreenProfileOptions.cpp b/stepmania/src/ScreenProfileOptions.cpp index 587c5d373f..9309c6d155 100644 --- a/stepmania/src/ScreenProfileOptions.cpp +++ b/stepmania/src/ScreenProfileOptions.cpp @@ -33,14 +33,14 @@ enum { NUM_PROFILE_OPTIONS_LINES }; -OptionRow g_ProfileOptionsLines[NUM_PROFILE_OPTIONS_LINES] = { - OptionRow( "Player1\nProfile", true ), - OptionRow( "Player2\nProfile", true ), - OptionRow( "Create\nNew", true, "PRESS START" ), - OptionRow( "Delete", true ), - OptionRow( "Rename", true ), - OptionRow( "OS Mount\nPlayer1", true, "" ), - OptionRow( "OS Mount\nPlayer2", true, "" ), +OptionRowData g_ProfileOptionsLines[NUM_PROFILE_OPTIONS_LINES] = { + OptionRowData( "Player1\nProfile", true ), + OptionRowData( "Player2\nProfile", true ), + OptionRowData( "Create\nNew", true, "PRESS START" ), + OptionRowData( "Delete", true ), + OptionRowData( "Rename", true ), + OptionRowData( "OS Mount\nPlayer1", true, "" ), + OptionRowData( "OS Mount\nPlayer2", true, "" ), }; const ScreenMessage SM_DoneCreating = ScreenMessage(SM_User+1); @@ -97,14 +97,14 @@ void ScreenProfileOptions::ImportOptions() vsProfiles.end(), PREFSMAN->m_sDefaultLocalProfileID[PLAYER_1] ); if( iter != vsProfiles.end() ) - m_iSelectedOption[0][PO_PLAYER1] = iter - vsProfiles.begin() + 1; + m_Rows[PO_PLAYER1]->m_iSelection[0] = iter - vsProfiles.begin() + 1; iter = find( vsProfiles.begin(), vsProfiles.end(), PREFSMAN->m_sDefaultLocalProfileID[PLAYER_2] ); if( iter != vsProfiles.end() ) - m_iSelectedOption[0][PO_PLAYER2] = iter - vsProfiles.begin() + 1; + m_Rows[PO_PLAYER2]->m_iSelection[0] = iter - vsProfiles.begin() + 1; } void ScreenProfileOptions::ExportOptions() @@ -112,13 +112,13 @@ void ScreenProfileOptions::ExportOptions() vector vsProfiles; PROFILEMAN->GetLocalProfileIDs( vsProfiles ); - if( m_iSelectedOption[0][PO_PLAYER1] > 0 ) - PREFSMAN->m_sDefaultLocalProfileID[PLAYER_1] = vsProfiles[m_iSelectedOption[0][PO_PLAYER1]-1]; + if( m_Rows[PO_PLAYER1]->m_iSelection[0] > 0 ) + PREFSMAN->m_sDefaultLocalProfileID[PLAYER_1] = vsProfiles[m_Rows[PO_PLAYER1]->m_iSelection[0]-1]; else PREFSMAN->m_sDefaultLocalProfileID[PLAYER_1] = ""; - if( m_iSelectedOption[0][PO_PLAYER2] > 0 ) - PREFSMAN->m_sDefaultLocalProfileID[PLAYER_2] = vsProfiles[m_iSelectedOption[0][PO_PLAYER2]-1]; + if( m_Rows[PO_PLAYER2]->m_iSelection[0] > 0 ) + PREFSMAN->m_sDefaultLocalProfileID[PLAYER_2] = vsProfiles[m_Rows[PO_PLAYER2]->m_iSelection[0]-1]; else PREFSMAN->m_sDefaultLocalProfileID[PLAYER_2] = ""; } @@ -212,17 +212,17 @@ CString ScreenProfileOptions::GetSelectedProfileID() vector vsProfiles; PROFILEMAN->GetLocalProfileIDs( vsProfiles ); - if( m_iSelectedOption[0][GetCurrentRow()]==0 ) + if( m_Rows[GetCurrentRow()]->m_iSelection[0] ) return ""; else - return vsProfiles[m_iSelectedOption[0][GetCurrentRow()]-1]; + return vsProfiles[ m_Rows[GetCurrentRow()]->m_iSelection[0]-1]; } CString ScreenProfileOptions::GetSelectedProfileName() { - if( m_iSelectedOption[0][GetCurrentRow()]==0 ) + if( m_Rows[GetCurrentRow()]->m_iSelection[0] ) return ""; else - return g_ProfileOptionsLines[PO_PLAYER1].choices[ m_iSelectedOption[0][GetCurrentRow()] ]; + return g_ProfileOptionsLines[PO_PLAYER1].choices[ m_Rows[GetCurrentRow()]->m_iSelection[0] ]; }