void ScreenPlayerOptions::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ) { if( m_bAskOptionsMessage && type == IET_FIRST_PRESS && !m_In.IsTransitioning() && MenuI.IsValid() && MenuI.button == MENU_BUTTON_START ) { if( m_bAcceptedChoices && !m_bGoToOptions ) { m_bGoToOptions = true; m_sprOptionsMessage.SetState( 1 ); SCREENMAN->PlayStartSound(); } } PlayerNumber pn = StyleI.player; if( GAMESTATE->IsHumanPlayer(StyleI.player) && CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_CANCEL_ALL_PLAYER_OPTIONS) ) { SOUND->PlayOnce( THEME->GetPathToS("ScreenPlayerOptions cancel all") ); // apply the game default mods, but not the Profile saved mods GAMESTATE->m_PlayerOptions[pn].Init(); GAMESTATE->m_PlayerOptions[pn].FromString( PREFSMAN->m_sDefaultModifiers ); UtilCommand( m_sprCancelAll[pn], m_sName, "Show" ); this->ImportOptionsForPlayer( pn ); this->PositionUnderlines(); this->UpdateDisqualified(); } ScreenOptionsMaster::Input( DeviceI, type, GameI, MenuI, StyleI ); // UGLY: Update m_Disqualified whenever Start is pressed if( MenuI.IsValid() && MenuI.button == MENU_BUTTON_START ) UpdateDisqualified(); }
void ScreenEnding::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ) { bool bIsTransitioning = m_In.IsTransitioning() || m_Out.IsTransitioning(); if( MenuI.IsValid() && !bIsTransitioning ) { switch( MenuI.button ) { case MENU_BUTTON_START: SCREENMAN->PostMessageToTopScreen( SM_BeginFadingOut, 0 ); break; } } ScreenAttract::Input( DeviceI, type, GameI, MenuI, StyleI ); }
bool Screen::JoinInput( const MenuInput &MenuI ) { if( !GAMESTATE->PlayersCanJoin() ) return false; if( MenuI.IsValid() && MenuI.button==MENU_BUTTON_START ) { /* If this side is already in, don't re-join (and re-pay!). */ if(GAMESTATE->m_bSideIsJoined[MenuI.player]) return false; /* subtract coins */ int iCoinsNeededToJoin = GAMESTATE->GetCoinsNeededToJoin(); if( GAMESTATE->m_iCoins < iCoinsNeededToJoin ) return false; // not enough coins else GAMESTATE->m_iCoins -= iCoinsNeededToJoin; // HACK: Only play start sound for the 2nd player who joins. The // start sound for the 1st player will be played by ScreenTitleMenu // when the player makes a selection on the screen. if( GAMESTATE->GetNumSidesJoined() > 0 ) SCREENMAN->PlayStartSound(); GAMESTATE->JoinPlayer( MenuI.player ); // don't load memory card profiles here. It's slow and can cause a big skip. /* Don't load the local profile, either. It causes a 150+ms skip on my A64 3000+, * so it probably causes a skip for everyone. We probably shouldn't load this here, * anyway: leave it unloaded and display "INSERT CARD" until the normal time, and * load the local profile at the time we would have loaded the memory card if none * was inserted (via LoadFirstAvailableProfile). */ // PROFILEMAN->LoadLocalProfileFromMachine( MenuI.player ); SCREENMAN->RefreshCreditsMessages(); return true; } return false; }
void Screen::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ) { /* Don't send release messages with the default handler. */ switch( type ) { case IET_FIRST_PRESS: case IET_SLOW_REPEAT: case IET_FAST_REPEAT: break; /* OK */ default: return; // don't care } /* Don't make the user hold the back button if they're pressing escape and escape is the back button. */ if( MenuI.button == MENU_BUTTON_BACK && DeviceI.device == DEVICE_KEYBOARD && DeviceI.button == KEY_ESC ) { this->MenuBack( MenuI.player ); return; } // default input handler used by most menus if( !MenuI.IsValid() ) return; switch( MenuI.button ) { case MENU_BUTTON_UP: this->MenuUp( MenuI.player, type ); return; case MENU_BUTTON_DOWN: this->MenuDown( MenuI.player, type ); return; case MENU_BUTTON_LEFT: this->MenuLeft( MenuI.player, type ); return; case MENU_BUTTON_RIGHT: this->MenuRight( MenuI.player, type ); return; case MENU_BUTTON_BACK: this->MenuBack( MenuI.player, type ); return; case MENU_BUTTON_START: this->MenuStart( MenuI.player, type ); return; case MENU_BUTTON_SELECT:this->MenuSelect( MenuI.player, type ); return; case MENU_BUTTON_COIN: this->MenuCoin( MenuI.player, type ); return; } }