diff --git a/PlayerTags/Data/DefaultPluginData.cs b/PlayerTags/Data/DefaultPluginData.cs index e7365ba..84bf440 100644 --- a/PlayerTags/Data/DefaultPluginData.cs +++ b/PlayerTags/Data/DefaultPluginData.cs @@ -151,6 +151,7 @@ namespace PlayerTags.Data TagTargetInNameplates = NameplateElement.Title, TargetChatTypes = new List(Enum.GetValues()), + TargetChatTypesIncludeUndefined = true, }; AllRoleTags = new Tag() @@ -258,6 +259,7 @@ namespace PlayerTags.Data IsVisibleForOtherPlayers = true, TargetChatTypes = new List(Enum.GetValues()), + TargetChatTypesIncludeUndefined = true, }; AllRoleTags = new Tag() @@ -372,6 +374,7 @@ namespace PlayerTags.Data IsVisibleForOtherPlayers = true, TargetChatTypes = new List(Enum.GetValues()), + TargetChatTypesIncludeUndefined = true, }; AllRoleTags = new Tag() diff --git a/PlayerTags/Data/Tag.cs b/PlayerTags/Data/Tag.cs index 1ff6dfa..1244c1c 100644 --- a/PlayerTags/Data/Tag.cs +++ b/PlayerTags/Data/Tag.cs @@ -189,6 +189,8 @@ namespace PlayerTags.Data [InheritableCategory("ChatFeatureCategory")] public InheritableReference> TargetChatTypes = new(new List(Enum.GetValues())); + [InheritableCategory("ChatFeatureCategory")] + public InheritableValue TargetChatTypesIncludeUndefined = new(true); [JsonIgnore] public string[] IdentitiesToAddTo diff --git a/PlayerTags/Features/ChatTagTargetFeature.cs b/PlayerTags/Features/ChatTagTargetFeature.cs index c6e4eb1..fe11e31 100644 --- a/PlayerTags/Features/ChatTagTargetFeature.cs +++ b/PlayerTags/Features/ChatTagTargetFeature.cs @@ -341,7 +341,8 @@ namespace PlayerTags.Features StringChanges stringChanges = new(); bool isTagEnabled(Tag tag) - => tag.TagPositionInChat.InheritedValue != null && tag.TargetChatTypes.InheritedValue != null && tag.TargetChatTypes.InheritedValue.Contains(chatType); + => tag.TagPositionInChat.InheritedValue != null && tag.TargetChatTypes.InheritedValue != null && + (tag.TargetChatTypes.InheritedValue.Contains(chatType) || (!Enum.IsDefined(chatType) && (tag.TargetChatTypesIncludeUndefined?.InheritedValue ?? false))); if (stringMatch.GameObject is PlayerCharacter playerCharacter) { diff --git a/PlayerTags/Resources/Strings.Designer.cs b/PlayerTags/Resources/Strings.Designer.cs index 86a721c..d14322a 100644 --- a/PlayerTags/Resources/Strings.Designer.cs +++ b/PlayerTags/Resources/Strings.Designer.cs @@ -2075,6 +2075,25 @@ namespace PlayerTags.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Include undefined Chat Types ähnelt. + /// + public static string Loc_TargetChatTypesIncludeUndefined { + get { + return ResourceManager.GetString("Loc_TargetChatTypesIncludeUndefined", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die When enabled the Tag will apply to all Chat messages that has not a defined type. + ///This case can happen either if the Game updates and the Enumeration of all Chat Types gets invalid due to shifted values, or plugins creates a custom chat type for whatever reason. ähnelt. + /// + public static string Loc_TargetChatTypesIncludeUndefined_Description { + get { + return ResourceManager.GetString("Loc_TargetChatTypesIncludeUndefined_Description", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Text ähnelt. /// diff --git a/PlayerTags/Resources/Strings.de.resx b/PlayerTags/Resources/Strings.de.resx index c5fa5fa..da21b3e 100644 --- a/PlayerTags/Resources/Strings.de.resx +++ b/PlayerTags/Resources/Strings.de.resx @@ -822,4 +822,11 @@ Benutze dies, wenn du jede Option unter deiner Kontrolle haben möchtest oder nu Rollensymbol im Chat anzeigen + + Undefinierte Chattypen einbeziehen + + + Wenn aktiviert, gilt das Tag für alle Chat-Nachrichten, die keinen definierten Typ haben. +Dieser Fall kann entweder auftreten, wenn das Spiel ein Update bekommt und die Aufzählung aller Chat-Typen aufgrund von geänderten Werten ungültig sind oder Plugins erstellt einen benutzerdefinierten Chat-Typ, aus welchen Gründen auch immer. + \ No newline at end of file diff --git a/PlayerTags/Resources/Strings.resx b/PlayerTags/Resources/Strings.resx index a100308..0850b13 100644 --- a/PlayerTags/Resources/Strings.resx +++ b/PlayerTags/Resources/Strings.resx @@ -822,4 +822,11 @@ Use this if you want to to have every option under your control or just want to Show role icon in Chat + + Include undefined Chat Types + + + When enabled the Tag will apply to all Chat messages that has not a defined type. +This case can happen either if the Game updates and the Enumeration of all Chat Types gets invalid due to shifted values, or plugins creates a custom chat type for whatever reason. + \ No newline at end of file