From 38b8b3ff65b7a5a8d2d996795881a55f10ff7115 Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Sun, 26 May 2024 14:11:37 +1200 Subject: [PATCH] Fix storage UI interactions (#28291) * Fix storage UI interactions * Add VV support --- .../UserInterface/Systems/Storage/Controls/ItemGridPiece.cs | 4 +++- Content.Shared/Interaction/SharedInteractionSystem.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Content.Client/UserInterface/Systems/Storage/Controls/ItemGridPiece.cs b/Content.Client/UserInterface/Systems/Storage/Controls/ItemGridPiece.cs index f436cc8c39b..dd9986e4c6e 100644 --- a/Content.Client/UserInterface/Systems/Storage/Controls/ItemGridPiece.cs +++ b/Content.Client/UserInterface/Systems/Storage/Controls/ItemGridPiece.cs @@ -9,7 +9,7 @@ namespace Content.Client.UserInterface.Systems.Storage.Controls; -public sealed class ItemGridPiece : Control +public sealed class ItemGridPiece : Control, IEntityControl { private readonly IEntityManager _entityManager; private readonly StorageUIController _storageController; @@ -287,6 +287,8 @@ public static Vector2 GetCenterOffset(Entity entity, ItemStorage var actualSize = new Vector2(boxSize.X + 1, boxSize.Y + 1); return actualSize * new Vector2i(8, 8); } + + public EntityUid? UiEntity => Entity; } public enum ItemGridPieceMarks diff --git a/Content.Shared/Interaction/SharedInteractionSystem.cs b/Content.Shared/Interaction/SharedInteractionSystem.cs index 4c22bcb14e4..1c4a697cc4e 100644 --- a/Content.Shared/Interaction/SharedInteractionSystem.cs +++ b/Content.Shared/Interaction/SharedInteractionSystem.cs @@ -1167,7 +1167,7 @@ public bool CanAccessViaStorage(EntityUid user, EntityUid target, BaseContainer return false; // we don't check if the user can access the storage entity itself. This should be handed by the UI system. - return _ui.IsUiOpen(target, StorageComponent.StorageUiKey.Key, user); + return _ui.IsUiOpen(container.Owner, StorageComponent.StorageUiKey.Key, user); } ///