allow control from P2, fix P2 input doesn't work after exiting the screen

This commit is contained in:
Chris Danford
2006-03-28 20:44:27 +00:00
parent f9d50da5e1
commit efbb6cfe52
2 changed files with 20 additions and 5 deletions
+19 -5
View File
@@ -6,6 +6,7 @@
#include "PrefsManager.h"
#include "AdjustSync.h"
#include "ScreenDimensions.h"
#include "InputEventPlus.h"
REGISTER_SCREEN_CLASS( ScreenGameplaySyncMachine );
@@ -53,6 +54,21 @@ void ScreenGameplaySyncMachine::Update( float fDelta )
RefreshText();
}
void ScreenGameplaySyncMachine::Input( const InputEventPlus &input )
{
// Hack to make this work from Player2's controls
InputEventPlus _input = input;
if( _input.GameI.controller != GAME_CONTROLLER_INVALID )
_input.GameI.controller = GAME_CONTROLLER_1;
if( _input.MenuI.player != PLAYER_INVALID )
_input.MenuI.player = PLAYER_1;
if( _input.StyleI.player != PLAYER_INVALID )
_input.StyleI.player = PLAYER_1;
ScreenGameplay::Input( _input );
}
void ScreenGameplaySyncMachine::HandleScreenMessage( const ScreenMessage SM )
{
if( SM == SM_NotesEnded )
@@ -63,12 +79,10 @@ void ScreenGameplaySyncMachine::HandleScreenMessage( const ScreenMessage SM )
ScreenGameplayNormal::HandleScreenMessage( SM );
if( SM == SM_GoToPrevScreen )
{
GAMESTATE->m_pCurSong.Set( NULL );
}
else if( SM == SM_GoToNextScreen )
if( SM == SM_GoToPrevScreen || SM == SM_GoToNextScreen )
{
GAMESTATE->m_PlayMode.Set( PLAY_MODE_INVALID );
GAMESTATE->m_pCurStyle.Set( NULL );
GAMESTATE->m_pCurSong.Set( NULL );
}
}
@@ -11,6 +11,7 @@ public:
virtual void Init();
virtual void Update( float fDelta );
virtual void Input( const InputEventPlus &input );
virtual ScreenType GetScreenType() const { return system_menu; }