Skip to content

Commit

Permalink
Fix storage UI interactions (#28291)
Browse files Browse the repository at this point in the history
* Fix storage UI interactions

* Add VV support
  • Loading branch information
ElectroJr authored and VMSolidus committed Nov 15, 2024
1 parent 1e0b373 commit 38b8b3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -287,6 +287,8 @@ public static Vector2 GetCenterOffset(Entity<ItemComponent?> 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
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Interaction/SharedInteractionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/// <summary>
Expand Down

0 comments on commit 38b8b3f

Please sign in to comment.