simplify
This commit is contained in:
+2
-16
@@ -27,23 +27,9 @@ GameButton Game::ButtonNameToIndex( const CString &sButtonName ) const
|
|||||||
|
|
||||||
MenuInput Game::GameInputToMenuInput( GameInput GameI ) const
|
MenuInput Game::GameInputToMenuInput( GameInput GameI ) const
|
||||||
{
|
{
|
||||||
PlayerNumber pn;
|
PlayerNumber pn = (PlayerNumber) GameI.controller;
|
||||||
|
|
||||||
StyleType type = TWO_PLAYERS_TWO_SIDES;
|
|
||||||
if( GAMESTATE->GetCurrentStyle() )
|
if( GAMESTATE->GetCurrentStyle() )
|
||||||
type = GAMESTATE->GetCurrentStyle()->m_StyleType;
|
pn = GAMESTATE->GetCurrentStyle()->ControllerToPlayerNumber(GameI.controller);
|
||||||
switch( type )
|
|
||||||
{
|
|
||||||
case ONE_PLAYER_ONE_SIDE:
|
|
||||||
case TWO_PLAYERS_TWO_SIDES:
|
|
||||||
pn = (PlayerNumber)GameI.controller;
|
|
||||||
break;
|
|
||||||
case ONE_PLAYER_TWO_SIDES:
|
|
||||||
pn = GAMESTATE->m_MasterPlayerNumber;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ASSERT(0); return MenuInput(); // invalid m_StyleType
|
|
||||||
};
|
|
||||||
|
|
||||||
FOREACH_MenuButton(i)
|
FOREACH_MenuButton(i)
|
||||||
if( m_DedicatedMenuButton[i] == GameI.button )
|
if( m_DedicatedMenuButton[i] == GameI.button )
|
||||||
|
|||||||
Reference in New Issue
Block a user