#include "global.h" #include "GameDef.h" #include "RageLog.h" #include "RageUtil.h" #include "IniFile.h" #include "StyleDef.h" #include "RageException.h" #include "GameState.h" #include "InputMapper.h" #include "PrefsManager.h" int GameDef::GetNumGameplayButtons() { int iIndexOfStart = ButtonNameToIndex( "Start" ); ASSERT( iIndexOfStart != GAME_BUTTON_INVALID ); return iIndexOfStart; } GameButton GameDef::ButtonNameToIndex( const CString &sButtonName ) const { for( int i=0; im_CurStyle != STYLE_INVALID ) type = GAMESTATE->GetCurrentStyleDef()->m_StyleType; switch( type ) { case StyleDef::ONE_PLAYER_ONE_CREDIT: case StyleDef::TWO_PLAYERS_TWO_CREDITS: pn = (PlayerNumber)GameI.controller; break; case StyleDef::ONE_PLAYER_TWO_CREDITS: pn = GAMESTATE->m_MasterPlayerNumber; break; default: ASSERT(0); return MenuInput(); // invalid m_StyleType }; int i; for( i=0; im_bOnlyDedicatedMenuButtons ) { for( i=0; im_CurStyle != STYLE_INVALID ) type = GAMESTATE->GetCurrentStyleDef()->m_StyleType; int iNumSidesUsing = 1; switch( type ) { case StyleDef::ONE_PLAYER_ONE_CREDIT: case StyleDef::TWO_PLAYERS_TWO_CREDITS: controller[0] = (GameController)MenuI.player; iNumSidesUsing = 1; break; case StyleDef::ONE_PLAYER_TWO_CREDITS: controller[0] = GAME_CONTROLLER_1; controller[1] = GAME_CONTROLLER_2; iNumSidesUsing = 2; break; default: ASSERT(0); // invalid m_StyleType }; GameButton button[2] = { m_DedicatedMenuButton[MenuI.button], m_SecondaryMenuButton[MenuI.button] }; int iNumButtonsUsing = PREFSMAN->m_bOnlyDedicatedMenuButtons ? 1 : 2; for( int i=0; i