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();
|
||||
|
||||
m_TrackingRepeatingInputFromPlayer = PLAYER_INVALID;
|
||||
|
||||
vector<PlayerNumber> vpns;
|
||||
if( SHARED_SELECTION )
|
||||
{
|
||||
@@ -414,10 +416,13 @@ void ScreenSelectMaster::MenuLeft( const InputEventPlus &input )
|
||||
return;
|
||||
if( input.type == IET_RELEASE )
|
||||
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;
|
||||
if( Move(pn, MENU_DIR_LEFT) )
|
||||
{
|
||||
m_TrackingRepeatingInputFromPlayer = pn;
|
||||
m_soundChange.Play();
|
||||
MESSAGEMAN->Broadcast( (Message)(Message_MenuLeftP1+pn) );
|
||||
}
|
||||
@@ -430,10 +435,13 @@ void ScreenSelectMaster::MenuRight( const InputEventPlus &input )
|
||||
return;
|
||||
if( input.type == IET_RELEASE )
|
||||
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;
|
||||
if( Move(pn, MENU_DIR_RIGHT) )
|
||||
{
|
||||
m_TrackingRepeatingInputFromPlayer = pn;
|
||||
m_soundChange.Play();
|
||||
MESSAGEMAN->Broadcast( (Message)(Message_MenuRightP1+pn) );
|
||||
}
|
||||
@@ -446,10 +454,13 @@ void ScreenSelectMaster::MenuUp( const InputEventPlus &input )
|
||||
return;
|
||||
if( input.type == IET_RELEASE )
|
||||
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;
|
||||
if( Move(pn, MENU_DIR_UP) )
|
||||
{
|
||||
m_TrackingRepeatingInputFromPlayer = pn;
|
||||
m_soundChange.Play();
|
||||
MESSAGEMAN->Broadcast( (Message)(Message_MenuUpP1+pn) );
|
||||
}
|
||||
@@ -462,10 +473,13 @@ void ScreenSelectMaster::MenuDown( const InputEventPlus &input )
|
||||
return;
|
||||
if( input.type == IET_RELEASE )
|
||||
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;
|
||||
if( Move(pn, MENU_DIR_DOWN) )
|
||||
{
|
||||
m_TrackingRepeatingInputFromPlayer = pn;
|
||||
m_soundChange.Play();
|
||||
MESSAGEMAN->Broadcast( (Message)(Message_MenuDownP1+pn) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user