From 410fecb72fde86761f5db8229523bc4b1e30e0de Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Sun, 28 Feb 2021 18:51:42 +0100 Subject: [PATCH] Give patrons colored OOC names. --- Content.Server/Chat/ChatManager.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Content.Server/Chat/ChatManager.cs b/Content.Server/Chat/ChatManager.cs index 0787dee570..b1781841b0 100644 --- a/Content.Server/Chat/ChatManager.cs +++ b/Content.Server/Chat/ChatManager.cs @@ -32,6 +32,14 @@ namespace Content.Server.Chat /// internal sealed class ChatManager : IChatManager { + private static readonly Dictionary PatronOocColors = new() + { + // I had plans for multiple colors and those went nowhere so... + { "nuclear_operative", "#aa00ff" }, + { "syndicate_agent", "#aa00ff" }, + { "revolutionary", "#aa00ff" } + }; + [Dependency] private readonly IServerNetManager _netManager = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IMoMMILink _mommiLink = default!; @@ -246,6 +254,12 @@ namespace Content.Server.Chat var prefs = _preferencesManager.GetPreferences(player.UserId); msg.MessageColorOverride = prefs.AdminOOCColor; } + if (player.ConnectedClient.UserData.PatronTier is { } patron && + PatronOocColors.TryGetValue(patron, out var patronColor)) + { + msg.MessageWrap = $"OOC: [color={patronColor}]{player.Name}[/color]: {{0}}"; + } + //TODO: player.Name color, this will need to change the structure of the MsgChatMessage _netManager.ServerSendToAll(msg);