add gateway for admeme (#17587)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
43
Content.Client/Gateway/UI/GatewayBoundUserInterface.cs
Normal file
43
Content.Client/Gateway/UI/GatewayBoundUserInterface.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using Content.Shared.Gateway;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client.Gateway.UI;
|
||||
|
||||
public sealed class GatewayBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
private GatewayWindow? _window;
|
||||
|
||||
public GatewayBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
|
||||
_window = new GatewayWindow();
|
||||
_window.OpenPortal += destination =>
|
||||
{
|
||||
SendMessage(new GatewayOpenPortalMessage(destination));
|
||||
};
|
||||
_window.OnClose += Close;
|
||||
_window?.OpenCentered();
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
_window?.Dispose();
|
||||
_window = null;
|
||||
}
|
||||
|
||||
protected override void UpdateState(BoundUserInterfaceState state)
|
||||
{
|
||||
base.UpdateState(state);
|
||||
|
||||
if (state is not GatewayBoundUserInterfaceState current)
|
||||
return;
|
||||
|
||||
_window?.UpdateState(current);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user