From 63b0df5ba2e652bfebb8c29e02db0fe307b83de0 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Mon, 11 May 2020 11:19:41 +0200 Subject: [PATCH] Fix ItemSlotButton and HandsGui handling all input. Fixes #904 --- Content.Client/UserInterface/HandsGui.cs | 8 ++++++-- Content.Client/UserInterface/ItemSlotManager.cs | 3 +-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Content.Client/UserInterface/HandsGui.cs b/Content.Client/UserInterface/HandsGui.cs index eae011f008..88915e620e 100644 --- a/Content.Client/UserInterface/HandsGui.cs +++ b/Content.Client/UserInterface/HandsGui.cs @@ -119,14 +119,13 @@ namespace Content.Client.UserInterface private void HandKeyBindDown(GUIBoundKeyEventArgs args, string handIndex) { - args.Handle(); - if (!TryGetHands(out var hands)) return; if (args.Function == ContentKeyFunctions.MouseMiddle) { hands.SendChangeHand(handIndex); + args.Handle(); return; } @@ -136,12 +135,16 @@ namespace Content.Client.UserInterface if (args.Function == EngineKeyFunctions.UIClick && hands.ActiveIndex != handIndex) { hands.SendChangeHand(handIndex); + args.Handle(); } return; } if (_itemSlotManager.OnButtonPressed(args, entity)) + { + args.Handle(); return; + } if (args.Function == EngineKeyFunctions.UIClick) { @@ -153,6 +156,7 @@ namespace Content.Client.UserInterface { hands.AttackByInHand(handIndex); } + args.Handle(); return; } } diff --git a/Content.Client/UserInterface/ItemSlotManager.cs b/Content.Client/UserInterface/ItemSlotManager.cs index 768ddd30af..5c07cd5f57 100644 --- a/Content.Client/UserInterface/ItemSlotManager.cs +++ b/Content.Client/UserInterface/ItemSlotManager.cs @@ -65,8 +65,6 @@ namespace Content.Client.UserInterface public bool OnButtonPressed(GUIBoundKeyEventArgs args, IEntity item) { - args.Handle(); - if (item == null) return false; @@ -99,6 +97,7 @@ namespace Content.Client.UserInterface { return false; } + args.Handle(); return true; }