* Reapply "Remove some BUI boilerplate" (#30214)
This reverts commit cb0ba66be3.
* Fix gas tank
* Fix PA
* Fix microwave
* Comms console underwrap
* Fix rcd
* log wehs
41 lines
1003 B
C#
41 lines
1003 B
C#
using Content.Client.Power.APC.UI;
|
|
using Content.Shared.APC;
|
|
using JetBrains.Annotations;
|
|
using Robust.Client.GameObjects;
|
|
using Robust.Client.UserInterface;
|
|
|
|
namespace Content.Client.Power.APC
|
|
{
|
|
[UsedImplicitly]
|
|
public sealed class ApcBoundUserInterface : BoundUserInterface
|
|
{
|
|
[ViewVariables]
|
|
private ApcMenu? _menu;
|
|
|
|
public ApcBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
|
{
|
|
}
|
|
|
|
protected override void Open()
|
|
{
|
|
base.Open();
|
|
|
|
_menu = this.CreateWindow<ApcMenu>();
|
|
_menu.OnBreaker += BreakerPressed;
|
|
}
|
|
|
|
protected override void UpdateState(BoundUserInterfaceState state)
|
|
{
|
|
base.UpdateState(state);
|
|
|
|
var castState = (ApcBoundInterfaceState) state;
|
|
_menu?.UpdateState(castState);
|
|
}
|
|
|
|
public void BreakerPressed()
|
|
{
|
|
SendMessage(new ApcToggleMainBreakerMessage());
|
|
}
|
|
}
|
|
}
|