add option to also include undefined chat types
This commit is contained in:
@@ -151,6 +151,7 @@ namespace PlayerTags.Data
|
||||
TagTargetInNameplates = NameplateElement.Title,
|
||||
|
||||
TargetChatTypes = new List<XivChatType>(Enum.GetValues<XivChatType>()),
|
||||
TargetChatTypesIncludeUndefined = true,
|
||||
};
|
||||
|
||||
AllRoleTags = new Tag()
|
||||
@@ -258,6 +259,7 @@ namespace PlayerTags.Data
|
||||
IsVisibleForOtherPlayers = true,
|
||||
|
||||
TargetChatTypes = new List<XivChatType>(Enum.GetValues<XivChatType>()),
|
||||
TargetChatTypesIncludeUndefined = true,
|
||||
};
|
||||
|
||||
AllRoleTags = new Tag()
|
||||
@@ -372,6 +374,7 @@ namespace PlayerTags.Data
|
||||
IsVisibleForOtherPlayers = true,
|
||||
|
||||
TargetChatTypes = new List<XivChatType>(Enum.GetValues<XivChatType>()),
|
||||
TargetChatTypesIncludeUndefined = true,
|
||||
};
|
||||
|
||||
AllRoleTags = new Tag()
|
||||
|
||||
@@ -189,6 +189,8 @@ namespace PlayerTags.Data
|
||||
|
||||
[InheritableCategory("ChatFeatureCategory")]
|
||||
public InheritableReference<List<XivChatType>> TargetChatTypes = new(new List<XivChatType>(Enum.GetValues<XivChatType>()));
|
||||
[InheritableCategory("ChatFeatureCategory")]
|
||||
public InheritableValue<bool> TargetChatTypesIncludeUndefined = new(true);
|
||||
|
||||
[JsonIgnore]
|
||||
public string[] IdentitiesToAddTo
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
19
PlayerTags/Resources/Strings.Designer.cs
generated
19
PlayerTags/Resources/Strings.Designer.cs
generated
@@ -2075,6 +2075,25 @@ namespace PlayerTags.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Include undefined Chat Types ähnelt.
|
||||
/// </summary>
|
||||
public static string Loc_TargetChatTypesIncludeUndefined {
|
||||
get {
|
||||
return ResourceManager.GetString("Loc_TargetChatTypesIncludeUndefined", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// </summary>
|
||||
public static string Loc_TargetChatTypesIncludeUndefined_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Loc_TargetChatTypesIncludeUndefined_Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Text ähnelt.
|
||||
/// </summary>
|
||||
|
||||
@@ -822,4 +822,11 @@ Benutze dies, wenn du jede Option unter deiner Kontrolle haben möchtest oder nu
|
||||
<data name="Loc_IsRoleIconVisibleInChat" xml:space="preserve">
|
||||
<value>Rollensymbol im Chat anzeigen</value>
|
||||
</data>
|
||||
<data name="Loc_TargetChatTypesIncludeUndefined" xml:space="preserve">
|
||||
<value>Undefinierte Chattypen einbeziehen</value>
|
||||
</data>
|
||||
<data name="Loc_TargetChatTypesIncludeUndefined_Description" xml:space="preserve">
|
||||
<value>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.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -822,4 +822,11 @@ Use this if you want to to have every option under your control or just want to
|
||||
<data name="Loc_IsRoleIconVisibleInChat" xml:space="preserve">
|
||||
<value>Show role icon in Chat</value>
|
||||
</data>
|
||||
<data name="Loc_TargetChatTypesIncludeUndefined" xml:space="preserve">
|
||||
<value>Include undefined Chat Types</value>
|
||||
</data>
|
||||
<data name="Loc_TargetChatTypesIncludeUndefined_Description" xml:space="preserve">
|
||||
<value>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.</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user