Inventory Input (#503)

* Create ItemSlotButton

* Refactor inventory buttons

Refactor so that KeyBind handling of inventory and hands are the same.

* Refactor InventoryInterfaceController to call ItemSlotManager with entities

This change allows HandsGUI and InventoryInterfaceController to just call ItemSlotManager.OnButtonPressed with an entity instead of a slot.

* Add CooldownCircle to ItemSlotButton

This allows Hands and Inventory to have cooldown circles on their ItemSlots.

* Refactor HandsGUI to use ItemSlots

This allows functionality and GUI to be the same between Inventory and Hands.

Added clicking empty hand to switch ActiveHand to clicked hand.

* Implement CooldownCircle in ItemSlotManager

Reorganize files
This commit is contained in:
ShadowCommander
2020-01-17 06:43:20 -08:00
committed by Pieter-Jan Briers
parent c20ba98a1e
commit d03da83fda
13 changed files with 368 additions and 323 deletions

View File

@@ -14,6 +14,8 @@ using Robust.Shared.IoC;
using Robust.Shared.ViewVariables;
using static Content.Shared.GameObjects.Components.Inventory.EquipmentSlotDefines;
using static Content.Shared.GameObjects.SharedInventoryComponent.ClientInventoryMessage;
using Content.Shared.GameObjects.Components.Inventory;
using System;
namespace Content.Client.GameObjects
{
@@ -167,5 +169,10 @@ namespace Content.Client.GameObjects
break;
}
}
public bool TryGetSlot(Slots slot, out IEntity item)
{
return _slots.TryGetValue(slot, out item);
}
}
}