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