diff --git a/Content.Client/Gateway/UI/GatewayBoundUserInterface.cs b/Content.Client/Gateway/UI/GatewayBoundUserInterface.cs new file mode 100644 index 0000000000..e3204b7ff2 --- /dev/null +++ b/Content.Client/Gateway/UI/GatewayBoundUserInterface.cs @@ -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); + } +} diff --git a/Content.Client/Gateway/UI/GatewayWindow.xaml b/Content.Client/Gateway/UI/GatewayWindow.xaml new file mode 100644 index 0000000000..49e6bb679b --- /dev/null +++ b/Content.Client/Gateway/UI/GatewayWindow.xaml @@ -0,0 +1,22 @@ + + + + + + + + + + diff --git a/Content.Client/Gateway/UI/GatewayWindow.xaml.cs b/Content.Client/Gateway/UI/GatewayWindow.xaml.cs new file mode 100644 index 0000000000..b070cf3176 --- /dev/null +++ b/Content.Client/Gateway/UI/GatewayWindow.xaml.cs @@ -0,0 +1,180 @@ +using Content.Client.Computer; +using Content.Client.Stylesheets; +using Content.Client.UserInterface.Controls; +using Content.Shared.Gateway; +using Content.Shared.Shuttles.BUIStates; +using Robust.Client.AutoGenerated; +using Robust.Client.Graphics; +using Robust.Client.UserInterface; +using Robust.Client.UserInterface.Controls; +using Robust.Client.UserInterface.XAML; +using Robust.Shared.Timing; + +namespace Content.Client.Gateway.UI; + +[GenerateTypedNameReferences] +public sealed partial class GatewayWindow : FancyWindow, + IComputerWindow +{ + private readonly IGameTiming _timing; + + public event Action? OpenPortal; + private List<(EntityUid, string, TimeSpan, bool)> _destinations = default!; + private EntityUid? _current; + private TimeSpan _nextClose; + private TimeSpan _lastOpen; + private List