Files
tbd-station-14/Content.Client/Pinpointer/UI/StationMapBoundUserInterface.cs
Nemanja cb0ba66be3 Revert "Remove some BUI boilerplate" (#30214)
Revert "Remove some BUI boilerplate (#28399)"

This reverts commit cbf329a82d.
2024-07-20 20:42:27 -04:00

36 lines
826 B
C#

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