A problem with removing StyleI.player: an obscure difference
between StyleI.player and MenuI.player is that StyleI is set even if there's no attached MenuButton, and MenuI.player is set even if there's no attached column. That's an odd distinction, anyway. Move input.MenuI.player to input.pn. This also puts it in the same place as input.mp.
This commit is contained in:
@@ -15,6 +15,7 @@ public:
|
||||
InputEventType type;
|
||||
GameInput GameI;
|
||||
MenuInput MenuI;
|
||||
PlayerNumber pn;
|
||||
MultiPlayer mp;
|
||||
DeviceInputList InputList;
|
||||
};
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user