public List <GameButton> BuildButtonList(BoardPositon boardPositon, JoystickAssignment joystickAssignment) { List <GameButton> gbList = new List <GameButton>(); List <KeyCode> keyCodeList = GetKeyCodeListByJoystickAssignment(joystickAssignment); List <string> buttonNameList = GetButtonNameListByBoardPosition(boardPositon); //Button names must be provided in the exact order they appear on the panel. for (int i = 0; i < buttonNameList.Count; i++) { gbList.Add(new GameButton( keyCodeList[i], buttonNameList[i] )); } return(gbList); }
//private JoystickAssignment AccessiblePositionAJoystickAssignment = JoystickAssignment.Joystick10; //private JoystickAssignment AccessiblePositionBJoystickAssignment = JoystickAssignment.Joystick11; #endregion #region Constructors/Initializers public ButtonMaster(bool bIsBossFight, JoystickMapping joystickMapping, bool bDuplicatedButtons, bool bFullSpread) { _bDuplicatedButtons = bDuplicatedButtons; _bFullSpread = bFullSpread; this.Party1PositonAJoystickAssignment = (JoystickAssignment)joystickMapping.BlueA; this.Party1PositonBJoystickAssignment = (JoystickAssignment)joystickMapping.BlueB; this.Party1PositonCJoystickAssignment = (JoystickAssignment)joystickMapping.BlueC; this.Party1PositonDJoystickAssignment = (JoystickAssignment)joystickMapping.BlueD; this.Party2PositonAJoystickAssignment = (JoystickAssignment)joystickMapping.GreenA; this.Party2PositonBJoystickAssignment = (JoystickAssignment)joystickMapping.GreenB; this.Party2PositonCJoystickAssignment = (JoystickAssignment)joystickMapping.GreenC; this.Party2PositonDJoystickAssignment = (JoystickAssignment)joystickMapping.GreenD; this.AdminPositionJoystickAssignment = (JoystickAssignment)joystickMapping.Admin; this._testMode = joystickMapping.TestMode; this._bFullSpread = joystickMapping.FullSpread; SetupButtons(bIsBossFight); }
//When AutoInputDualActionMode is true then we simulate the Button Letter Key input during the active screen. List <KeyCode> GetKeyCodeListByJoystickAssignment(JoystickAssignment ja) { switch (ja) { case JoystickAssignment.Joystick1: return(new List <KeyCode>() { KeyCode.A, KeyCode.B, KeyCode.C, KeyCode.D, KeyCode.E, KeyCode.F, KeyCode.G, KeyCode.H, KeyCode.I, KeyCode.J, }); case JoystickAssignment.Joystick2: return(new List <KeyCode>() { KeyCode.K, KeyCode.L, KeyCode.M, KeyCode.N, KeyCode.O, KeyCode.P, KeyCode.Q, KeyCode.R, KeyCode.S, KeyCode.T, }); case JoystickAssignment.Joystick3: return(new List <KeyCode>() { KeyCode.U, KeyCode.V, KeyCode.W, KeyCode.X, KeyCode.Y, KeyCode.Z, KeyCode.Comma, KeyCode.Period, KeyCode.Semicolon, KeyCode.Quote, }); case JoystickAssignment.Joystick4: return(new List <KeyCode>() { KeyCode.Alpha1, KeyCode.Alpha2, KeyCode.Alpha3, KeyCode.Alpha4, KeyCode.Alpha5, KeyCode.Alpha6, KeyCode.Alpha7, KeyCode.Alpha8, KeyCode.Alpha9, KeyCode.Alpha0, }); case JoystickAssignment.Joystick5: return(new List <KeyCode>() { KeyCode.Keypad1, KeyCode.Keypad2, KeyCode.Keypad3, KeyCode.Keypad4, KeyCode.Keypad5, KeyCode.Keypad6, KeyCode.Keypad7, KeyCode.Keypad8, KeyCode.Keypad9, KeyCode.Keypad0, }); case JoystickAssignment.Joystick6: return(new List <KeyCode>() { KeyCode.F1, KeyCode.F2, KeyCode.F3, KeyCode.F4, KeyCode.F5, KeyCode.F6, KeyCode.F7, KeyCode.F8, KeyCode.F9, KeyCode.F10, }); case JoystickAssignment.Joystick7: return(new List <KeyCode>() { KeyCode.F11, KeyCode.F12, KeyCode.F13, KeyCode.F14, KeyCode.F15, KeyCode.LeftBracket, KeyCode.RightBracket, KeyCode.KeypadMinus, KeyCode.KeypadPlus, KeyCode.Equals, }); case JoystickAssignment.Joystick8: return(new List <KeyCode>() { KeyCode.Space, KeyCode.PageUp, KeyCode.PageDown, KeyCode.End, KeyCode.Home, KeyCode.KeypadDivide, KeyCode.Backslash, KeyCode.Backspace, KeyCode.Tab, KeyCode.KeypadMultiply, }); case JoystickAssignment.Joystick9: return(new List <KeyCode>() { KeyCode.LeftShift, KeyCode.RightShift, KeyCode.LeftControl, KeyCode.Numlock, KeyCode.LeftAlt, KeyCode.ScrollLock, KeyCode.KeypadPeriod, KeyCode.Insert, KeyCode.Delete, KeyCode.BackQuote, }); default: throw new System.Exception("No joystick that high."); } }