From e4c6fbafffacb9a7e4fb37b9999e584fa990d4d6 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 3 Feb 2006 06:07:57 +0000 Subject: [PATCH] fixup --- stepmania/src/ScreenOptions.cpp | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index 712379f6c1..b19a5ab589 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -1184,29 +1184,32 @@ void ScreenOptions::AfterChangeRow( PlayerNumber pn ) // // In FIVE_KEY, keep the selection in the row near the focus. // - OptionRow &row = *m_pRows[r]; - switch( m_OptionsNavigation ) + const int iRow = m_iCurrentRow[pn]; + if( iRow != -1 ) { - case NAV_TOGGLE_FIVE_KEY: - if( row.GetRowDef().m_layoutType != LAYOUT_SHOW_ONE_IN_ROW ) + OptionRow &row = *m_pRows[iRow]; + switch( m_OptionsNavigation ) { - int iSelectionDist = -1; - for( unsigned i = 0; i < row.GetTextItemsSize(); ++i ) + case NAV_TOGGLE_FIVE_KEY: + if( row.GetRowDef().m_layoutType != LAYOUT_SHOW_ONE_IN_ROW ) { - int iWidth, iX, iY; - GetWidthXY( pn, m_iCurrentRow[pn], i, iWidth, iX, iY ); - const int iDist = abs( iX-m_iFocusX[pn] ); - if( iSelectionDist == -1 || iDist < iSelectionDist ) + int iSelectionDist = -1; + for( unsigned i = 0; i < row.GetTextItemsSize(); ++i ) { - iSelectionDist = iDist; - row.SetChoiceInRowWithFocus( pn, i ); + int iWidth, iX, iY; + GetWidthXY( pn, m_iCurrentRow[pn], i, iWidth, iX, iY ); + const int iDist = abs( iX-m_iFocusX[pn] ); + if( iSelectionDist == -1 || iDist < iSelectionDist ) + { + iSelectionDist = iDist; + row.SetChoiceInRowWithFocus( pn, i ); + } } } + break; } - break; } - AfterChangeValueOrRow( pn ); }