From 5f531ec2ab96423afcae2e6c2ec2947db00f12de Mon Sep 17 00:00:00 2001 From: WhitlyOfficial Date: Tue, 20 Feb 2024 11:51:34 +0300 Subject: [PATCH] Uniq sponsor colors --- Content.Server/Chat/Managers/ChatManager.cs | 23 +++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Content.Server/Chat/Managers/ChatManager.cs b/Content.Server/Chat/Managers/ChatManager.cs index a4b30aca30c0..1025ad19c2e9 100644 --- a/Content.Server/Chat/Managers/ChatManager.cs +++ b/Content.Server/Chat/Managers/ChatManager.cs @@ -20,6 +20,8 @@ using Robust.Shared.Replays; using Robust.Shared.Timing; using Robust.Shared.Utility; +using Content.Shared.SS220.Discord; +using Content.Shared.SS220.Shlepovend; namespace Content.Server.Chat.Managers { @@ -36,6 +38,17 @@ internal sealed partial class ChatManager : IChatManager { "revolutionary", "#aa00ff" } }; + // ss220 sponsor-chat-colors start + private static readonly Dictionary BoostyOocColors = new() + { + { SponsorTier.Shlopa, "#ffdf9b" }, + { SponsorTier.BigShlopa, "#e9c067" }, + { SponsorTier.HugeShlopa, "#dbad4c" }, + { SponsorTier.GoldenShlopa, "#ffff00" }, + { SponsorTier.CriticalMassShlopa, "#8289f5" } + }; + // ss220 sponsor-chat-colors end + [Dependency] private readonly IReplayRecordingManager _replay = default!; [Dependency] private readonly IServerNetManager _netManager = default!; [Dependency] private readonly IMoMMILink _mommiLink = default!; @@ -241,9 +254,15 @@ private void SendOOC(ICommonSession player, string message) //SS220-shlepi begin var SponsorInfo = player.ContentData()?.SponsorInfo; - if (SponsorInfo is not null && SponsorInfo.Tiers.Any(x => x is not Shared.SS220.Discord.SponsorTier.None)) + if (SponsorInfo is not null && !_adminManager.HasAdminFlag(player, AdminFlags.Admin) && SponsorInfo.Tiers.Any(x => x is not Shared.SS220.Discord.SponsorTier.None)) { - wrappedMessage = Loc.GetString("chat-manager-send-ooc-patron-wrap-message", ("patronColor", "#ffe77a"), ("playerName", player.Name), ("message", FormattedMessage.EscapeText(message))); + wrappedMessage = Loc.GetString("chat-manager-send-ooc-patron-wrap-message", ("patronColor", BoostyOocColors[SponsorInfo.Tiers.Last()]), ("playerName", player.Name), ("message", FormattedMessage.EscapeText(message))); + switch (SponsorInfo.Tiers.Last()) // Add your own unique tiers using switch-case construction. CriticalMassShlopa as example. + { + case SponsorTier.CriticalMassShlopa: + wrappedMessage = Loc.GetString("chat-manager-send-ooc-patron-wrap-message", ("patronColor", BoostyOocColors[SponsorInfo.Tiers.Last()]), ("playerName", player.Name), ("message", FormattedMessage.EscapeText(message))); + break; + } } //SS220-shlepi end