From c53f175d148e2d11558ece2889350d575c673bcc Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 18 Jan 2004 04:45:59 +0000 Subject: [PATCH] clean up input logic, don't be performing music wheel actions if a song was already chosen --- stepmania/src/ScreenSelectMusic.cpp | 47 ++++++++++++++--------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 9d70e1ef5b..fb7104f4c1 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -638,7 +638,7 @@ void ScreenSelectMusic::Input( const DeviceInput& DeviceI, InputEventType type, { // LOG->Trace( "ScreenSelectMusic::Input()" ); - + // debugging? if( DeviceI.device == DEVICE_KEYBOARD && DeviceI.button == SDLK_F9 ) { if( type != IET_FIRST_PRESS ) return; @@ -650,10 +650,30 @@ void ScreenSelectMusic::Input( const DeviceInput& DeviceI, InputEventType type, return; } + if( !GameI.IsValid() ) return; // don't care + + if( m_bMadeChoice && MenuI.IsValid() && MenuI.button == MENU_BUTTON_START && !GAMESTATE->IsExtraStage() && !GAMESTATE->IsExtraStage2() ) + { + if(m_bGoToOptions) return; /* got it already */ + if(!m_bAllowOptionsMenu) return; /* not allowed */ + + if( !m_bAllowOptionsMenuRepeat && + (type == IET_SLOW_REPEAT || type == IET_FAST_REPEAT )) + return; /* not allowed yet */ + + m_bGoToOptions = true; + m_sprOptionsMessage.SetState( 1 ); + SOUND->PlayOnce( THEME->GetPathToS("Common start") ); + return; + } + + if( m_Menu.IsTransitioning() ) + return; // ignore + + if( m_bMadeChoice ) return; // ignore if( MenuI.button == MENU_BUTTON_RIGHT || MenuI.button == MENU_BUTTON_LEFT ) { - if( !GAMESTATE->IsHumanPlayer(MenuI.player) ) return; /* If we're rouletting, hands off. */ if(m_MusicWheel.IsRouletting()) @@ -712,29 +732,6 @@ void ScreenSelectMusic::Input( const DeviceInput& DeviceI, InputEventType type, } } - if( type == IET_RELEASE ) return; // don't care - - if( !GameI.IsValid() ) return; // don't care - - if( m_bMadeChoice && MenuI.IsValid() && MenuI.button == MENU_BUTTON_START && !GAMESTATE->IsExtraStage() && !GAMESTATE->IsExtraStage2() ) - { - if(m_bGoToOptions) return; /* got it already */ - if(!m_bAllowOptionsMenu) return; /* not allowed */ - - if( !m_bAllowOptionsMenuRepeat && - (type == IET_SLOW_REPEAT || type == IET_FAST_REPEAT )) - return; /* not allowed yet */ - - m_bGoToOptions = true; - m_sprOptionsMessage.SetState( 1 ); - SOUND->PlayOnce( THEME->GetPathToS("Common start") ); - return; - } - - if( m_Menu.IsTransitioning() ) return; // ignore - - if( m_bMadeChoice ) - return; PlayerNumber pn = GAMESTATE->GetCurrentStyleDef()->ControllerToPlayerNumber( GameI.controller );