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:
Chris Danford
2005-10-04 01:40:58 +00:00
parent a1cc399f3f
commit 65cfea1be9
2 changed files with 19 additions and 4 deletions
+18 -4
View File
@@ -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) );
}