Files
crystall-punk-14/Content.Client/Power/APC/ApcBoundUserInterface.cs

51 lines
1.2 KiB
C#
Raw Normal View History

using Content.Client.Power.APC.UI;
2021-06-09 22:19:39 +02:00
using Content.Shared.APC;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
2018-08-31 08:52:48 +02:00
namespace Content.Client.Power.APC
2018-08-31 08:52:48 +02:00
{
[UsedImplicitly]
public sealed class ApcBoundUserInterface : BoundUserInterface
2018-08-31 08:52:48 +02:00
{
2023-07-08 09:02:17 -07:00
[ViewVariables]
private ApcMenu? _menu;
public ApcBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}
2018-08-31 08:52:48 +02:00
protected override void Open()
{
base.Open();
2023-07-08 09:02:17 -07:00
_menu = new ApcMenu(this);
_menu.OnClose += Close;
_menu.OpenCentered();
2018-08-31 08:52:48 +02:00
}
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
var castState = (ApcBoundInterfaceState) state;
_menu?.UpdateState(castState);
}
public void BreakerPressed()
{
SendMessage(new ApcToggleMainBreakerMessage());
2018-08-31 08:52:48 +02:00
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (disposing)
{
_menu?.Dispose();
}
2018-08-31 08:52:48 +02:00
}
}
}