diff --git a/PlayerTags/Features/ChatTagTargetFeature.cs b/PlayerTags/Features/ChatTagTargetFeature.cs index f328837..700200d 100644 --- a/PlayerTags/Features/ChatTagTargetFeature.cs +++ b/PlayerTags/Features/ChatTagTargetFeature.cs @@ -235,7 +235,9 @@ namespace PlayerTags.Features { if (customTag.TextColor.InheritedValue != null) { - if (customTag.IsTextColorAppliedToChatName.InheritedValue != null && customTag.IsTextColorAppliedToChatName.InheritedValue.Value) + if (message.Payloads.Any(payload => payload is TextPayload) + && customTag.IsTextColorAppliedToChatName.InheritedValue != null + && customTag.IsTextColorAppliedToChatName.InheritedValue.Value) { int payloadIndex = message.Payloads.IndexOf(stringMatch.PreferredPayload); message.Payloads.Insert(payloadIndex + 1, new UIForegroundPayload(0)); @@ -254,7 +256,9 @@ namespace PlayerTags.Features { if (jobTag.TextColor.InheritedValue != null) { - if (jobTag.IsTextColorAppliedToChatName.InheritedValue != null && jobTag.IsTextColorAppliedToChatName.InheritedValue.Value) + if (message.Payloads.Any(payload => payload is TextPayload) + && jobTag.IsTextColorAppliedToChatName.InheritedValue != null + && jobTag.IsTextColorAppliedToChatName.InheritedValue.Value) { int payloadIndex = message.Payloads.IndexOf(stringMatch.PreferredPayload); message.Payloads.Insert(payloadIndex + 1, new UIForegroundPayload(0)); diff --git a/PlayerTags/Features/NameplatesTagTargetFeature.cs b/PlayerTags/Features/NameplatesTagTargetFeature.cs index e5c8f10..204c7d7 100644 --- a/PlayerTags/Features/NameplatesTagTargetFeature.cs +++ b/PlayerTags/Features/NameplatesTagTargetFeature.cs @@ -256,21 +256,27 @@ namespace PlayerTags.Features { if (customTag.TextColor.InheritedValue != null) { - if (customTag.IsTextColorAppliedToNameplateName.InheritedValue != null && customTag.IsTextColorAppliedToNameplateName.InheritedValue.Value) + if (name.Payloads.Any(payload => payload is TextPayload) + && customTag.IsTextColorAppliedToNameplateName.InheritedValue != null + && customTag.IsTextColorAppliedToNameplateName.InheritedValue.Value) { name.Payloads.Insert(0, (new UIForegroundPayload(customTag.TextColor.InheritedValue.Value))); name.Payloads.Add(new UIForegroundPayload(0)); isNameChanged = true; } - if (customTag.IsTextColorAppliedToNameplateTitle.InheritedValue != null && customTag.IsTextColorAppliedToNameplateTitle.InheritedValue.Value) + if (title.Payloads.Any(payload => payload is TextPayload) + && customTag.IsTextColorAppliedToNameplateTitle.InheritedValue != null + && customTag.IsTextColorAppliedToNameplateTitle.InheritedValue.Value) { title.Payloads.Insert(0, (new UIForegroundPayload(customTag.TextColor.InheritedValue.Value))); title.Payloads.Add(new UIForegroundPayload(0)); isTitleChanged = true; } - if (customTag.IsTextColorAppliedToNameplateFreeCompany.InheritedValue != null && customTag.IsTextColorAppliedToNameplateFreeCompany.InheritedValue.Value) + if (freeCompany.Payloads.Any(payload => payload is TextPayload) + && customTag.IsTextColorAppliedToNameplateFreeCompany.InheritedValue != null + && customTag.IsTextColorAppliedToNameplateFreeCompany.InheritedValue.Value) { freeCompany.Payloads.Insert(0, (new UIForegroundPayload(customTag.TextColor.InheritedValue.Value))); freeCompany.Payloads.Add(new UIForegroundPayload(0)); @@ -289,21 +295,27 @@ namespace PlayerTags.Features { if (jobTag.TextColor.InheritedValue != null) { - if (jobTag.IsTextColorAppliedToNameplateName.InheritedValue != null && jobTag.IsTextColorAppliedToNameplateName.InheritedValue.Value) + if (name.Payloads.Any(payload => payload is TextPayload) + && jobTag.IsTextColorAppliedToNameplateName.InheritedValue != null + && jobTag.IsTextColorAppliedToNameplateName.InheritedValue.Value) { name.Payloads.Insert(0, (new UIForegroundPayload(jobTag.TextColor.InheritedValue.Value))); name.Payloads.Add(new UIForegroundPayload(0)); isNameChanged = true; } - if (jobTag.IsTextColorAppliedToNameplateTitle.InheritedValue != null && jobTag.IsTextColorAppliedToNameplateTitle.InheritedValue.Value) + if (title.Payloads.Any(payload => payload is TextPayload) + && jobTag.IsTextColorAppliedToNameplateTitle.InheritedValue != null + && jobTag.IsTextColorAppliedToNameplateTitle.InheritedValue.Value) { title.Payloads.Insert(0, (new UIForegroundPayload(jobTag.TextColor.InheritedValue.Value))); title.Payloads.Add(new UIForegroundPayload(0)); isTitleChanged = true; } - if (jobTag.IsTextColorAppliedToNameplateFreeCompany.InheritedValue != null && jobTag.IsTextColorAppliedToNameplateFreeCompany.InheritedValue.Value) + if (freeCompany.Payloads.Any(payload => payload is TextPayload) + && jobTag.IsTextColorAppliedToNameplateFreeCompany.InheritedValue != null + && jobTag.IsTextColorAppliedToNameplateFreeCompany.InheritedValue.Value) { freeCompany.Payloads.Insert(0, (new UIForegroundPayload(jobTag.TextColor.InheritedValue.Value))); freeCompany.Payloads.Add(new UIForegroundPayload(0)); diff --git a/PlayerTags/PlayerTags.csproj b/PlayerTags/PlayerTags.csproj index 611109e..2bc4433 100644 --- a/PlayerTags/PlayerTags.csproj +++ b/PlayerTags/PlayerTags.csproj @@ -1,7 +1,7 @@  r00telement - 1.1.5.0 + 1.1.5.1 diff --git a/PlayerTags/PlayerTags.json b/PlayerTags/PlayerTags.json index d30ce89..82397f5 100644 --- a/PlayerTags/PlayerTags.json +++ b/PlayerTags/PlayerTags.json @@ -10,5 +10,5 @@ "https://github.com/r00telement/PlayerTags/raw/main/PlayerTags/Resources/Promo/Nameplates_1.png", "https://github.com/r00telement/PlayerTags/raw/main/PlayerTags/Resources/Promo/Chat_1.png" ], - "Changelog": "- Added experimental option to apply tags to self in chat.\n- Added separate melee and ranged inheritance under dps.\n- Added separate magical and physical inheritance under ranged dps.\n- Added separate land and hand inheritance under land/land.\n- Added option to reset a selected item to its defaults." + "Changelog": "- Fix for nameplates sometimes disappearing when changing a player's title color when they have no title." } \ No newline at end of file