Fix ItemSlotButton and HandsGui handling all input.

Fixes #904
This commit is contained in:
Pieter-Jan Briers
2020-05-11 11:19:41 +02:00
parent 033a6a82b5
commit 63b0df5ba2
2 changed files with 7 additions and 4 deletions

View File

@@ -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;
}
}