* Remove some BUI boilerplate - The disposals overrides got removed due to the helper method handling it. - Replace window creation with CreateWindow helper. - Fixed some stinky code which would cause exceptions. * More * moar * weh * done * More BUIs * More updates * weh * moar * look who it is * weh * merge * weh * fixes
29 lines
730 B
C#
29 lines
730 B
C#
using Robust.Client.UserInterface;
|
|
|
|
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();
|
|
EntityUid? gridUid = null;
|
|
|
|
if (EntMan.TryGetComponent<TransformComponent>(Owner, out var xform))
|
|
{
|
|
gridUid = xform.GridUid;
|
|
}
|
|
|
|
_window = this.CreateWindow<StationMapWindow>();
|
|
_window.Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName;
|
|
_window.Set(gridUid, Owner);
|
|
}
|
|
}
|