2021-06-09 22:19:39 +02:00
|
|
|
using Content.Server.Administration.UI;
|
|
|
|
|
using Content.Server.EUI;
|
2020-11-10 16:50:28 +01:00
|
|
|
using Content.Shared.Administration;
|
2021-02-01 16:49:43 -08:00
|
|
|
using Robust.Shared.Console;
|
2020-11-10 16:50:28 +01:00
|
|
|
|
|
|
|
|
namespace Content.Server.Administration.Commands
|
|
|
|
|
{
|
|
|
|
|
[AdminCommand(AdminFlags.Permissions)]
|
2025-06-17 13:22:03 -04:00
|
|
|
public sealed class OpenPermissionsCommand : LocalizedEntityCommands
|
2020-11-10 16:50:28 +01:00
|
|
|
{
|
2025-06-17 13:22:03 -04:00
|
|
|
[Dependency] private readonly EuiManager _euiManager = default!;
|
2020-11-10 16:50:28 +01:00
|
|
|
|
2025-06-17 13:22:03 -04:00
|
|
|
public override string Command => "permissions";
|
|
|
|
|
|
|
|
|
|
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
2020-11-10 16:50:28 +01:00
|
|
|
{
|
2023-10-28 09:59:53 +11:00
|
|
|
var player = shell.Player;
|
2020-11-10 16:50:28 +01:00
|
|
|
if (player == null)
|
|
|
|
|
{
|
2025-06-17 13:22:03 -04:00
|
|
|
shell.WriteLine(Loc.GetString($"shell-cannot-run-command-from-server"));
|
2020-11-10 16:50:28 +01:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var ui = new PermissionsEui();
|
2025-06-17 13:22:03 -04:00
|
|
|
_euiManager.OpenEui(ui, player);
|
2020-11-10 16:50:28 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|