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;
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;
helper.Control.Orphan();
helper.Window.Dispose();
helper.Window = null;
+ helper.EverOpened = false;
var monitor = _clyde.EnumerateMonitors().First();
}
// please kill all this indirection
-public interface IAHelpUIHandler: IDisposable
+public interface IAHelpUIHandler : IDisposable
{
public bool IsAdmin { get; }
public bool IsOpen { get; }
private readonly Dictionary<NetUserId, BwoinkPanel> _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;
public void ToggleWindow()
{
EnsurePanel(_ownerId);
+
if (IsOpen)
{
Close();
}
else
{
- Window!.OpenCentered();
+ if (EverOpened)
+ Window!.Open();
+ else
+ Window!.OpenCentered();
+
+ EverOpened = true;
}
}
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)
Window = null;
Control = null;
_activePanelMap.Clear();
+ EverOpened = false;
}
}
+
public sealed class UserAHelpUIHandler : IAHelpUIHandler
{
private readonly NetUserId _ownerId;