don't process hold note logic while paused

SM_Pause can be sent from elsewhere to pause
START unpauses when paused
don't move on to another screen when paused
This commit is contained in:
Glenn Maynard
2005-03-11 03:54:40 +00:00
parent afe1f892eb
commit f61cce45f5
4 changed files with 31 additions and 2 deletions
+8 -2
View File
@@ -62,6 +62,7 @@ Player::Player()
m_pSecondaryScoreKeeper = NULL;
m_pInventory = NULL;
m_bPaused = false;
m_iOffsetSample = 0;
this->AddChild( &m_Judgment );
@@ -280,6 +281,8 @@ void Player::Update( float fDeltaTime )
if( GAMESTATE->m_pCurSong==NULL )
return;
ActorFrame::Update( fDeltaTime );
if( m_pPlayerState->m_bAttackBeganThisUpdate )
m_soundAttackLaunch.Play();
if( m_pPlayerState->m_bAttackEndedThisUpdate )
@@ -322,6 +325,11 @@ void Player::Update( float fDeltaTime )
m_pNoteField->SetZoom( fNoteFieldZoom );
m_Judgment.SetZoom( fJudgmentZoom );
// If we're paused, don't update tap or hold note logic, so hold notes can be released
// during pause.
if( m_bPaused )
return;
//
// Check for TapNote misses
//
@@ -493,8 +501,6 @@ void Player::Update( float fDeltaTime )
// process transforms that are waiting to be applied
ApplyWaitingTransforms();
ActorFrame::Update( fDeltaTime );
}
void Player::ApplyWaitingTransforms()
+2
View File
@@ -51,6 +51,7 @@ public:
void FadeToFail();
TapNoteScore GetLastTapNoteScore() const { return m_LastTapNoteScore; }
void ApplyWaitingTransforms();
void SetPaused( bool bPaused ) { m_bPaused = bPaused; }
static float GetMaxStepDistanceSeconds();
@@ -75,6 +76,7 @@ protected:
PlayerStageStats* m_pPlayerStageStats;
float m_fNoteFieldHeight;
bool m_bPaused;
float m_fOffset[SAMPLE_COUNT]; // for AutoSync
int m_iOffsetSample;
+20
View File
@@ -1147,6 +1147,9 @@ void ScreenGameplay::PauseGame( bool bPause )
this->PlayCommand( "Pause" );
else
this->PlayCommand( "Unpause" );
FOREACH_EnabledPlayer(p)
m_Player[p].SetPaused( m_bPaused );
}
// play assist ticks
@@ -1320,6 +1323,10 @@ void ScreenGameplay::Update( float fDeltaTime )
if( SCREENMAN->GetTopScreen() != this )
return;
/* Update actors when paused, but never move on to another state. */
if( m_bPaused )
return;
if( GAMESTATE->m_MasterPlayerNumber != PLAYER_INVALID && !m_MaxCombo.GetHidden() )
m_MaxCombo.SetText( ssprintf("%d", STATSMAN->m_CurStageStats.m_player[GAMESTATE->m_MasterPlayerNumber].iMaxCombo) ); /* MAKE THIS WORK FOR BOTH PLAYERS! */
@@ -1732,6 +1739,14 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ
if( type == IET_LEVEL_CHANGED )
return;
if( m_bPaused )
{
/* If we're paused, only accept MENU_BUTTON_START to unpause. */
if( MenuI.IsValid() && MenuI.button == MENU_BUTTON_START && type == IET_FIRST_PRESS )
this->PauseGame( false );
return;
}
if( MenuI.IsValid() &&
m_DancingState != STATE_OUTRO &&
!m_Back.IsTransitioning() )
@@ -2390,6 +2405,11 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
case SM_StopMusic:
m_pSoundMusic->Stop();
break;
case SM_Pause:
if( !m_bPaused )
PauseGame( true );
break;
}
}
+1
View File
@@ -16,6 +16,7 @@ enum ScreenMessage {
SM_GainFocus,
SM_LoseFocus,
SM_StopMusic,
SM_Pause,
SM_User = 100
};