Virtual items cleanup (#23912)

* Virtual items cleanup

* Detail

* Review

---------

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
AJCM-git
2024-01-14 06:18:47 -04:00
committed by GitHub
parent 95ef20223c
commit 108f001731
27 changed files with 310 additions and 195 deletions

View File

@@ -12,6 +12,7 @@ using Content.Client.UserInterface.Systems.Inventory.Windows;
using Content.Shared.Containers.ItemSlots;
using Content.Shared.Hands.Components;
using Content.Shared.Input;
using Content.Shared.Inventory.VirtualItem;
using Content.Shared.Storage;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
@@ -423,8 +424,17 @@ public sealed class InventoryUIController : UIController, IOnStateEntered<Gamepl
if (_slotGroups.GetValueOrDefault(group)?.GetButton(name) is not { } button)
return;
button.SpriteView.SetEntity(entity);
button.StorageButton.Visible = showStorage;
if (_entities.TryGetComponent(entity, out VirtualItemComponent? virtb))
{
button.SpriteView.SetEntity(virtb.BlockingEntity);
button.Blocked = true;
}
else
{
button.SpriteView.SetEntity(entity);
button.Blocked = false;
button.StorageButton.Visible = showStorage;
}
}
public bool RegisterSlotGroupContainer(ItemSlotButtonContainer slotContainer)