diff --git a/stepmania/src/Screen.cpp b/stepmania/src/Screen.cpp index ea6ede4e0a..973d0bb328 100644 --- a/stepmania/src/Screen.cpp +++ b/stepmania/src/Screen.cpp @@ -153,22 +153,6 @@ void Screen::Update( float fDeltaTime ) } } -void Screen::MenuUp( const InputEventPlus &input ) { if(input.type==IET_FIRST_PRESS) MenuUp(input.pn); } -void Screen::MenuDown( const InputEventPlus &input ) { if(input.type==IET_FIRST_PRESS) MenuDown(input.pn); } -void Screen::MenuLeft( const InputEventPlus &input ) { if(input.type==IET_FIRST_PRESS) MenuLeft(input.pn); } -void Screen::MenuRight( const InputEventPlus &input ) { if(input.type==IET_FIRST_PRESS) MenuRight(input.pn); } -void Screen::MenuStart( const InputEventPlus &input ) { if(input.type==IET_FIRST_PRESS) MenuStart(input.pn); } -void Screen::MenuSelect( const InputEventPlus &input ) { if(input.type==IET_FIRST_PRESS) MenuSelect(input.pn); } - -void Screen::MenuBack( const InputEventPlus &input ) -{ - /* Don't make the user hold the back button if they're pressing escape and escape is the back button. */ - if( !PREFSMAN->m_bDelayedBack || input.type==IET_REPEAT || (input.DeviceI.device == DEVICE_KEYBOARD && input.DeviceI.button == KEY_ESC) ) - MenuBack( input.pn ); -} - -void Screen::MenuCoin( const InputEventPlus &input ) { if(input.type==IET_FIRST_PRESS) MenuCoin(input.pn); } - /* ScreenManager sends input here first. Overlay screens can use it to get a first * pass at input. Return true if the input was handled and should not be passed * to lower screens, or false if not handled. If true is returned, Input() will @@ -197,7 +181,11 @@ void Screen::Input( const InputEventPlus &input ) case MENU_BUTTON_DOWN: this->MenuDown ( input ); return; case MENU_BUTTON_LEFT: this->MenuLeft ( input ); return; case MENU_BUTTON_RIGHT: this->MenuRight ( input ); return; - case MENU_BUTTON_BACK: this->MenuBack ( input ); return; + case MENU_BUTTON_BACK: + /* Don't make the user hold the back button if they're pressing escape and escape is the back button. */ + if( !PREFSMAN->m_bDelayedBack || input.type==IET_REPEAT || (input.DeviceI.device == DEVICE_KEYBOARD && input.DeviceI.button == KEY_ESC) ) + this->MenuBack( input ); + return; case MENU_BUTTON_START: this->MenuStart ( input ); return; case MENU_BUTTON_SELECT:this->MenuSelect( input ); return; case MENU_BUTTON_COIN: this->MenuCoin ( input ); return; @@ -209,7 +197,11 @@ void Screen::HandleScreenMessage( const ScreenMessage SM ) if( SM == SM_MenuTimer ) { FOREACH_HumanPlayer(p) - MenuStart( p ); + { + InputEventPlus iep; + iep.pn = p; + MenuStart( iep ); + } } else if( SM == SM_GoToNextScreen || SM == SM_GoToPrevScreen ) { @@ -270,12 +262,6 @@ bool Screen::JoinInput( PlayerNumber pn ) return true; } - -void Screen::MenuCoin( PlayerNumber pn ) -{ - // This is now handled globally by Stepmania.cpp -- Miryokuteki -} - void Screen::PostScreenMessage( const ScreenMessage SM, float fDelay ) { ASSERT( fDelay >= 0.0 ); diff --git a/stepmania/src/Screen.h b/stepmania/src/Screen.h index c3c1898726..e1f5938334 100644 --- a/stepmania/src/Screen.h +++ b/stepmania/src/Screen.h @@ -89,23 +89,14 @@ public: RString GetPrevScreen() const; // let subclass override if they want - virtual void MenuUp( const InputEventPlus &input ); - virtual void MenuDown( const InputEventPlus &input ); - virtual void MenuLeft( const InputEventPlus &input ); - virtual void MenuRight( const InputEventPlus &input ); - virtual void MenuStart( const InputEventPlus &input ); - virtual void MenuSelect( const InputEventPlus &input ); - virtual void MenuBack( const InputEventPlus &input ); - virtual void MenuCoin( const InputEventPlus &input ); - - virtual void MenuUp( PlayerNumber pn ) {} - virtual void MenuDown( PlayerNumber pn ) {} - virtual void MenuLeft( PlayerNumber pn ) {} - virtual void MenuRight( PlayerNumber pn ) {} - virtual void MenuStart( PlayerNumber pn ) {} - virtual void MenuSelect( PlayerNumber pn ) {} - virtual void MenuBack( PlayerNumber pn ) {} - virtual void MenuCoin( PlayerNumber pn ); + virtual void MenuUp( const InputEventPlus &input ) { } + virtual void MenuDown( const InputEventPlus &input ) { } + virtual void MenuLeft( const InputEventPlus &input ) { } + virtual void MenuRight( const InputEventPlus &input ) { } + virtual void MenuStart( const InputEventPlus &input ) { } + virtual void MenuSelect( const InputEventPlus &input ) { } + virtual void MenuBack( const InputEventPlus &input ) { } + virtual void MenuCoin( const InputEventPlus &input ) { } }; #endif