mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 13:37:47 +03:00
* Implement gridinv, 1500 squashed commits :elp: * Me when * Linter errors * Fix katana belts
41 lines
1.0 KiB
C#
41 lines
1.0 KiB
C#
using Content.Client.Storage.Systems;
|
|
using Content.Shared.Storage;
|
|
using JetBrains.Annotations;
|
|
|
|
namespace Content.Client.Storage;
|
|
|
|
[UsedImplicitly]
|
|
public sealed class StorageBoundUserInterface : BoundUserInterface
|
|
{
|
|
[Dependency] private readonly IEntityManager _entManager = default!;
|
|
|
|
private readonly StorageSystem _storage;
|
|
|
|
public StorageBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
|
{
|
|
IoCManager.InjectDependencies(this);
|
|
_storage = _entManager.System<StorageSystem>();
|
|
}
|
|
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
base.Dispose(disposing);
|
|
if (!disposing)
|
|
return;
|
|
|
|
_storage.CloseStorageWindow(Owner);
|
|
}
|
|
|
|
protected override void ReceiveMessage(BoundUserInterfaceMessage message)
|
|
{
|
|
base.ReceiveMessage(message);
|
|
|
|
if (message is StorageModifyWindowMessage)
|
|
{
|
|
if (_entManager.TryGetComponent<StorageComponent>(Owner, out var comp))
|
|
_storage.OpenStorageWindow((Owner, comp));
|
|
}
|
|
}
|
|
}
|
|
|