broadcast Step message with parameters
This commit is contained in:
@@ -300,8 +300,6 @@ void Player::Init(
|
||||
// TODO: Remove use of PlayerNumber.
|
||||
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
|
||||
|
||||
m_sMessageToSendOnStep = ssprintf("StepP%d",pn+1);
|
||||
|
||||
|
||||
RageSoundLoadParams SoundParams;
|
||||
SoundParams.m_bSupportPan = true;
|
||||
@@ -2051,7 +2049,10 @@ done_checking_hopo:
|
||||
break;
|
||||
}
|
||||
}
|
||||
MESSAGEMAN->Broadcast( m_sMessageToSendOnStep );
|
||||
Message msg( "Step" );
|
||||
msg.SetParam( "PlayerNumber", m_pPlayerState->m_PlayerNumber );
|
||||
msg.SetParam( "MultiPlayer", m_pPlayerState->m_mp );
|
||||
MESSAGEMAN->Broadcast( msg );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -182,8 +182,6 @@ protected:
|
||||
|
||||
vector<RageSound> m_vKeysounds;
|
||||
|
||||
RString m_sMessageToSendOnStep;
|
||||
|
||||
ThemeMetric<float> GRAY_ARROWS_Y_STANDARD;
|
||||
ThemeMetric<float> GRAY_ARROWS_Y_REVERSE;
|
||||
ThemeMetric2D<float> ATTACK_DISPLAY_X;
|
||||
|
||||
@@ -34,9 +34,7 @@ void ScoreDisplayCalories::LoadFromNode( const XNode* pNode )
|
||||
LUA->Release( L );
|
||||
}
|
||||
|
||||
m_sMessageOnStep = ssprintf("StepP%d",m_PlayerNumber+1);
|
||||
|
||||
MESSAGEMAN->Subscribe( this, m_sMessageOnStep );
|
||||
MESSAGEMAN->Subscribe( this, "Step" );
|
||||
}
|
||||
|
||||
void ScoreDisplayCalories::Update( float fDelta )
|
||||
@@ -51,9 +49,12 @@ void ScoreDisplayCalories::Update( float fDelta )
|
||||
|
||||
void ScoreDisplayCalories::HandleMessage( const Message &msg )
|
||||
{
|
||||
if( msg.GetName() == m_sMessageOnStep )
|
||||
if( msg.GetName() == "Step" )
|
||||
{
|
||||
UpdateNumber();
|
||||
PlayerNumber pn;
|
||||
msg.GetParam( "PlayerNumber", pn );
|
||||
if( pn == m_PlayerNumber )
|
||||
UpdateNumber();
|
||||
}
|
||||
|
||||
RollingNumbers::HandleMessage( msg );
|
||||
|
||||
Reference in New Issue
Block a user