diff --git a/Content.Client/UserInterface/Systems/Bwoink/AHelpUIController.cs b/Content.Client/UserInterface/Systems/Bwoink/AHelpUIController.cs index a13629df00..285b84ab19 100644 --- a/Content.Client/UserInterface/Systems/Bwoink/AHelpUIController.cs +++ b/Content.Client/UserInterface/Systems/Bwoink/AHelpUIController.cs @@ -4,7 +4,6 @@ using System.Numerics; using Content.Client.Administration.Managers; using Content.Client.Administration.Systems; using Content.Client.Administration.UI.Bwoink; -using Content.Client.Gameplay; using Content.Client.UserInterface.Controls; using Content.Shared.Administration; using Content.Shared.Input; @@ -24,7 +23,7 @@ using Robust.Shared.Utility; namespace Content.Client.UserInterface.Systems.Bwoink; [UsedImplicitly] -public sealed class AHelpUIController: UIController, IOnStateChanged, IOnSystemChanged +public sealed class AHelpUIController: UIController, IOnSystemChanged { [Dependency] private readonly IClientAdminManager _adminManager = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; @@ -42,16 +41,8 @@ public sealed class AHelpUIController: UIController, IOnStateChanged(DiscordRelayUpdated); SubscribeNetworkEvent(PeopleTypingUpdated); - } - public void OnStateEntered(GameplayState state) - { _adminManager.AdminStatusUpdated += OnAdminStatusUpdated; - - CommandBinds.Builder - .Bind(ContentKeyFunctions.OpenAHelp, - InputCmdHandler.FromDelegate(_ => ToggleWindow())) - .Register(); } public void UnloadButton() @@ -87,22 +78,21 @@ public sealed class AHelpUIController: UIController, IOnStateChanged(); - } public void OnSystemLoaded(BwoinkSystem system) { _bwoinkSystem = system; _bwoinkSystem.OnBwoinkTextMessageRecieved += RecievedBwoink; + + CommandBinds.Builder + .Bind(ContentKeyFunctions.OpenAHelp, + InputCmdHandler.FromDelegate(_ => ToggleWindow())) + .Register(); } public void OnSystemUnloaded(BwoinkSystem system) { + CommandBinds.Unregister(); + DebugTools.Assert(_bwoinkSystem != null); _bwoinkSystem!.OnBwoinkTextMessageRecieved -= RecievedBwoink; _bwoinkSystem = null;