fix "holding left and pressing right ignores wheel lock"

This commit is contained in:
Glenn Maynard
2005-09-19 09:01:21 +00:00
parent 5f9c33fd01
commit 142fc408ab
3 changed files with 19 additions and 2 deletions
+2 -2
View File
@@ -809,10 +809,10 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
switch( input.MenuI.button )
{
case MENU_BUTTON_LEFT:
m_MusicWheel.ChangeMusic( -1 );
m_MusicWheel.ChangeMusicUnlessLocked( -1 );
break;
case MENU_BUTTON_RIGHT:
m_MusicWheel.ChangeMusic( +1 );
m_MusicWheel.ChangeMusicUnlessLocked( +1 );
break;
}
}
+16
View File
@@ -495,6 +495,22 @@ void WheelBase::TweenOffScreenUpdateItems(bool changing_sort)
}
}
void WheelBase::ChangeMusicUnlessLocked( int n )
{
if( m_WheelState == STATE_LOCKED )
{
if(n)
{
int iSign = n/abs(n);
m_fLockedWheelVelocity = iSign*LOCKED_INITIAL_VELOCITY;
m_soundLocked.Play();
}
return;
}
ChangeMusic( n );
}
void WheelBase::Move(int n)
{
if(n == m_Moving)
+1
View File
@@ -33,6 +33,7 @@ public:
void TweenOffScreen() { TweenOffScreen(false); }
void Move(int n);
void ChangeMusicUnlessLocked( int n ); /* +1 or -1 */
virtual void ChangeMusic(int dist); /* +1 or -1 */
/* Return true if we're moving fast automatically. */