* Reapply "Remove some BUI boilerplate" (#30214)
This reverts commit cb0ba66be3.
* Fix gas tank
* Fix PA
* Fix microwave
* Comms console underwrap
* Fix rcd
* log wehs
46 lines
1.2 KiB
C#
46 lines
1.2 KiB
C#
using Content.Shared.Bed.Cryostorage;
|
|
using JetBrains.Annotations;
|
|
using Robust.Client.UserInterface;
|
|
|
|
namespace Content.Client.Bed.Cryostorage;
|
|
|
|
[UsedImplicitly]
|
|
public sealed class CryostorageBoundUserInterface : BoundUserInterface
|
|
{
|
|
[ViewVariables]
|
|
private CryostorageMenu? _menu;
|
|
|
|
public CryostorageBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
|
{
|
|
}
|
|
|
|
protected override void Open()
|
|
{
|
|
base.Open();
|
|
|
|
_menu = this.CreateWindow<CryostorageMenu>();
|
|
|
|
_menu.SlotRemoveButtonPressed += (ent, slot) =>
|
|
{
|
|
SendMessage(new CryostorageRemoveItemBuiMessage(ent, slot, CryostorageRemoveItemBuiMessage.RemovalType.Inventory));
|
|
};
|
|
|
|
_menu.HandRemoveButtonPressed += (ent, hand) =>
|
|
{
|
|
SendMessage(new CryostorageRemoveItemBuiMessage(ent, hand, CryostorageRemoveItemBuiMessage.RemovalType.Hand));
|
|
};
|
|
}
|
|
|
|
protected override void UpdateState(BoundUserInterfaceState state)
|
|
{
|
|
base.UpdateState(state);
|
|
|
|
switch (state)
|
|
{
|
|
case CryostorageBuiState msg:
|
|
_menu?.UpdateState(msg);
|
|
break;
|
|
}
|
|
}
|
|
}
|