diff --git a/stepmania/src/OptionRow.cpp b/stepmania/src/OptionRow.cpp index b182adb536..66675c9216 100644 --- a/stepmania/src/OptionRow.cpp +++ b/stepmania/src/OptionRow.cpp @@ -230,52 +230,16 @@ CString OptionRow::GetRowTitle() const return sTitle; } -void OptionRow::AfterImportOptions() +/* Set up text, underlines and titles for options. This can be called + * as soon as m_RowDef is available. */ +void OptionRow::InitText() { - // 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.m_bOneChoiceForAllPlayers ) - { - PlayerNumber pnCopyFrom = GAMESTATE->m_MasterPlayerNumber; - if( GAMESTATE->m_MasterPlayerNumber == PLAYER_INVALID ) - pnCopyFrom = PLAYER_1; - FOREACH_PlayerNumber( p ) - m_vbSelected[p] = m_vbSelected[pnCopyFrom]; - } - + /* If we have elements already, we're being updated from a new set of options. + * Delete the old ones. */ + m_ItemFrame.DeleteAllChildren(); + m_textItems.clear(); FOREACH_PlayerNumber( p ) - { - switch( m_RowDef.m_selectType ) - { - case SELECT_ONE: - { - /* Make sure the row actually has a selection. */ - bool bHasASelection = false; - for( unsigned i=0; im_MasterPlayerNumber; + if( GAMESTATE->m_MasterPlayerNumber == PLAYER_INVALID ) + pnCopyFrom = PLAYER_1; + FOREACH_PlayerNumber( p ) + m_vbSelected[p] = m_vbSelected[pnCopyFrom]; + } + + FOREACH_PlayerNumber( p ) + { + switch( m_RowDef.m_selectType ) + { + case SELECT_ONE: + { + /* Make sure the row actually has a selection. */ + bool bHasASelection = false; + for( unsigned i=0; i &vpns ); int ExportOptions( const vector &vpns, bool bRowHasFocus[NUM_PLAYERS] ); + void InitText(); void AfterImportOptions(); void DetachHandler(); diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index 81ab3e77aa..daf53d7d1d 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -217,6 +217,7 @@ void ScreenOptions::InitMenu( const vector &vDefs, const ve row.LoadMetrics( m_sName ); row.LoadNormal( def, hand, bFirstRowGoesDown ); + row.InitText(); vector vpns; FOREACH_HumanPlayer( p )