diff --git a/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs b/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs index d37f179b0c..fbc674bcf7 100644 --- a/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs +++ b/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs @@ -50,17 +50,19 @@ public sealed class ChatUIController : UIController public const char AliasLocal = '.'; public const char AliasConsole = '/'; public const char AliasDead = '\\'; + public const char AliasLOOC = '('; public const char AliasOOC = '['; public const char AliasEmotes = '@'; public const char AliasAdmin = ']'; public const char AliasRadio = ';'; public const char AliasWhisper = ','; - private static readonly Dictionary PrefixToChannel = new() + public static readonly Dictionary PrefixToChannel = new() { {AliasLocal, ChatSelectChannel.Local}, {AliasWhisper, ChatSelectChannel.Whisper}, {AliasConsole, ChatSelectChannel.Console}, + {AliasLOOC, ChatSelectChannel.LOOC}, {AliasOOC, ChatSelectChannel.OOC}, {AliasEmotes, ChatSelectChannel.Emotes}, {AliasAdmin, ChatSelectChannel.Admin}, @@ -68,7 +70,7 @@ public sealed class ChatUIController : UIController {AliasDead, ChatSelectChannel.Dead} }; - private static readonly Dictionary ChannelPrefixes = + public static readonly Dictionary ChannelPrefixes = PrefixToChannel.ToDictionary(kv => kv.Value, kv => kv.Key); /// @@ -370,23 +372,6 @@ public sealed class ChatUIController : UIController return channelSelector.ToString(); } - public static char GetChannelSelectorPrefix(ChatSelectChannel channelSelector) - { - return channelSelector switch - { - ChatSelectChannel.Local => '.', - ChatSelectChannel.Whisper => ',', - ChatSelectChannel.Radio => ';', - ChatSelectChannel.LOOC => '(', - ChatSelectChannel.OOC => '[', - ChatSelectChannel.Emotes => '@', - ChatSelectChannel.Dead => '\\', - ChatSelectChannel.Admin => ']', - ChatSelectChannel.Console => '/', - _ => ' ' - }; - } - private void UpdateChannelPermissions() { CanSendChannels = default; diff --git a/Content.Client/UserInterface/Systems/Chat/Controls/ChannelSelectorItemButton.cs b/Content.Client/UserInterface/Systems/Chat/Controls/ChannelSelectorItemButton.cs index 5c7ee1b657..fd25b2a619 100644 --- a/Content.Client/UserInterface/Systems/Chat/Controls/ChannelSelectorItemButton.cs +++ b/Content.Client/UserInterface/Systems/Chat/Controls/ChannelSelectorItemButton.cs @@ -15,7 +15,7 @@ public sealed class ChannelSelectorItemButton : Button Channel = selector; AddStyleClass(StyleNano.StyleClassChatChannelSelectorButton); Text = ChatUIController.GetChannelSelectorName(selector); - var prefix = ChatUIController.GetChannelSelectorPrefix(selector); + var prefix = ChatUIController.ChannelPrefixes[selector]; if (prefix != default) Text = Loc.GetString("hud-chatbox-select-name-prefixed", ("name", Text), ("prefix", prefix)); } }