Skip to content

Commit

Permalink
Uniq sponsor colors
Browse files Browse the repository at this point in the history
  • Loading branch information
WhitlyOfficial committed Feb 20, 2024
1 parent a81c35c commit 5f531ec
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions Content.Server/Chat/Managers/ChatManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -36,6 +38,17 @@ internal sealed partial class ChatManager : IChatManager
{ "revolutionary", "#aa00ff" }
};

// ss220 sponsor-chat-colors start
private static readonly Dictionary<SponsorTier, string> 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!;
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 5f531ec

Please sign in to comment.