Update submodule, UI fixes.

This commit is contained in:
Pieter-Jan Briers
2020-05-05 23:59:31 +02:00
parent b9e59fc8d4
commit cf9edddf2f
6 changed files with 44 additions and 33 deletions

View File

@@ -2,8 +2,9 @@
using Content.Client.UserInterface;
using Content.Shared.GameObjects.Components.Inventory;
using Content.Shared.Input;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.Input;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.IoC;
@@ -62,39 +63,35 @@ namespace Content.Client.GameObjects
{
}
protected virtual void HandleInventoryKeybind(BaseButton.ButtonEventArgs args, EquipmentSlotDefines.Slots slot)
protected virtual void HandleInventoryKeybind(GUIBoundKeyEventArgs args, EquipmentSlotDefines.Slots slot)
{
if (args.Event.CanFocus)
if (args.Function == EngineKeyFunctions.UIClick)
{
UseItemOnInventory(args, slot);
UseItemOnInventory(slot);
}
}
protected void AddToInventory(BaseButton.ButtonEventArgs args, EquipmentSlotDefines.Slots slot)
protected void AddToInventory(GUIBoundKeyEventArgs args, EquipmentSlotDefines.Slots slot)
{
if (!args.Event.CanFocus)
if (args.Function != EngineKeyFunctions.UIClick)
{
return;
}
args.Button.Pressed = false;
Owner.SendEquipMessage(slot);
}
protected void UseItemOnInventory(BaseButton.ButtonEventArgs args, EquipmentSlotDefines.Slots slot)
protected void UseItemOnInventory(EquipmentSlotDefines.Slots slot)
{
args.Button.Pressed = false;
Owner.SendUseMessage(slot);
}
protected void OpenStorage(BaseButton.ButtonEventArgs args, EquipmentSlotDefines.Slots slot)
protected void OpenStorage(GUIBoundKeyEventArgs args, EquipmentSlotDefines.Slots slot)
{
if (!args.Event.CanFocus && args.Event.Function != ContentKeyFunctions.ActivateItemInWorld)
if (args.Function != EngineKeyFunctions.UIClick && args.Function != ContentKeyFunctions.ActivateItemInWorld)
{
return;
}
args.Button.Pressed = false;
Owner.SendOpenStorageUIMessage(slot);
}