Files
tbd-station-14/Content.Client/Shuttles/BUI/RadarConsoleBoundUserInterface.cs
2022-08-21 03:38:30 +10:00

41 lines
1.0 KiB
C#

using Content.Client.Shuttles.UI;
using Content.Shared.Shuttles.BUIStates;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
namespace Content.Client.Shuttles.BUI;
[UsedImplicitly]
public sealed class RadarConsoleBoundUserInterface : BoundUserInterface
{
private RadarConsoleWindow? _window;
public RadarConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey) {}
protected override void Open()
{
base.Open();
_window = new RadarConsoleWindow();
_window.OnClose += Close;
_window.OpenCentered();
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (disposing)
{
_window?.Dispose();
}
}
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
if (state is not RadarConsoleBoundInterfaceState cState) return;
_window?.SetMatrix(cState.Coordinates, cState.Angle);
_window?.UpdateState(cState);
}
}