2022-10-12 01:16:23 -07:00
|
|
|
using Content.Client.UserInterface.Systems.Bwoink;
|
2021-12-13 16:45:49 +11:00
|
|
|
using Content.Shared.Administration;
|
2022-10-12 01:16:23 -07:00
|
|
|
using Robust.Client.UserInterface;
|
2021-10-06 16:25:27 +01:00
|
|
|
using Robust.Shared.Console;
|
2021-12-22 13:34:09 +01:00
|
|
|
using Robust.Shared.Network;
|
2021-10-06 16:25:27 +01:00
|
|
|
|
2024-01-03 23:29:37 +01:00
|
|
|
namespace Content.Client.Commands;
|
|
|
|
|
|
|
|
|
|
[AnyCommand]
|
|
|
|
|
public sealed class OpenAHelpCommand : LocalizedCommands
|
2021-10-06 16:25:27 +01:00
|
|
|
{
|
2024-01-03 23:29:37 +01:00
|
|
|
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
|
|
|
|
|
|
|
|
|
|
public override string Command => "openahelp";
|
2021-10-06 16:25:27 +01:00
|
|
|
|
2024-01-03 23:29:37 +01:00
|
|
|
public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
|
|
|
|
|
|
|
|
|
|
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
|
|
|
|
{
|
|
|
|
|
if (args.Length >= 2)
|
2021-10-06 16:25:27 +01:00
|
|
|
{
|
2024-01-03 23:29:37 +01:00
|
|
|
shell.WriteLine(Help);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (args.Length == 0)
|
|
|
|
|
{
|
|
|
|
|
_userInterfaceManager.GetUIController<AHelpUIController>().Open();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (Guid.TryParse(args[0], out var guid))
|
2021-10-06 16:25:27 +01:00
|
|
|
{
|
2024-01-03 23:29:37 +01:00
|
|
|
var targetUser = new NetUserId(guid);
|
|
|
|
|
_userInterfaceManager.GetUIController<AHelpUIController>().Open(targetUser);
|
2021-10-06 16:25:27 +01:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2024-01-03 23:29:37 +01:00
|
|
|
shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error"));
|
2021-10-06 16:25:27 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|