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:
@@ -62,6 +62,7 @@ Player::Player()
|
|||||||
m_pSecondaryScoreKeeper = NULL;
|
m_pSecondaryScoreKeeper = NULL;
|
||||||
m_pInventory = NULL;
|
m_pInventory = NULL;
|
||||||
|
|
||||||
|
m_bPaused = false;
|
||||||
m_iOffsetSample = 0;
|
m_iOffsetSample = 0;
|
||||||
|
|
||||||
this->AddChild( &m_Judgment );
|
this->AddChild( &m_Judgment );
|
||||||
@@ -280,6 +281,8 @@ void Player::Update( float fDeltaTime )
|
|||||||
if( GAMESTATE->m_pCurSong==NULL )
|
if( GAMESTATE->m_pCurSong==NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
ActorFrame::Update( fDeltaTime );
|
||||||
|
|
||||||
if( m_pPlayerState->m_bAttackBeganThisUpdate )
|
if( m_pPlayerState->m_bAttackBeganThisUpdate )
|
||||||
m_soundAttackLaunch.Play();
|
m_soundAttackLaunch.Play();
|
||||||
if( m_pPlayerState->m_bAttackEndedThisUpdate )
|
if( m_pPlayerState->m_bAttackEndedThisUpdate )
|
||||||
@@ -322,6 +325,11 @@ void Player::Update( float fDeltaTime )
|
|||||||
m_pNoteField->SetZoom( fNoteFieldZoom );
|
m_pNoteField->SetZoom( fNoteFieldZoom );
|
||||||
m_Judgment.SetZoom( fJudgmentZoom );
|
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
|
// Check for TapNote misses
|
||||||
//
|
//
|
||||||
@@ -493,8 +501,6 @@ void Player::Update( float fDeltaTime )
|
|||||||
|
|
||||||
// process transforms that are waiting to be applied
|
// process transforms that are waiting to be applied
|
||||||
ApplyWaitingTransforms();
|
ApplyWaitingTransforms();
|
||||||
|
|
||||||
ActorFrame::Update( fDeltaTime );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::ApplyWaitingTransforms()
|
void Player::ApplyWaitingTransforms()
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ public:
|
|||||||
void FadeToFail();
|
void FadeToFail();
|
||||||
TapNoteScore GetLastTapNoteScore() const { return m_LastTapNoteScore; }
|
TapNoteScore GetLastTapNoteScore() const { return m_LastTapNoteScore; }
|
||||||
void ApplyWaitingTransforms();
|
void ApplyWaitingTransforms();
|
||||||
|
void SetPaused( bool bPaused ) { m_bPaused = bPaused; }
|
||||||
|
|
||||||
static float GetMaxStepDistanceSeconds();
|
static float GetMaxStepDistanceSeconds();
|
||||||
|
|
||||||
@@ -75,6 +76,7 @@ protected:
|
|||||||
PlayerStageStats* m_pPlayerStageStats;
|
PlayerStageStats* m_pPlayerStageStats;
|
||||||
float m_fNoteFieldHeight;
|
float m_fNoteFieldHeight;
|
||||||
|
|
||||||
|
bool m_bPaused;
|
||||||
float m_fOffset[SAMPLE_COUNT]; // for AutoSync
|
float m_fOffset[SAMPLE_COUNT]; // for AutoSync
|
||||||
int m_iOffsetSample;
|
int m_iOffsetSample;
|
||||||
|
|
||||||
|
|||||||
@@ -1147,6 +1147,9 @@ void ScreenGameplay::PauseGame( bool bPause )
|
|||||||
this->PlayCommand( "Pause" );
|
this->PlayCommand( "Pause" );
|
||||||
else
|
else
|
||||||
this->PlayCommand( "Unpause" );
|
this->PlayCommand( "Unpause" );
|
||||||
|
|
||||||
|
FOREACH_EnabledPlayer(p)
|
||||||
|
m_Player[p].SetPaused( m_bPaused );
|
||||||
}
|
}
|
||||||
|
|
||||||
// play assist ticks
|
// play assist ticks
|
||||||
@@ -1320,6 +1323,10 @@ void ScreenGameplay::Update( float fDeltaTime )
|
|||||||
if( SCREENMAN->GetTopScreen() != this )
|
if( SCREENMAN->GetTopScreen() != this )
|
||||||
return;
|
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() )
|
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! */
|
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 )
|
if( type == IET_LEVEL_CHANGED )
|
||||||
return;
|
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() &&
|
if( MenuI.IsValid() &&
|
||||||
m_DancingState != STATE_OUTRO &&
|
m_DancingState != STATE_OUTRO &&
|
||||||
!m_Back.IsTransitioning() )
|
!m_Back.IsTransitioning() )
|
||||||
@@ -2390,6 +2405,11 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
case SM_StopMusic:
|
case SM_StopMusic:
|
||||||
m_pSoundMusic->Stop();
|
m_pSoundMusic->Stop();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SM_Pause:
|
||||||
|
if( !m_bPaused )
|
||||||
|
PauseGame( true );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ enum ScreenMessage {
|
|||||||
SM_GainFocus,
|
SM_GainFocus,
|
||||||
SM_LoseFocus,
|
SM_LoseFocus,
|
||||||
SM_StopMusic,
|
SM_StopMusic,
|
||||||
|
SM_Pause,
|
||||||
SM_User = 100
|
SM_User = 100
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user