merge code

This commit is contained in:
Glenn Maynard
2006-08-17 01:23:25 +00:00
parent deb04eb0ed
commit 808643d39b
+24 -51
View File
@@ -589,47 +589,21 @@ void ScreenSelectMusic::ChangeDifficulty( PlayerNumber pn, int dir )
{ {
case TYPE_SONG: case TYPE_SONG:
case TYPE_PORTAL: case TYPE_PORTAL:
{ m_iSelection[pn] += dir;
m_iSelection[pn] += dir; if( CLAMP(m_iSelection[pn],0,m_vpSteps.size()-1) )
if( CLAMP(m_iSelection[pn],0,m_vpSteps.size()-1) ) return;
return;
// the user explicity switched difficulties. Update the preferred difficulty // the user explicity switched difficulties. Update the preferred difficulty
GAMESTATE->ChangePreferredDifficulty( pn, m_vpSteps[ m_iSelection[pn] ]->GetDifficulty() ); GAMESTATE->ChangePreferredDifficulty( pn, m_vpSteps[ m_iSelection[pn] ]->GetDifficulty() );
vector<PlayerNumber> vpns;
FOREACH_HumanPlayer( p )
{
if( pn == p || GAMESTATE->DifficultiesLocked() )
{
m_iSelection[p] = m_iSelection[pn];
vpns.push_back( p );
}
}
AfterStepsOrTrailChange( vpns );
}
break; break;
case TYPE_COURSE: case TYPE_COURSE:
{ m_iSelection[pn] += dir;
m_iSelection[pn] += dir; if( CLAMP(m_iSelection[pn],0,m_vpTrails.size()-1) )
if( CLAMP(m_iSelection[pn],0,m_vpTrails.size()-1) ) return;
return;
// the user explicity switched difficulties. Update the preferred difficulty // the user explicity switched difficulties. Update the preferred difficulty
GAMESTATE->ChangePreferredCourseDifficulty( pn, m_vpTrails[ m_iSelection[pn] ]->m_CourseDifficulty ); GAMESTATE->ChangePreferredCourseDifficulty( pn, m_vpTrails[ m_iSelection[pn] ]->m_CourseDifficulty );
vector<PlayerNumber> vpns;
FOREACH_HumanPlayer( p )
{
if( pn == p || GAMESTATE->DifficultiesLocked() )
{
m_iSelection[p] = m_iSelection[pn];
vpns.push_back( p );
}
}
AfterStepsOrTrailChange( vpns );
}
break; break;
case TYPE_RANDOM: case TYPE_RANDOM:
@@ -638,22 +612,10 @@ void ScreenSelectMusic::ChangeDifficulty( PlayerNumber pn, int dir )
/* XXX: We could be on a music or course sort, or even one with both; we don't /* XXX: We could be on a music or course sort, or even one with both; we don't
* really know which difficulty to change. Maybe the two difficulties should be * really know which difficulty to change. Maybe the two difficulties should be
* linked ... */ * linked ... */
{ if( !GAMESTATE->ChangePreferredDifficulty( pn, dir ) )
if( !GAMESTATE->ChangePreferredDifficulty( pn, dir ) ) return;
return; break;
vector<PlayerNumber> vpns;
FOREACH_HumanPlayer( p )
{
if( pn == p || GAMESTATE->DifficultiesLocked() )
{
m_iSelection[p] = m_iSelection[pn];
vpns.push_back( p );
}
}
AfterStepsOrTrailChange( vpns );
break;
}
case TYPE_SORT: case TYPE_SORT:
return; return;
default: default:
@@ -661,6 +623,17 @@ void ScreenSelectMusic::ChangeDifficulty( PlayerNumber pn, int dir )
break; break;
} }
vector<PlayerNumber> vpns;
FOREACH_HumanPlayer( p )
{
if( pn == p || GAMESTATE->DifficultiesLocked() )
{
m_iSelection[p] = m_iSelection[pn];
vpns.push_back( p );
}
}
AfterStepsOrTrailChange( vpns );
if( dir < 0 ) if( dir < 0 )
m_soundDifficultyEasier.Play(); m_soundDifficultyEasier.Play();
else else