Esempio n. 1
0
        internal GlobalKey(string internalName, string displayName, KeyCode keyCode, KeybindType type, bool enabled)
        {
            this.KeyBindItem = new MenuKeyBind(internalName, displayName, keyCode, type);

            if (enabled)
            {
                this.Activate();
            }
        }
Esempio n. 2
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="MenuKeyBind" /> class.
        /// </summary>
        /// <param name="internalName">The internal name.</param>
        /// <param name="displayName">The display name.</param>
        /// <param name="key">The key.</param>
        /// <param name="keybindType">Type of the keybind.</param>
        /// <param name="active">Whether this item should be active by default</param>
        /// <param name="shared">Whether this item is shared across instances</param>
        public MenuKeyBind(string internalName, string displayName, KeyCode key, KeybindType keybindType, bool active = false, bool shared = false)
        {
            this.InternalName = internalName;
            this.DisplayName  = displayName;
            this.Key          = key;
            this.KeybindType  = keybindType;
            this.Value        = active;

            this.Shared = shared;
        }
Esempio n. 3
0
 internal static void AddKey(string name, string defaultName, KeyCode Keys, KeybindType type, bool enabled = false)
 {
     drawMenu.Add(new MenuKeyBind(name + heroName, defaultName, Keys, type, enabled));
 }
Esempio n. 4
0
        /// <summary>
        /// Returns a MenuComponent to create a List in the Menu object.
        /// </summary>
        public static MenuComponent AddKeyBind(this Menu menu, string internalName, string displayName, KeyCode key, KeybindType keybindType, bool active = false)
        {
            if (menu == null)
            {
                throw new ArgumentNullException("menu");
            }

            return(menu.Add(new MenuKeyBind(internalName, displayName, key, keybindType, active)));
        }
Esempio n. 5
0
 public Keybind(Input input, int index)
 {
     type            = KeybindType.Controller;
     this.input      = input;
     this.inputIndex = index;
 }
Esempio n. 6
0
 public Keybind(Input input)
 {
     type       = KeybindType.Controller;
     this.input = input;
 }
Esempio n. 7
0
 public Keybind(Buttons button, int index)
 {
     type              = KeybindType.ControllerDxInput;
     this.button       = button;
     this.buttonsIndex = index;
 }
Esempio n. 8
0
 public Keybind(Buttons button)
 {
     type        = KeybindType.ControllerDxInput;
     this.button = button;
 }
Esempio n. 9
0
 public Keybind(MouseInput mouseInput)
 {
     type            = KeybindType.Mouse;
     this.mouseInput = mouseInput;
 }
Esempio n. 10
0
 public Keybind(Keys key)
 {
     type     = KeybindType.Keyboard;
     this.key = key;
 }
Esempio n. 11
0
        public static MenuKeyBind Add(this Menu menu, string name, KeyCode key, Action <bool> valueChanged, KeybindType type = KeybindType.Press)
        {
            var component = new MenuKeyBind(menu.InternalName + "." + name, name, key, type);

            menu.Add(component);
            component.OnValueChanged += (sender, args) => valueChanged(args.GetNewValue <MenuKeyBind>().Value);
            valueChanged(component.Value);
            return(component);
        }
Esempio n. 12
0
            internal static void AddKey(string menuName, string name, string defaultName, KeyCode Keys, KeybindType type, bool enabled = false)
            {
                var subMeun = miscMenu["SharpShooter.MiscSettings." + menuName].As <Menu>();

                subMeun.Add(new MenuKeyBind(name + heroName, defaultName, Keys, type, enabled));
            }
Esempio n. 13
0
 public static void SuppressType(this KeybindList list, IModHelper helper, KeybindType type)
 {
     helper.Suppress(list.GetByType(type));
 }
Esempio n. 14
0
 public static Keybind GetByType(this KeybindList list, KeybindType type)
 {
     return(list.Keybinds[(int)type]);
 }
Esempio n. 15
0
 public static bool PressedByType(this KeybindList list, KeybindType type)
 {
     return(list.GetByType(type).IsPressed());
 }