Exemple #1
0
        /// <summary>
        /// Return the color of a device
        /// </summary>
        /// <param name="devInput">The devinput (determine JS colors)</param>
        /// <param name="aDevice">The ActionDevice</param>
        /// <returns>The device color</returns>
        static public System.Drawing.Color DeviceColor(string devInput)
        {
            // background is along the input
            ActionDevice aDevice = ADeviceFromInput(devInput);

            switch (aDevice)
            {
            case ActionDevice.AD_Gamepad: return(GamepadCls.XiColor( ));

            case ActionDevice.AD_Joystick: return(JoystickCls.JsNColor(JoystickCls.JSNum(devInput)));// need to know which JS

            case ActionDevice.AD_Keyboard: return(KeyboardCls.KbdColor( ));

            case ActionDevice.AD_Mouse: return(MouseCls.MouseColor( ));

            default: return(MyColors.UnassignedColor);
            }
        }
Exemple #2
0
        /// <summary>
        /// Copy return the action while reassigning the JsN Tag
        /// </summary>
        /// <param name="newJsList">The JsN reassign list</param>
        /// <returns>The action copy with reassigned input</returns>
        public ActionCommandCls ReassignJsN(JsReassingList newJsList)
        {
            ActionCommandCls newAc = (ActionCommandCls)this.Clone();

            // reassign the jsX part for Joystick commands
            if (this.DevID.StartsWith("js"))
            {
                int oldJsN = JoystickCls.JSNum(this.DevID);
                if (JoystickCls.IsJSValid(oldJsN))
                {
                    if (newJsList.ContainsOldJs(oldJsN))
                    {
                        newAc.DevID = JoystickCls.ReassignJSTag(this.DevID, newJsList.newJsFromOldJs(oldJsN));
                    }
                }
            }

            return(newAc);
        }