From 20543e0fb1bbfdc551bca3a8458fb9df1f23b3b0 Mon Sep 17 00:00:00 2001 From: r00telement <47005506+r00telement@users.noreply.github.com> Date: Sat, 8 Jan 2022 19:20:21 +0000 Subject: [PATCH] Added option to apply tags to ALL chat messages --- .../Configuration/PluginConfiguration.cs | 1 + .../Configuration/PluginConfigurationUI.cs | 1 + PlayerTags/Features/ChatTagTargetFeature.cs | 2 +- PlayerTags/Resources/Strings.Designer.cs | 20 ++++++++++++++++++- PlayerTags/Resources/Strings.resx | 6 ++++++ 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/PlayerTags/Configuration/PluginConfiguration.cs b/PlayerTags/Configuration/PluginConfiguration.cs index 38587d6..ac0998c 100644 --- a/PlayerTags/Configuration/PluginConfiguration.cs +++ b/PlayerTags/Configuration/PluginConfiguration.cs @@ -28,6 +28,7 @@ namespace PlayerTags.Configuration public bool IsPlayersTabEnemiesVisible = true; public bool IsPlayersTabOthersVisible = false; public bool IsLinkSelfInChatEnabled = false; + public bool IsApplyTagsToAllChatMessagesEnabled = true; [JsonProperty(TypeNameHandling = TypeNameHandling.None, ItemTypeNameHandling = TypeNameHandling.None)] public Dictionary AllTagsChanges = new Dictionary(); diff --git a/PlayerTags/Configuration/PluginConfigurationUI.cs b/PlayerTags/Configuration/PluginConfigurationUI.cs index 14ff115..b051b2c 100644 --- a/PlayerTags/Configuration/PluginConfigurationUI.cs +++ b/PlayerTags/Configuration/PluginConfigurationUI.cs @@ -71,6 +71,7 @@ namespace PlayerTags.Configuration DrawHeading(Strings.Loc_Static_Experimental); DrawCheckbox(nameof(m_PluginConfiguration.IsPlayerNameRandomlyGenerated), true, ref m_PluginConfiguration.IsPlayerNameRandomlyGenerated, () => m_PluginConfiguration.Save(m_PluginData)); DrawCheckbox(nameof(m_PluginConfiguration.IsLinkSelfInChatEnabled), true, ref m_PluginConfiguration.IsLinkSelfInChatEnabled, () => m_PluginConfiguration.Save(m_PluginData)); + DrawCheckbox(nameof(m_PluginConfiguration.IsApplyTagsToAllChatMessagesEnabled), true, ref m_PluginConfiguration.IsApplyTagsToAllChatMessagesEnabled, () => m_PluginConfiguration.Save(m_PluginData)); ImGui.EndTabItem(); } diff --git a/PlayerTags/Features/ChatTagTargetFeature.cs b/PlayerTags/Features/ChatTagTargetFeature.cs index 06a0266..116099c 100644 --- a/PlayerTags/Features/ChatTagTargetFeature.cs +++ b/PlayerTags/Features/ChatTagTargetFeature.cs @@ -103,7 +103,7 @@ namespace PlayerTags.Features private void Chat_ChatMessage(XivChatType type, uint senderId, ref SeString sender, ref SeString message, ref bool isHandled) { - if (Enum.IsDefined(type)) + if (m_PluginConfiguration.IsApplyTagsToAllChatMessagesEnabled || Enum.IsDefined(type)) { AddTagsToChat(sender); AddTagsToChat(message); diff --git a/PlayerTags/Resources/Strings.Designer.cs b/PlayerTags/Resources/Strings.Designer.cs index cd9280d..8c1b4fb 100644 --- a/PlayerTags/Resources/Strings.Designer.cs +++ b/PlayerTags/Resources/Strings.Designer.cs @@ -186,6 +186,24 @@ namespace PlayerTags.Resources { } } + /// + /// Looks up a localized string similar to Apply tags to all chat messages. + /// + public static string Loc_IsApplyTagsToAllChatMessagesEnabled { + get { + return ResourceManager.GetString("Loc_IsApplyTagsToAllChatMessagesEnabled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Applies tags to all chat messages, including non-social messages and messages you may not be able to see.. + /// + public static string Loc_IsApplyTagsToAllChatMessagesEnabled_Description { + get { + return ResourceManager.GetString("Loc_IsApplyTagsToAllChatMessagesEnabled_Description", resourceCulture); + } + } + /// /// Looks up a localized string similar to Context menu integration. /// @@ -1267,7 +1285,7 @@ namespace PlayerTags.Resources { } /// - /// Looks up a localized string similar to This plugin can modify nameplates and chat. When combined with other plugins that modify these things, you are likely to see unexpected behavior.. + /// Looks up a localized string similar to This plugin can modify nameplates and chat. When combined with other plugins that modify these things, you are likely to see unexpected behavior. The load order of your plugins may make a difference.. /// public static string Loc_Static_WarningMessage { get { diff --git a/PlayerTags/Resources/Strings.resx b/PlayerTags/Resources/Strings.resx index 511d8d6..b9f9918 100644 --- a/PlayerTags/Resources/Strings.resx +++ b/PlayerTags/Resources/Strings.resx @@ -267,6 +267,12 @@ Attempts to link your chat name to your character, allowing tags to be applied to self in chat. + + Apply tags to all chat messages + + + Applies tags to all chat messages, including non-social messages, and messages you may not be able to see. + Reset this item to its defaults.