From cb730566913544d468c993fc3df452d14cab27a3 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 26 Aug 2002 03:51:12 +0000 Subject: [PATCH] Since we allow escape to back out of the demonstration, allow BACK to, too. --- stepmania/src/ScreenGameplay.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index d23205935f..4b74542ee5 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -931,7 +931,15 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ if( GAMESTATE->m_bDemonstration ) { - if( MenuI.button==MENU_BUTTON_START && !m_Fade.IsClosing() ) + /* Special case:always allow escape. */ + if( DeviceI.device==DEVICE_KEYBOARD && DeviceI.button==DIK_ESCAPE && !m_Fade.IsClosing() ) + { + this->SendScreenMessage( SM_BeginFadingToTitleMenu, 0 ); + } + /* Since escape backs out, we want to allow any other back buttons to + * work, too, to avoid confusion. */ + else if( (MenuI.button==MENU_BUTTON_START || MenuI.button==MENU_BUTTON_BACK) + && !m_Fade.IsClosing() ) { m_soundMusic.Stop(); SOUND->PlayOnceStreamed( THEME->GetPathTo("Sounds","insert coin") ); @@ -939,10 +947,6 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ this->SendScreenMessage( SM_GoToTitleMenu, 0 ); // m_Fade.CloseWipingRight( SM_GoToTitleMenu ); } - else if( DeviceI.device==DEVICE_KEYBOARD && DeviceI.button==DIK_ESCAPE && !m_Fade.IsClosing() ) - { - this->SendScreenMessage( SM_BeginFadingToTitleMenu, 0 ); - } return; // don't fall through below }