diff --git a/stepmania/src/InputEventPlus.h b/stepmania/src/InputEventPlus.h index b33c3949d0..8c2d89ad9b 100644 --- a/stepmania/src/InputEventPlus.h +++ b/stepmania/src/InputEventPlus.h @@ -15,6 +15,7 @@ public: InputEventType type; GameInput GameI; MenuInput MenuI; + PlayerNumber pn; MultiPlayer mp; DeviceInputList InputList; }; diff --git a/stepmania/src/InputMapper.cpp b/stepmania/src/InputMapper.cpp index 447f740f3b..46b1cd9e66 100644 --- a/stepmania/src/InputMapper.cpp +++ b/stepmania/src/InputMapper.cpp @@ -761,6 +761,14 @@ bool InputMapper::GameToDevice( const GameInput &GameI, int iSlotNum, DeviceInpu return DeviceI.device != DEVICE_NONE; } +PlayerNumber InputMapper::ControllerToPlayerNumber( GameController controller ) +{ + if( GAMESTATE->GetCurrentStyle() ) + return GAMESTATE->GetCurrentStyle()->ControllerToPlayerNumber(controller); + else + return (PlayerNumber) controller; +} + void InputMapper::GameToMenu( const GameInput &GameI, MenuInput &MenuI ) { const Game* pGame = GAMESTATE->GetCurrentGame(); diff --git a/stepmania/src/InputMapper.h b/stepmania/src/InputMapper.h index d7b0bd8b3d..fe4275707e 100644 --- a/stepmania/src/InputMapper.h +++ b/stepmania/src/InputMapper.h @@ -38,6 +38,7 @@ public: void GameToMenu( const GameInput &GameI, MenuInput &MenuI ); void MenuToGame( const MenuInput &MenuI, GameInput GameIout[4] ); + PlayerNumber ControllerToPlayerNumber( GameController controller ); float GetSecsHeld( const GameInput &GameI, MultiPlayer mp = MultiPlayer_INVALID ); float GetSecsHeld( const MenuInput &MenuI ); diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 00e1def6ed..2c9ef25510 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -1433,7 +1433,10 @@ void HandleInputEvents(float fDeltaTime) } if( input.GameI.IsValid() ) + { INPUTMAPPER->GameToMenu( input.GameI, input.MenuI ); + input.pn = INPUTMAPPER->ControllerToPlayerNumber( input.GameI.controller ); + } if( HandleGlobalInputs(input) ) continue; // skip