Exemplo n.º 1
0
 public void SetPadConfigs(PadConfig[] configs)
 {
     if (GamePads == null)
     {
         return;
     }
     for (int i = 0; i < configs.Length && i < GamePads.Length; i++)
     {
         if (configs[i] != null && GamePads[i] != null)
         {
             GamePads[i].Config = configs[i];
         }
     }
 }
Exemplo n.º 2
0
 public void ApplyGamepadMapping()
 {
     for (PlayerIndex index = PlayerIndex.One; index < (PlayerIndex)SdlGamePad.GetPadCount(); ++index)
     {
         PadConfig config = SdlGamePad.GetConfig(index);
         if (config != null)
         {
             config.Button_A.ID         = this.GamepadMapping[MappedAction.Jump];
             config.Button_B.ID         = this.GamepadMapping[MappedAction.CancelTalk];
             config.Button_X.ID         = this.GamepadMapping[MappedAction.GrabThrow];
             config.Button_Y.ID         = this.GamepadMapping[MappedAction.OpenInventory];
             config.Button_LB.ID        = this.GamepadMapping[MappedAction.MapZoomOut];
             config.Button_RB.ID        = this.GamepadMapping[MappedAction.MapZoomIn];
             config.LeftTrigger.ID      = this.GamepadMapping[MappedAction.RotateLeft];
             config.RightTrigger.ID     = this.GamepadMapping[MappedAction.RotateRight];
             config.Button_Back.ID      = this.GamepadMapping[MappedAction.OpenMap];
             config.Button_Start.ID     = this.GamepadMapping[MappedAction.Pause];
             config.LeftStick.Press.ID  = this.GamepadMapping[MappedAction.FpViewToggle];
             config.RightStick.Press.ID = this.GamepadMapping[MappedAction.ClampLook];
         }
     }
 }