Show if items can be placed in a slot when hovering (#1480)

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
This commit is contained in:
Moses
2020-07-26 07:25:38 -05:00
committed by GitHub
parent bab1345b87
commit 8e08c64fcf
9 changed files with 135 additions and 4 deletions

View File

@@ -91,6 +91,14 @@ namespace Content.Client.GameObjects
doneSlots.Add(slot);
}
if (cast.HoverEntity != null)
{
var (slot, (entityUid, fits)) = cast.HoverEntity.Value;
var entity = Owner.EntityManager.GetEntity(entityUid);
InterfaceController?.HoverInSlot(slot, entity, fits);
}
foreach (var slot in _slots.Keys.ToList())
{
if (!doneSlots.Contains(slot))
@@ -171,6 +179,11 @@ namespace Content.Client.GameObjects
SendNetworkMessage(equipmessage);
}
public void SendHoverMessage(Slots slot)
{
SendNetworkMessage(new ClientInventoryMessage(slot, ClientInventoryUpdate.Hover));
}
public void SendOpenStorageUIMessage(Slots slot)
{
SendNetworkMessage(new OpenSlotStorageUIMessage(slot));