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