return bChanged

This commit is contained in:
Glenn Maynard
2006-02-03 04:40:49 +00:00
parent b556348e31
commit b74febae7a
2 changed files with 12 additions and 9 deletions
+10 -7
View File
@@ -1118,8 +1118,8 @@ void ScreenOptions::AfterChangeValueInRow( int iRow, PlayerNumber pn )
AfterChangeValueOrRow( pn ); AfterChangeValueOrRow( pn );
} }
/* Up/down */ /* Move up/down. Returns true if we actually moved. */
void ScreenOptions::MoveRowRelative( PlayerNumber pn, int iDir, bool Repeat ) bool ScreenOptions::MoveRowRelative( PlayerNumber pn, int iDir, bool Repeat )
{ {
const int iCurrentRow = m_iCurrentRow[pn]; const int iCurrentRow = m_iCurrentRow[pn];
OptionRow &row = *m_pRows[iCurrentRow]; OptionRow &row = *m_pRows[iCurrentRow];
@@ -1132,7 +1132,7 @@ void ScreenOptions::MoveRowRelative( PlayerNumber pn, int iDir, bool Repeat )
} }
LOG->Trace("move pn %i, dir %i, rep %i", pn, iDir, Repeat); LOG->Trace("move pn %i, dir %i, rep %i", pn, iDir, Repeat);
bool changed = false; bool bChanged = false;
FOREACH_PlayerNumber( p ) FOREACH_PlayerNumber( p )
{ {
if( m_InputMode == INPUTMODE_INDIVIDUAL && p != pn ) if( m_InputMode == INPUTMODE_INDIVIDUAL && p != pn )
@@ -1178,15 +1178,18 @@ void ScreenOptions::MoveRowRelative( PlayerNumber pn, int iDir, bool Repeat )
} }
AfterChangeRow( p ); AfterChangeRow( p );
changed = true; bChanged = true;
} }
if( changed )
if( bChanged )
{ {
if( iDir < 0 ) if( iDir < 0 )
m_SoundPrevRow.Play(); m_SoundPrevRow.Play();
else else
m_SoundNextRow.Play(); m_SoundNextRow.Play();
} }
return bChanged;
} }
void ScreenOptions::AfterChangeRow( PlayerNumber pn ) void ScreenOptions::AfterChangeRow( PlayerNumber pn )
@@ -1194,10 +1197,10 @@ void ScreenOptions::AfterChangeRow( PlayerNumber pn )
AfterChangeValueOrRow( pn ); AfterChangeValueOrRow( pn );
} }
void ScreenOptions::MoveRowAbsolute( PlayerNumber pn, int iRow, bool bRepeat ) bool ScreenOptions::MoveRowAbsolute( PlayerNumber pn, int iRow, bool bRepeat )
{ {
int iDir = iRow - m_iCurrentRow[pn]; int iDir = iRow - m_iCurrentRow[pn];
MoveRowRelative( pn, iDir, bRepeat ); return MoveRowRelative( pn, iDir, bRepeat );
} }
void ScreenOptions::MenuUp( const InputEventPlus &input ) void ScreenOptions::MenuUp( const InputEventPlus &input )
+2 -2
View File
@@ -72,8 +72,8 @@ protected:
void ChangeValueInRowRelative( int iRow, PlayerNumber pn, int iDelta, bool bRepeat ); void ChangeValueInRowRelative( int iRow, PlayerNumber pn, int iDelta, bool bRepeat );
void ChangeValueInRowAbsolute( int iRow, PlayerNumber pn, int iChoiceIndex, bool bRepeat ); void ChangeValueInRowAbsolute( int iRow, PlayerNumber pn, int iChoiceIndex, bool bRepeat );
virtual void AfterChangeValueInRow( int iRow, PlayerNumber pn ); // override this to detect when the value in a row has changed virtual void AfterChangeValueInRow( int iRow, PlayerNumber pn ); // override this to detect when the value in a row has changed
void MoveRowRelative( PlayerNumber pn, int iDir, bool bRepeat ); bool MoveRowRelative( PlayerNumber pn, int iDir, bool bRepeat );
void MoveRowAbsolute( PlayerNumber pn, int iRow, bool bRepeat ); bool MoveRowAbsolute( PlayerNumber pn, int iRow, bool bRepeat );
virtual void AfterChangeRow( PlayerNumber pn ); // override this to detect when the row has changed virtual void AfterChangeRow( PlayerNumber pn ); // override this to detect when the row has changed
virtual void AfterChangeValueOrRow( PlayerNumber pn ); virtual void AfterChangeValueOrRow( PlayerNumber pn );