@ -160,6 +160,20 @@ namespace MWInput
delete mInputManager ;
delete mInputManager ;
}
}
void InputManager : : setPlayerControlsEnabled ( bool enabled )
{
int nPlayerChannels = 15 ;
int playerChannels [ ] = { A_Activate , A_AutoMove , A_AlwaysRun , A_ToggleWeapon ,
A_ToggleSpell , A_Rest , A_QuickKey1 , A_QuickKey2 ,
A_QuickKey3 , A_QuickKey4 , A_QuickKey5 , A_QuickKey6 ,
A_QuickKey7 , A_QuickKey8 , A_QuickKey9 , A_QuickKey10 } ;
for ( int i = 0 ; i < nPlayerChannels ; i + + ) {
int pc = playerChannels [ i ] ;
mInputBinder - > getChannel ( pc ) - > setEnabled ( enabled ) ;
}
}
void InputManager : : channelChanged ( ICS : : Channel * channel , float currentValue , float previousValue )
void InputManager : : channelChanged ( ICS : : Channel * channel , float currentValue , float previousValue )
{
{
if ( mDragDrop )
if ( mDragDrop )
@ -511,7 +525,10 @@ namespace MWInput
OIS : : KeyCode kc = mInputManager - > sdl2OISKeyCode ( arg . keysym . sym ) ;
OIS : : KeyCode kc = mInputManager - > sdl2OISKeyCode ( arg . keysym . sym ) ;
if ( kc ! = OIS : : KC_UNASSIGNED )
if ( kc ! = OIS : : KC_UNASSIGNED )
MyGUI : : InputManager : : getInstance ( ) . injectKeyPress ( MyGUI : : KeyCode : : Enum ( kc ) , 0 ) ;
{
bool guiFocus = MyGUI : : InputManager : : getInstance ( ) . injectKeyPress ( MyGUI : : KeyCode : : Enum ( kc ) , 0 ) ;
setPlayerControlsEnabled ( ! guiFocus ) ;
}
mInputBinder - > keyPressed ( arg ) ;
mInputBinder - > keyPressed ( arg ) ;
}
}