]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix storage UI interactions (#28291)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Sun, 26 May 2024 02:11:37 +0000 (14:11 +1200)
committerGitHub <noreply@github.com>
Sun, 26 May 2024 02:11:37 +0000 (12:11 +1000)
* Fix storage UI interactions

* Add VV support

Content.Client/UserInterface/Systems/Storage/Controls/ItemGridPiece.cs
Content.Shared/Interaction/SharedInteractionSystem.cs

index f436cc8c39bbdc659f2e501e169fcd522ee59d5c..dd9986e4c6e69d70e1f8fc4a0b748978a6cd098b 100644 (file)
@@ -9,7 +9,7 @@ using Robust.Client.UserInterface.CustomControls;
 
 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 sealed class ItemGridPiece : Control
         var actualSize = new Vector2(boxSize.X + 1, boxSize.Y + 1);
         return actualSize * new Vector2i(8, 8);
     }
+
+    public EntityUid? UiEntity => Entity;
 }
 
 public enum ItemGridPieceMarks
index 3324ce5b9b8d48dd820fcbeef4a66bb559a56979..6f6777ee96485d7cc13e44a7658334e9d91a30d4 100644 (file)
@@ -1167,7 +1167,7 @@ namespace Content.Shared.Interaction
                 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);
         }
 
         /// <summary>