Only accept repeating input from one player at a time. Fixes "wild scrolling" when 2 players are holding opposite directions.
This commit is contained in:
@@ -55,6 +55,8 @@ void ScreenSelectMaster::Init()
|
|||||||
{
|
{
|
||||||
ScreenSelect::Init();
|
ScreenSelect::Init();
|
||||||
|
|
||||||
|
m_TrackingRepeatingInputFromPlayer = PLAYER_INVALID;
|
||||||
|
|
||||||
vector<PlayerNumber> vpns;
|
vector<PlayerNumber> vpns;
|
||||||
if( SHARED_SELECTION )
|
if( SHARED_SELECTION )
|
||||||
{
|
{
|
||||||
@@ -414,10 +416,13 @@ void ScreenSelectMaster::MenuLeft( const InputEventPlus &input )
|
|||||||
return;
|
return;
|
||||||
if( input.type == IET_RELEASE )
|
if( input.type == IET_RELEASE )
|
||||||
return;
|
return;
|
||||||
if( !ALLOW_REPEATING_INPUT && input.type != IET_FIRST_PRESS )
|
if( input.type != IET_FIRST_PRESS && !ALLOW_REPEATING_INPUT )
|
||||||
|
return;
|
||||||
|
if( input.type != IET_FIRST_PRESS && m_TrackingRepeatingInputFromPlayer != pn )
|
||||||
return;
|
return;
|
||||||
if( Move(pn, MENU_DIR_LEFT) )
|
if( Move(pn, MENU_DIR_LEFT) )
|
||||||
{
|
{
|
||||||
|
m_TrackingRepeatingInputFromPlayer = pn;
|
||||||
m_soundChange.Play();
|
m_soundChange.Play();
|
||||||
MESSAGEMAN->Broadcast( (Message)(Message_MenuLeftP1+pn) );
|
MESSAGEMAN->Broadcast( (Message)(Message_MenuLeftP1+pn) );
|
||||||
}
|
}
|
||||||
@@ -430,10 +435,13 @@ void ScreenSelectMaster::MenuRight( const InputEventPlus &input )
|
|||||||
return;
|
return;
|
||||||
if( input.type == IET_RELEASE )
|
if( input.type == IET_RELEASE )
|
||||||
return;
|
return;
|
||||||
if( !ALLOW_REPEATING_INPUT && input.type != IET_FIRST_PRESS )
|
if( input.type != IET_FIRST_PRESS && !ALLOW_REPEATING_INPUT )
|
||||||
|
return;
|
||||||
|
if( input.type != IET_FIRST_PRESS && m_TrackingRepeatingInputFromPlayer != pn )
|
||||||
return;
|
return;
|
||||||
if( Move(pn, MENU_DIR_RIGHT) )
|
if( Move(pn, MENU_DIR_RIGHT) )
|
||||||
{
|
{
|
||||||
|
m_TrackingRepeatingInputFromPlayer = pn;
|
||||||
m_soundChange.Play();
|
m_soundChange.Play();
|
||||||
MESSAGEMAN->Broadcast( (Message)(Message_MenuRightP1+pn) );
|
MESSAGEMAN->Broadcast( (Message)(Message_MenuRightP1+pn) );
|
||||||
}
|
}
|
||||||
@@ -446,10 +454,13 @@ void ScreenSelectMaster::MenuUp( const InputEventPlus &input )
|
|||||||
return;
|
return;
|
||||||
if( input.type == IET_RELEASE )
|
if( input.type == IET_RELEASE )
|
||||||
return;
|
return;
|
||||||
if( !ALLOW_REPEATING_INPUT && input.type != IET_FIRST_PRESS )
|
if( input.type != IET_FIRST_PRESS && !ALLOW_REPEATING_INPUT )
|
||||||
|
return;
|
||||||
|
if( input.type != IET_FIRST_PRESS && m_TrackingRepeatingInputFromPlayer != pn )
|
||||||
return;
|
return;
|
||||||
if( Move(pn, MENU_DIR_UP) )
|
if( Move(pn, MENU_DIR_UP) )
|
||||||
{
|
{
|
||||||
|
m_TrackingRepeatingInputFromPlayer = pn;
|
||||||
m_soundChange.Play();
|
m_soundChange.Play();
|
||||||
MESSAGEMAN->Broadcast( (Message)(Message_MenuUpP1+pn) );
|
MESSAGEMAN->Broadcast( (Message)(Message_MenuUpP1+pn) );
|
||||||
}
|
}
|
||||||
@@ -462,10 +473,13 @@ void ScreenSelectMaster::MenuDown( const InputEventPlus &input )
|
|||||||
return;
|
return;
|
||||||
if( input.type == IET_RELEASE )
|
if( input.type == IET_RELEASE )
|
||||||
return;
|
return;
|
||||||
if( !ALLOW_REPEATING_INPUT && input.type != IET_FIRST_PRESS )
|
if( input.type != IET_FIRST_PRESS && !ALLOW_REPEATING_INPUT )
|
||||||
|
return;
|
||||||
|
if( input.type != IET_FIRST_PRESS && m_TrackingRepeatingInputFromPlayer != pn )
|
||||||
return;
|
return;
|
||||||
if( Move(pn, MENU_DIR_DOWN) )
|
if( Move(pn, MENU_DIR_DOWN) )
|
||||||
{
|
{
|
||||||
|
m_TrackingRepeatingInputFromPlayer = pn;
|
||||||
m_soundChange.Play();
|
m_soundChange.Play();
|
||||||
MESSAGEMAN->Broadcast( (Message)(Message_MenuDownP1+pn) );
|
MESSAGEMAN->Broadcast( (Message)(Message_MenuDownP1+pn) );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ protected:
|
|||||||
bool m_bChosen[NUM_PLAYERS];
|
bool m_bChosen[NUM_PLAYERS];
|
||||||
|
|
||||||
float m_fLockInputSecs;
|
float m_fLockInputSecs;
|
||||||
|
PlayerNumber m_TrackingRepeatingInputFromPlayer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user