CatStation/Content.Client/Commands/OpenAHelpCommand.cs
Pieter-Jan Briers 37998d89ab
Bwoink "quick info" system for names (#44319)
This implements the SS13 feature where ahelps display a link to get quick info when a character name is mentioned.

Also just some cleanup of bwoink code cuz it sucks.
2026-06-20 23:29:24 +00:00

42 lines
1.3 KiB
C#

using Content.Client.UserInterface.Systems.Bwoink;
using Content.Shared.Administration;
using Robust.Client.UserInterface;
using Robust.Shared.Console;
using Robust.Shared.Network;
namespace Content.Client.Commands;
[AnyCommand]
public sealed partial class OpenAHelpCommand : LocalizedCommands
{
[Dependency] private IUserInterfaceManager _userInterfaceManager = default!;
public override string Command => AdminCommandSyntax.NameOpenAdminHelp;
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)
{
shell.WriteLine(Help);
return;
}
if (args.Length == 0)
{
_userInterfaceManager.GetUIController<AHelpUIController>().Open();
}
else
{
if (Guid.TryParse(args[0], out var guid))
{
var targetUser = new NetUserId(guid);
_userInterfaceManager.GetUIController<AHelpUIController>().Open(targetUser);
}
else
{
shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error"));
}
}
}
}