Files
crystall-punk-14/Content.Client/Gateway/UI/GatewayBoundUserInterface.cs

40 lines
947 B
C#
Raw Permalink Normal View History

using Content.Shared.Gateway;
2023-08-02 20:39:27 +10:00
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
namespace Content.Client.Gateway.UI;
2023-08-02 20:39:27 +10:00
[UsedImplicitly]
public sealed class GatewayBoundUserInterface : BoundUserInterface
{
private GatewayWindow? _window;
2023-08-02 20:39:27 +10:00
public GatewayBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}
protected override void Open()
{
base.Open();
_window = this.CreateWindow<GatewayWindow>();
_window.SetEntity(EntMan.GetNetEntity(Owner));
_window.OpenPortal += destination =>
{
SendMessage(new GatewayOpenPortalMessage(destination));
};
}
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
if (state is not GatewayBoundUserInterfaceState current)
return;
_window?.UpdateState(current);
}
}