static InputAction() { A = new InputAction( new Buttons[] { Buttons.A }, new Keys[] { Keys.Z }, true ); B = new InputAction( new Buttons[] { Buttons.B }, new Keys[] { Keys.V }, true ); X = new InputAction( new Buttons[] { Buttons.X }, new Keys[] { Keys.X }, true ); Y = new InputAction( new Buttons[] { Buttons.Y }, new Keys[] { Keys.C }, true ); LB = new InputAction( new Buttons[] { Buttons.LeftShoulder }, new Keys[] { Keys.J }, true ); RB = new InputAction( new Buttons[] { Buttons.RightShoulder }, new Keys[] { Keys.I }, true ); LT = new InputAction( new Buttons[] { Buttons.LeftTrigger }, new Keys[] { Keys.K }, true ); RT = new InputAction( new Buttons[] { Buttons.RightTrigger }, new Keys[] { Keys.L }, true ); UP = new InputAction( new Buttons[] { Buttons.DPadUp, Buttons.LeftThumbstickUp }, new Keys[] { Keys.Up }, true ); DOWN = new InputAction( new Buttons[] { Buttons.DPadDown, Buttons.LeftThumbstickDown }, new Keys[] { Keys.Down }, true ); LEFT = new InputAction( new Buttons[] { Buttons.DPadLeft, Buttons.LeftThumbstickLeft }, new Keys[] { Keys.Left }, true ); RIGHT = new InputAction( new Buttons[] { Buttons.DPadRight, Buttons.LeftThumbstickRight }, new Keys[] { Keys.Right }, true ); RSUP = new InputAction( new Buttons[] { Buttons.RightThumbstickUp }, new Keys[] { Keys.Up }, true ); RSDOWN = new InputAction( new Buttons[] { Buttons.RightThumbstickDown }, new Keys[] { Keys.Down }, true ); RSLEFT = new InputAction( new Buttons[] { Buttons.RightThumbstickLeft }, new Keys[] { Keys.Left }, true ); RSRIGHT = new InputAction( new Buttons[] { Buttons.RightThumbstickRight }, new Keys[] { Keys.Right }, true ); START = new InputAction( new Buttons[] { Buttons.Start }, new Keys[] { Keys.Enter }, true ); SELECT = new InputAction( new Buttons[] { Buttons.Back }, new Keys[] { Keys.Escape }, true ); RCLICK = new InputAction( new Buttons[] { Buttons.RightStick }, new Keys[] { Keys.OemPeriod }, true ); LCLICK = new InputAction( new Buttons[] { Buttons.LeftStick }, new Keys[] { Keys.NumPad0 }, true ); }
public static Texture2D GetIcon(InputAction action, int i) { if (GamePad.GetState(PlayerIndex.One).IsConnected) { Buttons btn = action.getBtn(i); switch (btn) { case Buttons.A: return content.Load<Texture2D>("ButtonIcons/HUD-Face-A"); case Buttons.B: return content.Load<Texture2D>("ButtonIcons/HUD-Face-B"); case Buttons.X: return content.Load<Texture2D>("ButtonIcons/HUD-Face-X"); case Buttons.Y: return content.Load<Texture2D>("ButtonIcons/HUD-Face-Y"); case Buttons.LeftShoulder: return content.Load<Texture2D>("ButtonIcons/HUD-Shoulder-Left"); case Buttons.RightShoulder: return content.Load<Texture2D>("ButtonIcons/HUD-Shoulder-Right"); case Buttons.LeftTrigger: return content.Load<Texture2D>("ButtonIcons/HUD-Trigger-Left"); case Buttons.RightTrigger: return content.Load<Texture2D>("ButtonIcons/HUD-Trigger-Right"); case Buttons.DPadUp: return content.Load<Texture2D>("ButtonIcons/HUD-DPad-Up"); case Buttons.DPadDown: return content.Load<Texture2D>("ButtonIcons/HUD-DPad-Down"); case Buttons.DPadLeft: return content.Load<Texture2D>("ButtonIcons/HUD-DPad-Left"); case Buttons.DPadRight: return content.Load<Texture2D>("ButtonIcons/HUD-DPad-Right"); case Buttons.Start: return content.Load<Texture2D>("ButtonIcons/HUD-Oval-Start"); case Buttons.Back: return content.Load<Texture2D>("ButtonIcons/HUD-Oval-Back"); default: return content.Load<Texture2D>("ButtonIcons/HUD-Face-A"); } } else { Keys key = action.getKey(i); switch (key) { case Keys.Z: return content.Load<Texture2D>("ButtonIcons/HUD-Key-Z"); case Keys.V: return content.Load<Texture2D>("ButtonIcons/HUD-Key-V"); case Keys.X: return content.Load<Texture2D>("ButtonIcons/HUD-Key-X"); case Keys.C: return content.Load<Texture2D>("ButtonIcons/HUD-Key-C"); case Keys.J: return content.Load<Texture2D>("ButtonIcons/HUD-Key-J"); case Keys.I: return content.Load<Texture2D>("ButtonIcons/HUD-Key-I"); case Keys.K: return content.Load<Texture2D>("ButtonIcons/HUD-Key-K"); case Keys.L: return content.Load<Texture2D>("ButtonIcons/HUD-Key-L"); case Keys.Up: return content.Load<Texture2D>("ButtonIcons/HUD-Key-Up"); case Keys.Down: return content.Load<Texture2D>("ButtonIcons/HUD-Key-Down"); case Keys.Left: return content.Load<Texture2D>("ButtonIcons/HUD-Key-Left"); case Keys.Right: return content.Load<Texture2D>("ButtonIcons/HUD-Key-Right"); case Keys.Enter: return content.Load<Texture2D>("ButtonIcons/HUD-Key-Enter"); case Keys.Escape: return content.Load<Texture2D>("ButtonIcons/HUD-Key-Escape"); default: return content.Load<Texture2D>("ButtonIcons/HUD-Key-Z"); } } }