2022-06-16 15:28:16 +10:00
|
|
|
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, object uiKey) : base(owner, uiKey) {}
|
|
|
|
|
|
|
|
|
|
protected override void Open()
|
|
|
|
|
{
|
|
|
|
|
base.Open();
|
|
|
|
|
_window = new RadarConsoleWindow();
|
2022-07-06 14:33:54 +10:00
|
|
|
_window.OnClose += Close;
|
|
|
|
|
_window.OpenCentered();
|
2022-06-16 15:28:16 +10:00
|
|
|
}
|
|
|
|
|
|
2022-06-26 15:20:45 +10:00
|
|
|
protected override void Dispose(bool disposing)
|
|
|
|
|
{
|
|
|
|
|
base.Dispose(disposing);
|
|
|
|
|
if (disposing)
|
|
|
|
|
{
|
|
|
|
|
_window?.Dispose();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-16 15:28:16 +10:00
|
|
|
protected override void UpdateState(BoundUserInterfaceState state)
|
|
|
|
|
{
|
|
|
|
|
base.UpdateState(state);
|
|
|
|
|
if (state is not RadarConsoleBoundInterfaceState cState) return;
|
|
|
|
|
|
2022-06-23 14:36:47 +10:00
|
|
|
_window?.SetMatrix(cState.Coordinates, cState.Angle);
|
2022-06-16 15:28:16 +10:00
|
|
|
_window?.UpdateState(cState);
|
|
|
|
|
}
|
|
|
|
|
}
|