chugging away at 3.0
This commit is contained in:
@@ -24,13 +24,15 @@ MenuTimer::MenuTimer()
|
||||
|
||||
m_textDigit1.Load( THEME->GetPathTo(FONT_TIMER_NUMBERS) );
|
||||
m_textDigit1.TurnShadowOff();
|
||||
m_textDigit1.SetXY( -20, 0 );
|
||||
m_textDigit1.SetXY( -18, 0 );
|
||||
this->AddActor( &m_textDigit1 );
|
||||
|
||||
m_textDigit2.Load( THEME->GetPathTo(FONT_TIMER_NUMBERS) );
|
||||
m_textDigit2.TurnShadowOff();
|
||||
m_textDigit2.SetXY( +20, 0 );
|
||||
m_textDigit2.SetXY( +18, 0 );
|
||||
this->AddActor( &m_textDigit2 );
|
||||
|
||||
m_soundBeep.Load( THEME->GetPathTo(SOUND_MENU_TIMER) );
|
||||
}
|
||||
|
||||
|
||||
@@ -45,17 +47,24 @@ void MenuTimer::Update( float fDeltaTime )
|
||||
{
|
||||
m_textDigit1.SetEffectGlowing( 10, D3DXCOLOR(1,0,0,0), D3DXCOLOR(1,0,0,1) );
|
||||
m_textDigit2.SetEffectGlowing( 10, D3DXCOLOR(1,0,0,0), D3DXCOLOR(1,0,0,1) );
|
||||
m_soundBeep.Play();
|
||||
}
|
||||
else if( fOldSecondsLeft > 4 && fNewSecondsLeft < 4 ) // transition to below 4
|
||||
m_soundBeep.Play();
|
||||
else if( fOldSecondsLeft > 3 && fNewSecondsLeft < 3 ) // transition to below 3
|
||||
m_soundBeep.Play();
|
||||
else if( fOldSecondsLeft > 2 && fNewSecondsLeft < 2 ) // transition to below 2
|
||||
m_soundBeep.Play();
|
||||
else if( fOldSecondsLeft > 1 && fNewSecondsLeft < 1 ) // transition to below 1
|
||||
m_soundBeep.Play();
|
||||
else if( fOldSecondsLeft > 0 && fNewSecondsLeft < 0 ) // transition to below 0
|
||||
{
|
||||
SCREENMAN->SendMessageToTopScreen( SM_MenuTimer, 0 );
|
||||
}
|
||||
|
||||
m_fSecondsLeft = fNewSecondsLeft;
|
||||
m_fSecondsLeft = max( 0, m_fSecondsLeft );
|
||||
|
||||
m_textDigit1.SetText( ssprintf("%d", ((int)m_fSecondsLeft)/10) );
|
||||
m_textDigit2.SetText( ssprintf("%d", ((int)m_fSecondsLeft)%10) );
|
||||
m_textDigit1.SetText( ssprintf("%d", ((int)m_fSecondsLeft+1)/10) );
|
||||
m_textDigit2.SetText( ssprintf("%d", ((int)m_fSecondsLeft+1)%10) );
|
||||
|
||||
// "flip" the numbers
|
||||
float fRemainder = m_fSecondsLeft - (int)m_fSecondsLeft;
|
||||
|
||||
Reference in New Issue
Block a user