move HandleMessage near HandleScreenMessage
This commit is contained in:
@@ -326,46 +326,6 @@ void ScreenSelectMusic::Update( float fDeltaTime )
|
|||||||
|
|
||||||
CheckBackgroundRequests( false );
|
CheckBackgroundRequests( false );
|
||||||
}
|
}
|
||||||
void ScreenSelectMusic::HandleMessage( const Message &msg )
|
|
||||||
{
|
|
||||||
if( msg == Message_PlayerJoined )
|
|
||||||
{
|
|
||||||
// The current steps may no longer be playable. If one player has double steps
|
|
||||||
// selected, they are no longer playable now that P2 has joined.
|
|
||||||
|
|
||||||
// TODO: Invalidate the CurSteps only if they are no longer playable. That way,
|
|
||||||
// after music change will clamp to the nearest in the DifficultyList.
|
|
||||||
GAMESTATE->m_pCurSteps[GAMESTATE->m_MasterPlayerNumber].SetWithoutBroadcast( NULL );
|
|
||||||
FOREACH_ENUM( PlayerNumber, p )
|
|
||||||
GAMESTATE->m_pCurSteps[p].SetWithoutBroadcast( NULL );
|
|
||||||
|
|
||||||
/* If a course is selected, it may no longer be playable. Let MusicWheel know
|
|
||||||
* about the late join. */
|
|
||||||
m_MusicWheel.PlayerJoined();
|
|
||||||
|
|
||||||
AfterMusicChange();
|
|
||||||
|
|
||||||
int iSel = 0;
|
|
||||||
PlayerNumber pn;
|
|
||||||
bool b = msg.GetParam( "Player", pn );
|
|
||||||
ASSERT( b );
|
|
||||||
|
|
||||||
m_iSelection[pn] = iSel;
|
|
||||||
if( GAMESTATE->IsCourseMode() )
|
|
||||||
{
|
|
||||||
Trail* pTrail = m_vpTrails.empty()? NULL: m_vpTrails[m_iSelection[pn]];
|
|
||||||
GAMESTATE->m_pCurTrail[pn].Set( pTrail );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Steps* pSteps = m_vpSteps.empty()? NULL: m_vpSteps[m_iSelection[pn]];
|
|
||||||
GAMESTATE->m_pCurSteps[pn].Set( pSteps );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ScreenWithMenuElements::HandleMessage( msg );
|
|
||||||
}
|
|
||||||
|
|
||||||
void ScreenSelectMusic::Input( const InputEventPlus &input )
|
void ScreenSelectMusic::Input( const InputEventPlus &input )
|
||||||
{
|
{
|
||||||
// LOG->Trace( "ScreenSelectMusic::Input()" );
|
// LOG->Trace( "ScreenSelectMusic::Input()" );
|
||||||
@@ -713,6 +673,46 @@ void ScreenSelectMusic::ChangeDifficulty( PlayerNumber pn, int dir )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ScreenSelectMusic::HandleMessage( const Message &msg )
|
||||||
|
{
|
||||||
|
if( msg == Message_PlayerJoined )
|
||||||
|
{
|
||||||
|
// The current steps may no longer be playable. If one player has double steps
|
||||||
|
// selected, they are no longer playable now that P2 has joined.
|
||||||
|
|
||||||
|
// TODO: Invalidate the CurSteps only if they are no longer playable. That way,
|
||||||
|
// after music change will clamp to the nearest in the DifficultyList.
|
||||||
|
GAMESTATE->m_pCurSteps[GAMESTATE->m_MasterPlayerNumber].SetWithoutBroadcast( NULL );
|
||||||
|
FOREACH_ENUM( PlayerNumber, p )
|
||||||
|
GAMESTATE->m_pCurSteps[p].SetWithoutBroadcast( NULL );
|
||||||
|
|
||||||
|
/* If a course is selected, it may no longer be playable. Let MusicWheel know
|
||||||
|
* about the late join. */
|
||||||
|
m_MusicWheel.PlayerJoined();
|
||||||
|
|
||||||
|
AfterMusicChange();
|
||||||
|
|
||||||
|
int iSel = 0;
|
||||||
|
PlayerNumber pn;
|
||||||
|
bool b = msg.GetParam( "Player", pn );
|
||||||
|
ASSERT( b );
|
||||||
|
|
||||||
|
m_iSelection[pn] = iSel;
|
||||||
|
if( GAMESTATE->IsCourseMode() )
|
||||||
|
{
|
||||||
|
Trail* pTrail = m_vpTrails.empty()? NULL: m_vpTrails[m_iSelection[pn]];
|
||||||
|
GAMESTATE->m_pCurTrail[pn].Set( pTrail );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Steps* pSteps = m_vpSteps.empty()? NULL: m_vpSteps[m_iSelection[pn]];
|
||||||
|
GAMESTATE->m_pCurSteps[pn].Set( pSteps );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ScreenWithMenuElements::HandleMessage( msg );
|
||||||
|
}
|
||||||
|
|
||||||
void ScreenSelectMusic::HandleScreenMessage( const ScreenMessage SM )
|
void ScreenSelectMusic::HandleScreenMessage( const ScreenMessage SM )
|
||||||
{
|
{
|
||||||
if( SM == SM_AllowOptionsMenuRepeat )
|
if( SM == SM_AllowOptionsMenuRepeat )
|
||||||
|
|||||||
Reference in New Issue
Block a user