diff --git a/Content.Client/UserInterface/Systems/Bwoink/AHelpUIController.cs b/Content.Client/UserInterface/Systems/Bwoink/AHelpUIController.cs index 9915361652..2e1f86acd4 100644 --- a/Content.Client/UserInterface/Systems/Bwoink/AHelpUIController.cs +++ b/Content.Client/UserInterface/Systems/Bwoink/AHelpUIController.cs @@ -2,12 +2,9 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; using Content.Client.Administration.Managers; using Content.Client.Administration.Systems; -using Content.Client.Administration.UI; using Content.Client.Administration.UI.Bwoink; -using Content.Client.Administration.UI.CustomControls; using Content.Client.Gameplay; using Content.Client.UserInterface.Controls; -using Content.Client.UserInterface.Systems.Info; using Content.Shared.Administration; using Content.Shared.Input; using JetBrains.Annotations; @@ -22,7 +19,6 @@ using Robust.Shared.Input.Binding; using Robust.Shared.Network; using Robust.Shared.Player; using Robust.Shared.Utility; -using BwoinkPanel = Content.Client.Administration.UI.Bwoink.BwoinkPanel; namespace Content.Client.UserInterface.Systems.Bwoink; @@ -196,6 +192,7 @@ public sealed class AHelpUIController: UIController, IOnStateChanged _activePanelMap = new(); public bool IsAdmin => true; public bool IsOpen => Window is { Disposed: false, IsOpen: true } || ClydeWindow is { IsDisposed: false }; + public bool EverOpened; public BwoinkWindow? Window; public WindowRoot? WindowRoot; @@ -282,13 +280,19 @@ public sealed class AdminAHelpUIHandler : IAHelpUIHandler public void ToggleWindow() { EnsurePanel(_ownerId); + if (IsOpen) { Close(); } else { - Window!.OpenCentered(); + if (EverOpened) + Window!.Open(); + else + Window!.OpenCentered(); + + EverOpened = true; } } @@ -315,7 +319,11 @@ public sealed class AdminAHelpUIHandler : IAHelpUIHandler Window = new BwoinkWindow(); Control = Window.Bwoink; Window.OnClose += () => { OnClose?.Invoke(); }; - Window.OnOpen += () => { OnOpen?.Invoke(); }; + Window.OnOpen += () => + { + OnOpen?.Invoke(); + EverOpened = true; + }; // need to readd any unattached panels.. foreach (var (_, panel) in _activePanelMap) @@ -356,8 +364,10 @@ public sealed class AdminAHelpUIHandler : IAHelpUIHandler Window = null; Control = null; _activePanelMap.Clear(); + EverOpened = false; } } + public sealed class UserAHelpUIHandler : IAHelpUIHandler { private readonly NetUserId _ownerId;