simplify
This commit is contained in:
@@ -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] )
|
||||
|
||||
@@ -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])
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user