allow locking pause controller

This commit is contained in:
Glenn Maynard
2005-04-21 02:07:02 +00:00
parent e8ca958503
commit b602bb15c4
2 changed files with 10 additions and 4 deletions
+8 -3
View File
@@ -1107,7 +1107,7 @@ float ScreenGameplay::StartPlayingSong(float MinTimeToNotes, float MinTimeToMusi
}
void ScreenGameplay::PauseGame( bool bPause )
void ScreenGameplay::PauseGame( bool bPause, GameController gc )
{
if( m_bPaused == bPause )
{
@@ -1122,6 +1122,8 @@ void ScreenGameplay::PauseGame( bool bPause )
AbortGiveUp( false );
m_bPaused = bPause;
m_PauseController = gc;
m_pSoundMusic->Pause( bPause );
if( bPause )
this->PlayCommand( "Pause" );
@@ -1733,8 +1735,11 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ
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 );
if( MenuI.IsValid() && GAMESTATE->IsHumanPlayer(MenuI.player) && MenuI.button == MENU_BUTTON_START && type == IET_FIRST_PRESS )
{
if( m_PauseController == GAME_CONTROLLER_INVALID || m_PauseController == GameI.controller )
this->PauseGame( false );
}
return;
}
+2 -1
View File
@@ -61,7 +61,7 @@ protected:
void LoadNextSong();
void LoadCourseSongNumber( int SongNumber );
float StartPlayingSong(float MinTimeToNotes, float MinTimeToMusic);
void PauseGame( bool bPause );
void PauseGame( bool bPause, GameController gc = GAME_CONTROLLER_INVALID );
void ShowSavePrompt( ScreenMessage SM_SendWhenDone );
void PlayAnnouncer( CString type, float fSeconds );
void UpdateLights();
@@ -82,6 +82,7 @@ protected:
NUM_DANCING_STATES
} m_DancingState;
bool m_bPaused;
GameController m_PauseController;
vector<Song*> m_apSongsQueue; // size may be >1 if playing a course
vector<Steps*> m_vpStepsQueue[NUM_PLAYERS]; // size may be >1 if playing a course
vector<AttackArray> m_asModifiersQueue[NUM_PLAYERS];// size may be >1 if playing a course