cleanup
This commit is contained in:
@@ -85,6 +85,7 @@ static const int NUM_SHOWN_RADAR_CATEGORIES = 5;
|
|||||||
|
|
||||||
AutoScreenMessage( SM_PlayCheer )
|
AutoScreenMessage( SM_PlayCheer )
|
||||||
AutoScreenMessage( SM_AddBonus )
|
AutoScreenMessage( SM_AddBonus )
|
||||||
|
AutoScreenMessage( SM_PlayPassSound )
|
||||||
|
|
||||||
|
|
||||||
REGISTER_SCREEN_CLASS( ScreenEvaluation );
|
REGISTER_SCREEN_CLASS( ScreenEvaluation );
|
||||||
@@ -282,12 +283,12 @@ void ScreenEvaluation::Init()
|
|||||||
m_SoundSequences.push_back(temp);
|
m_SoundSequences.push_back(temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_bPassFailTriggered = false; // the sound hasn't been triggered yet
|
|
||||||
if( m_bFailed )
|
if( m_bFailed )
|
||||||
m_sndPassFail.Load( THEME->GetPathS(m_sName, "failed") );
|
m_sndPassFail.Load( THEME->GetPathS(m_sName, "failed") );
|
||||||
else
|
else
|
||||||
m_sndPassFail.Load( THEME->GetPathS(m_sName, "passed") );
|
m_sndPassFail.Load( THEME->GetPathS(m_sName, "passed") );
|
||||||
m_sndPassFail.Play();
|
this->PostScreenMessage( SM_PlayPassSound, 0 );
|
||||||
|
this->PostScreenMessage( SM_PlayPassSound, m_bFailed? FAILED_SOUND_TIME:PASSED_SOUND_TIME );
|
||||||
|
|
||||||
//
|
//
|
||||||
// load other sounds
|
// load other sounds
|
||||||
@@ -1254,17 +1255,6 @@ void ScreenEvaluation::Update( float fDeltaTime )
|
|||||||
{
|
{
|
||||||
ScreenWithMenuElements::Update( fDeltaTime );
|
ScreenWithMenuElements::Update( fDeltaTime );
|
||||||
|
|
||||||
if( !m_bPassFailTriggered )
|
|
||||||
{
|
|
||||||
float fTime = m_bFailed? FAILED_SOUND_TIME:PASSED_SOUND_TIME;
|
|
||||||
if( m_timerSoundSequences.Ago() > fTime )
|
|
||||||
{
|
|
||||||
if( !m_sndPassFail.IsPlaying() )
|
|
||||||
m_sndPassFail.Play();
|
|
||||||
m_bPassFailTriggered = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for( unsigned snd=0; snd<m_SoundSequences.size(); snd++ )
|
for( unsigned snd=0; snd<m_SoundSequences.size(); snd++ )
|
||||||
{
|
{
|
||||||
if(m_SoundSequences[snd].fTime != -1) // already played? skip...
|
if(m_SoundSequences[snd].fTime != -1) // already played? skip...
|
||||||
@@ -1338,6 +1328,10 @@ void ScreenEvaluation::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
{
|
{
|
||||||
EndScreen();
|
EndScreen();
|
||||||
}
|
}
|
||||||
|
else if( SM == SM_PlayPassSound )
|
||||||
|
{
|
||||||
|
m_sndPassFail.Play();
|
||||||
|
}
|
||||||
else if( SM == SM_GoToNextScreen )
|
else if( SM == SM_GoToNextScreen )
|
||||||
{
|
{
|
||||||
if( GAMESTATE->IsEventMode() )
|
if( GAMESTATE->IsEventMode() )
|
||||||
|
|||||||
@@ -132,7 +132,6 @@ protected:
|
|||||||
|
|
||||||
// sound effects for other gametypes
|
// sound effects for other gametypes
|
||||||
RageSound m_sndPassFail; // sound played if the player passes or fails
|
RageSound m_sndPassFail; // sound played if the player passes or fails
|
||||||
bool m_bPassFailTriggered; // has the pass / fail sound been played yet?
|
|
||||||
RageTimer m_timerSoundSequences; // timer used for triggering sounds.
|
RageTimer m_timerSoundSequences; // timer used for triggering sounds.
|
||||||
vector<EvalSoundSequence> m_SoundSequences; // a sequence of sounds to be played (although they're stored in no particular order!)
|
vector<EvalSoundSequence> m_SoundSequences; // a sequence of sounds to be played (although they're stored in no particular order!)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user