internal GlobalKey(string internalName, string displayName, KeyCode keyCode, KeybindType type, bool enabled) { this.KeyBindItem = new MenuKeyBind(internalName, displayName, keyCode, type); if (enabled) { this.Activate(); } }
/// <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; }
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)); }
/// <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))); }
public Keybind(Input input, int index) { type = KeybindType.Controller; this.input = input; this.inputIndex = index; }
public Keybind(Input input) { type = KeybindType.Controller; this.input = input; }
public Keybind(Buttons button, int index) { type = KeybindType.ControllerDxInput; this.button = button; this.buttonsIndex = index; }
public Keybind(Buttons button) { type = KeybindType.ControllerDxInput; this.button = button; }
public Keybind(MouseInput mouseInput) { type = KeybindType.Mouse; this.mouseInput = mouseInput; }
public Keybind(Keys key) { type = KeybindType.Keyboard; this.key = key; }
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); }
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)); }
public static void SuppressType(this KeybindList list, IModHelper helper, KeybindType type) { helper.Suppress(list.GetByType(type)); }
public static Keybind GetByType(this KeybindList list, KeybindType type) { return(list.Keybinds[(int)type]); }
public static bool PressedByType(this KeybindList list, KeybindType type) { return(list.GetByType(type).IsPressed()); }