Command to open chatbox in a new window (#33548)

* Command to open chatbox in a new window

* Add command for users with AdminChat permission

* Add command button to admin tools window
This commit is contained in:
eoineoineoin
2025-04-14 16:37:58 +01:00
committed by GitHub
parent a1439c5637
commit 7c4b34c1de
8 changed files with 110 additions and 1 deletions

View File

@@ -0,0 +1,35 @@
using JetBrains.Annotations;
using Robust.Shared.Console;
namespace Content.Client.UserInterface.Systems.Chat;
/// <summary>
/// Command which creates a window containing a chatbox
/// </summary>
[UsedImplicitly]
public sealed class ChatWindowCommand : LocalizedCommands
{
public override string Command => "chatwindow";
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
var window = new ChatWindow();
window.OpenCentered();
}
}
/// <summary>
/// Command which creates a window containing a chatbox configured for admin use
/// </summary>
[UsedImplicitly]
public sealed class AdminChatWindowCommand : LocalizedCommands
{
public override string Command => "achatwindow";
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
var window = new ChatWindow();
window.ConfigureForAdminChat();
window.OpenCentered();
}
}