<cc:UICommandButton Command="callshuttle" Text="{Loc admin-player-actions-window-shuttle}" WindowType="{x:Type at:AdminShuttleWindow}"/>
<cc:CommandButton Command="adminlogs" Text="{Loc admin-player-actions-window-admin-logs}"/>
<cc:CommandButton Command="faxui" Text="{Loc admin-player-actions-window-admin-fax}"/>
+ <cc:CommandButton Command="achatwindow" Text="{Loc admin-player-actions-window-admin-chat}"/>
</GridContainer>
</BoxContainer>
</Control>
--- /dev/null
+<controls:FancyWindow xmlns="https://spacestation14.io"
+ xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
+ xmlns:widgets="clr-namespace:Content.Client.UserInterface.Systems.Chat.Widgets"
+ Title="{Loc chat-window-title}"
+ MinSize="465 265">
+ <widgets:ChatBox Name="Chatbox"/>
+</controls:FancyWindow>
--- /dev/null
+using Content.Client.UserInterface.Controls;
+using Content.Shared.Chat;
+using Robust.Client.AutoGenerated;
+using Robust.Client.UserInterface.XAML;
+
+namespace Content.Client.UserInterface.Systems.Chat;
+
+/// <summary>
+/// Window which only holds a single chatbox, useful for monitoring multiple chats simultaneously.
+/// </summary>
+[GenerateTypedNameReferences]
+public sealed partial class ChatWindow : FancyWindow
+{
+ public ChatWindow()
+ {
+ RobustXamlLoader.Load(this);
+ IoCManager.InjectDependencies(this);
+
+ // These are necessary for the controls inside the chatbox to initialize correctly:
+ Chatbox.Repopulate();
+ var controller = UserInterfaceManager.GetUIController<ChatUIController>();
+ controller.UpdateSelectedChannel(Chatbox);
+ }
+
+ /// <summary>
+ /// Helper method to configure this window to be useful for admins.
+ /// Sets incoming filters to only admin chats and output to admin channel
+ /// </summary>
+ public void ConfigureForAdminChat()
+ {
+ Chatbox.ChatInput.ChannelSelector.Select(ChatSelectChannel.Admin);
+
+ var filter = Chatbox.ChatInput.FilterButton.Popup;
+ foreach (var c in Enum.GetValues(typeof(ChatChannel)))
+ {
+ var channel = (ChatChannel)c;
+ var isAdminInterest = channel == ChatChannel.Admin
+ || channel == ChatChannel.AdminChat
+ || channel == ChatChannel.AdminAlert
+ || channel == ChatChannel.AdminRelated;
+ filter.SetActive(channel, isAdminInterest);
+ }
+ }
+}
--- /dev/null
+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();
+ }
+}
-using Content.Shared.Chat;
+using Content.Shared.Chat;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
return _filterStates.TryGetValue(channel, out var checkbox) && checkbox.Pressed;
}
+ public void SetActive(ChatChannel channel, bool isActive)
+ {
+ if (_filterStates.TryGetValue(channel, out var checkbox) && checkbox.Pressed != isActive)
+ {
+ checkbox.Pressed = isActive;
+ OnChannelFilter?.Invoke(checkbox.Channel, checkbox.Pressed);
+ }
+ }
+
public ChatChannel GetActive()
{
ChatChannel active = 0;
admin-player-actions-window-admin-logs = Admin Logs
admin-player-actions-window-admin-notes = Admin Notes
admin-player-actions-window-admin-fax = Admin Fax
+admin-player-actions-window-admin-chat = Admin Chat
--- /dev/null
+chat-window-title = Chat
+
+cmd-chatwindow-desc = Additional Chat Window
+cmd-chatwindow-help = Usage: chatwindow
+
+cmd-achatwindow-desc = Admin Chat Window
+cmd-achatwindow-help = Usage: achatwindow
- replay_stop
- replay_load
- saveconfig
+ - chatwindow
- Flags: DEBUG
Commands:
- uploadfile
- loadprototype
- uploadfolder
+
+- Flags: ADMINCHAT
+ Commands:
+ - achatwindow