Files
OldThink/Content.Client/Pinpointer/UI/StationMapBoundUserInterface.cs

36 lines
826 B
C#
Raw Permalink Normal View History

2023-04-13 16:21:24 +10:00
using Robust.Client.GameObjects;
namespace Content.Client.Pinpointer.UI;
public sealed class StationMapBoundUserInterface : BoundUserInterface
{
2023-07-08 09:02:17 -07:00
[ViewVariables]
2023-04-13 16:21:24 +10:00
private StationMapWindow? _window;
2023-07-08 09:02:17 -07:00
public StationMapBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
2023-04-13 16:21:24 +10:00
{
}
protected override void Open()
{
base.Open();
_window?.Close();
EntityUid? gridUid = null;
2023-07-08 09:02:17 -07:00
if (EntMan.TryGetComponent<TransformComponent>(Owner, out var xform))
2023-04-13 16:21:24 +10:00
{
gridUid = xform.GridUid;
}
2023-07-08 09:02:17 -07:00
_window = new StationMapWindow(gridUid, Owner);
2023-04-13 16:21:24 +10:00
_window.OpenCentered();
_window.OnClose += Close;
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
_window?.Dispose();
}
}