private void OnHotkeyPressed(MenuInputEventArgs args) { try { var player = ObjectManager.LocalPlayer; if (player != null) { var selection = player.Selection.FirstOrDefault( x => x.IsAlive && x is Unit unit && !unit.IsIllusion && unit.IsControllable && unit.HasInventory && unit.Inventory.Items.Any(y => y.Id == AbilityId.item_blink)) as Unit; if (selection != null) { UseBlinkOnMousePosition(selection); return; } } UseBlinkOnMousePosition(context.Owner); } catch (Exception e) { Log.Error(e); } }
private void ExecuteAction(MenuInputEventArgs args) { if (!this.IsAssigningNewHotkey) { this.Action?.Invoke(args); } }
private static void TestPress(MenuInputEventArgs args) { Log.Info($"A hotkey has been pressed: {args.Key} | {args.MouseButton} > {args.Flag}"); // You can test for flags: if ((args.MouseButton & MouseButtons.Left) == MouseButtons.Left) { Log.Info($"The left mouse button was either pressed or released!"); } }
private void FarmHotkeyAction(MenuInputEventArgs agrs) { if (agrs.Flag == HotkeyFlags.Down) { RunAsync(); } else { Cancel(); } }
private void ToggleHotkeyAction(MenuInputEventArgs agrs) { if (SmartArcaneBoltMenu.ToggleHotkeyItem) { RunAsync(); } else { Cancel(); } }
private void WithMuteComboAction(MenuInputEventArgs agrs) { if (agrs.Flag == HotkeyFlags.Down) { WithMuteMenu.ToggleHotkeyItem = true; RunAsync(); } else { WithMuteMenu.ToggleHotkeyItem = false; Cancel(); } }
private void KeyPressed(MenuInputEventArgs obj) { if (obj.Flag == HotkeyFlags.Down) { if (Toggle == false) { Toggle = true; Config._MainComboTask.RunAsync(); } } else { Toggle = false; Config._MainComboTask.Cancel(); } }
private void StealkeyPressed(MenuInputEventArgs obj) { StealkeyDown = obj.Flag == HotkeyFlags.Down; if (StealkeyDown) { if (Togle == false) { Core.Logics.StealLogic._Status = 0; Config._StealTask.RunAsync(); Togle = true; } } else { Togle = false; Config._StealTask.Cancel(); } }
private void CombokeyPressed(MenuInputEventArgs obj) { this.CombokeyDown = obj.Flag == HotkeyFlags.Down; if (this.CombokeyDown) { if (this.Togle) { return; } EULComboLogic._Status = 0; Config._EULComboTask.RunAsync(); this.Togle = true; } else { this.Togle = false; Config._EULComboTask.Cancel(false); } }
private void PlaceKeyPressed(MenuInputEventArgs obj) { LandStackManager.CreateNewStack(); }
private void DetonatekeyPressed(MenuInputEventArgs obj) { this.DetonatekeyDown = obj.Flag == HotkeyFlags.Down; }
private void HoldActive(MenuInputEventArgs obj) { this.IsActiveHold = obj.Flag == HotkeyFlags.Down; }
private void ToggleActive(MenuInputEventArgs obj) { this.IsActive = !this.IsActive; }
private void TogglekeyPressed(MenuInputEventArgs obj) { ToggleEnabled = !ToggleEnabled; }
private void ForkeyPressed(MenuInputEventArgs obj) { ForkeyDown = obj.Flag == HotkeyFlags.Down; }