diff --git a/stepmania/src/InputMapper.cpp b/stepmania/src/InputMapper.cpp index 81b469b7a8..02a198c679 100644 --- a/stepmania/src/InputMapper.cpp +++ b/stepmania/src/InputMapper.cpp @@ -771,15 +771,8 @@ PlayerNumber InputMapper::ControllerToPlayerNumber( GameController controller ) void InputMapper::GameToMenu( const GameInput &GameI, MenuInput &MenuI ) { - MenuI = MenuInput(); // invalid GameInput - const Game* pGame = GAMESTATE->GetCurrentGame(); - - MenuButton mb = pGame->GameInputToMenuButton( GameI ); - if( mb == MenuButton_INVALID ) - return; - - MenuI.button = mb; + MenuI.button = pGame->GameInputToMenuButton( GameI ); } void InputMapper::MenuToGame( const MenuInput &MenuI, PlayerNumber pn, GameInput GameIout[4] ) diff --git a/stepmania/src/Screen.cpp b/stepmania/src/Screen.cpp index 1071f9bbbb..5da7032138 100644 --- a/stepmania/src/Screen.cpp +++ b/stepmania/src/Screen.cpp @@ -190,7 +190,7 @@ void Screen::Input( const InputEventPlus &input ) } /* Don't make the user hold the back button if they're pressing escape and escape is the back button. */ - if( input.MenuI.button == MENU_BUTTON_BACK && input.DeviceI.device == DEVICE_KEYBOARD && input.DeviceI.button == KEY_ESC ) + if( input.MenuI == MENU_BUTTON_BACK && input.DeviceI.device == DEVICE_KEYBOARD && input.DeviceI.button == KEY_ESC ) { this->MenuBack( input.pn ); return; @@ -247,7 +247,7 @@ bool Screen::JoinInput( const InputEventPlus &input ) if( !GAMESTATE->PlayersCanJoin() ) return false; - if( input.MenuI.IsValid() && input.MenuI.button==MENU_BUTTON_START ) + if( input.MenuI.IsValid() && input.MenuI == MENU_BUTTON_START ) { /* If this side is already in, don't re-join (and re-pay!). */ if(GAMESTATE->m_bSideIsJoined[input.pn]) diff --git a/stepmania/src/ScreenAttract.cpp b/stepmania/src/ScreenAttract.cpp index 20ea9a21df..d3e09e260d 100644 --- a/stepmania/src/ScreenAttract.cpp +++ b/stepmania/src/ScreenAttract.cpp @@ -74,7 +74,7 @@ void ScreenAttract::AttractInput( const InputEventPlus &input, ScreenWithMenuEle LOG->Trace("ScreenAttract::AttractInput: begin fading to START_SCREEN" ); /* HandleGlobalInputs() already played the coin sound. Don't play it again. */ - if( input.MenuI.button != MENU_BUTTON_COIN ) + if( input.MenuI != MENU_BUTTON_COIN ) SCREENMAN->PlayCoinSound(); SOUNDMAN->SetPlayOnlyCriticalSounds( false ); // unmute attract sounds diff --git a/stepmania/src/ScreenNetRoom.cpp b/stepmania/src/ScreenNetRoom.cpp index 33f23b60a9..fb974977c5 100644 --- a/stepmania/src/ScreenNetRoom.cpp +++ b/stepmania/src/ScreenNetRoom.cpp @@ -77,7 +77,7 @@ void ScreenNetRoom::Init() void ScreenNetRoom::Input( const InputEventPlus &input ) { - if (((input.MenuI.button == MENU_BUTTON_LEFT) || (input.MenuI.button == MENU_BUTTON_RIGHT)) && (input.type == IET_RELEASE)) + if ((input.MenuI == MENU_BUTTON_LEFT || input.MenuI == MENU_BUTTON_RIGHT) && input.type == IET_RELEASE) m_RoomWheel.Move(0); ScreenNetSelectBase::Input( input ); diff --git a/stepmania/src/ScreenPlayerOptions.cpp b/stepmania/src/ScreenPlayerOptions.cpp index ffdd664c17..ee31e23fc4 100644 --- a/stepmania/src/ScreenPlayerOptions.cpp +++ b/stepmania/src/ScreenPlayerOptions.cpp @@ -84,7 +84,7 @@ void ScreenPlayerOptions::Input( const InputEventPlus &input ) input.type == IET_FIRST_PRESS && !m_In.IsTransitioning() && input.MenuI.IsValid() && - input.MenuI.button == MENU_BUTTON_START ) + input.MenuI == MENU_BUTTON_START ) { if( m_bAcceptedChoices && !m_bGoToOptions ) { @@ -119,7 +119,7 @@ void ScreenPlayerOptions::Input( const InputEventPlus &input ) ScreenOptionsMaster::Input( input ); // UGLY: Update m_Disqualified whenever Start is pressed - if( GAMESTATE->IsHumanPlayer(pn) && input.MenuI.IsValid() && input.MenuI.button == MENU_BUTTON_START ) + if( GAMESTATE->IsHumanPlayer(pn) && input.MenuI.IsValid() && input.MenuI == MENU_BUTTON_START ) { int row = m_iCurrentRow[pn]; UpdateDisqualified( row, pn ); diff --git a/stepmania/src/ScreenSelect.cpp b/stepmania/src/ScreenSelect.cpp index 4be5b48e0f..1817a8d722 100644 --- a/stepmania/src/ScreenSelect.cpp +++ b/stepmania/src/ScreenSelect.cpp @@ -149,7 +149,7 @@ void ScreenSelect::Input( const InputEventPlus &input ) // user will still be on the title menu. bool bAllowJoinInput = !ALLOW_DISABLED_PLAYER_INPUT; - if( input.MenuI.button == MENU_BUTTON_COIN || + if( input.MenuI == MENU_BUTTON_COIN || (bAllowJoinInput && Screen::JoinInput(input)) ) { if( input.type == IET_FIRST_PRESS ) diff --git a/stepmania/src/ScreenSelectMaster.cpp b/stepmania/src/ScreenSelectMaster.cpp index b483580d5e..f4a7075295 100644 --- a/stepmania/src/ScreenSelectMaster.cpp +++ b/stepmania/src/ScreenSelectMaster.cpp @@ -714,7 +714,7 @@ void ScreenSelectMaster::MenuStart( PlayerNumber pn ) // Allow a player to join even if input is locked or someone has already already chosen. InputEventPlus input; input.pn = pn; - input.MenuI.button = MENU_BUTTON_START; + input.MenuI = MENU_BUTTON_START; Screen::JoinInput( input ); if( m_fLockInputSecs > 0 )