Fix: Ability to open AHelp in the lobby by pressing the hotkey (#39525)
* Fix * Update
This commit is contained in:
@@ -16,6 +16,7 @@ using Content.Shared.Input;
|
|||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Client.Audio;
|
using Robust.Client.Audio;
|
||||||
using Robust.Client.Graphics;
|
using Robust.Client.Graphics;
|
||||||
|
using Robust.Client.Input;
|
||||||
using Robust.Client.Player;
|
using Robust.Client.Player;
|
||||||
using Robust.Client.UserInterface;
|
using Robust.Client.UserInterface;
|
||||||
using Robust.Client.UserInterface.Controllers;
|
using Robust.Client.UserInterface.Controllers;
|
||||||
@@ -37,6 +38,7 @@ public sealed class AHelpUIController: UIController, IOnSystemChanged<BwoinkSyst
|
|||||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||||
[Dependency] private readonly IClyde _clyde = default!;
|
[Dependency] private readonly IClyde _clyde = default!;
|
||||||
[Dependency] private readonly IUserInterfaceManager _uiManager = default!;
|
[Dependency] private readonly IUserInterfaceManager _uiManager = default!;
|
||||||
|
[Dependency] private readonly IInputManager _input = default!;
|
||||||
[UISystemDependency] private readonly AudioSystem _audio = default!;
|
[UISystemDependency] private readonly AudioSystem _audio = default!;
|
||||||
|
|
||||||
private BwoinkSystem? _bwoinkSystem;
|
private BwoinkSystem? _bwoinkSystem;
|
||||||
@@ -98,15 +100,13 @@ public sealed class AHelpUIController: UIController, IOnSystemChanged<BwoinkSyst
|
|||||||
_bwoinkSystem = system;
|
_bwoinkSystem = system;
|
||||||
_bwoinkSystem.OnBwoinkTextMessageRecieved += ReceivedBwoink;
|
_bwoinkSystem.OnBwoinkTextMessageRecieved += ReceivedBwoink;
|
||||||
|
|
||||||
CommandBinds.Builder
|
_input.SetInputCommand(ContentKeyFunctions.OpenAHelp,
|
||||||
.Bind(ContentKeyFunctions.OpenAHelp,
|
InputCmdHandler.FromDelegate(_ => ToggleWindow()));
|
||||||
InputCmdHandler.FromDelegate(_ => ToggleWindow()))
|
|
||||||
.Register<AHelpUIController>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnSystemUnloaded(BwoinkSystem system)
|
public void OnSystemUnloaded(BwoinkSystem system)
|
||||||
{
|
{
|
||||||
CommandBinds.Unregister<AHelpUIController>();
|
_input.SetInputCommand(ContentKeyFunctions.OpenAHelp, null);
|
||||||
|
|
||||||
DebugTools.Assert(_bwoinkSystem != null);
|
DebugTools.Assert(_bwoinkSystem != null);
|
||||||
_bwoinkSystem!.OnBwoinkTextMessageRecieved -= ReceivedBwoink;
|
_bwoinkSystem!.OnBwoinkTextMessageRecieved -= ReceivedBwoink;
|
||||||
|
|||||||
Reference in New Issue
Block a user