From 299c741bb6036e658959c5bd7fad792c7efada06 Mon Sep 17 00:00:00 2001 From: Pilzinsel64 Date: Sun, 25 Sep 2022 11:43:44 +0200 Subject: [PATCH] force custom tag color in chat for name --- PlayerTags/Features/ChatTagTargetFeature.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/PlayerTags/Features/ChatTagTargetFeature.cs b/PlayerTags/Features/ChatTagTargetFeature.cs index 53268b1..7dae7be 100644 --- a/PlayerTags/Features/ChatTagTargetFeature.cs +++ b/PlayerTags/Features/ChatTagTargetFeature.cs @@ -394,12 +394,6 @@ namespace PlayerTags.Features if (stringMatch.PlayerPayload != null && stringMatch.DisplayTextPayloads.Any()) { Identity identity = m_PluginData.GetIdentity(stringMatch.PlayerPayload); - foreach (var customTagId in identity.CustomTagIds) - { - var customTag = m_PluginData.CustomTags.FirstOrDefault(tag => tag.CustomId.Value == customTagId); - if (customTag != null) - applyTextFormatting(customTag); - } if (stringMatch.GameObject is PlayerCharacter playerCharacter1) { @@ -407,6 +401,13 @@ namespace PlayerTags.Features applyTextFormatting(jobTag); } + foreach (var customTagId in identity.CustomTagIds) + { + var customTag = m_PluginData.CustomTags.FirstOrDefault(tag => tag.CustomId.Value == customTagId); + if (customTag != null) + applyTextFormatting(customTag); + } + void applyTextFormatting(Tag tag) => ApplyTextFormatting(stringMatch.GameObject, tag, new[] { message }, new[] { tag.IsTextColorAppliedToChatName }, stringMatch.DisplayTextPayloads); }