diff --git a/PlayerTags/Configuration/PluginConfigurationUI.cs b/PlayerTags/Configuration/PluginConfigurationUI.cs index eceea73..4b10c34 100644 --- a/PlayerTags/Configuration/PluginConfigurationUI.cs +++ b/PlayerTags/Configuration/PluginConfigurationUI.cs @@ -1202,7 +1202,7 @@ namespace PlayerTags.Configuration var entryName = Enum.GetName(typeofEnum, entry.Value); var tempval = entry.Enabled; - isClicked = ImGui.Checkbox(Localizer.GetString(entryName), ref isDisabled ? ref tempval : ref entry.Enabled); + isClicked = ImGui.Checkbox(Localizer.GetString(entryName, false), ref isDisabled ? ref tempval : ref entry.Enabled); if (ImGui.IsItemHovered()) ImGui.SetTooltip(Localizer.GetString(entryName, true)); diff --git a/PlayerTags/Localizer.cs b/PlayerTags/Localizer.cs index 41a3f72..fffc28d 100644 --- a/PlayerTags/Localizer.cs +++ b/PlayerTags/Localizer.cs @@ -2,14 +2,13 @@ using Dalamud.Plugin; using PlayerTags.Resources; using System; +using System.ComponentModel; using System.Globalization; namespace PlayerTags { public static class Localizer { - private static CultureInfo culture = null; - public static void SetLanguage(string langCode) { SetLanguage(new CultureInfo(langCode)); @@ -17,7 +16,7 @@ namespace PlayerTags public static void SetLanguage(CultureInfo cultureInfo) { - culture = cultureInfo; + Strings.Culture = cultureInfo; } public static string GetName(TEnum value) @@ -51,11 +50,10 @@ namespace PlayerTags public static string GetString(string localizedStringId) { - string? value = Strings.ResourceManager.GetString(localizedStringId, culture ?? Strings.Culture); + string? value = Strings.ResourceManager.GetString(localizedStringId, Strings.Culture); + if (value != null) - { return value; - } PluginLog.Error($"Failed to get localized string for id {localizedStringId}"); return localizedStringId; diff --git a/PlayerTags/Plugin.cs b/PlayerTags/Plugin.cs index a1d6d1a..2fc7d8c 100644 --- a/PlayerTags/Plugin.cs +++ b/PlayerTags/Plugin.cs @@ -40,10 +40,10 @@ namespace PlayerTags PluginServices.DalamudPluginInterface.UiBuilder.Draw += UiBuilder_Draw; PluginServices.DalamudPluginInterface.UiBuilder.OpenConfigUi += UiBuilder_OpenConfigUi; - PluginServices.CommandManager.AddHandler(c_CommandName, new CommandInfo((string command, string arguments) => + PluginServices.CommandManager.AddHandler(c_CommandName, new CommandInfo((string command, string arguments) => UiBuilder_OpenConfigUi()) { - UiBuilder_OpenConfigUi(); - }) { HelpMessage = "Shows the config" }); + HelpMessage = Resources.Strings.Loc_Command_playertags + }); m_CustomTagsContextMenuFeature = new CustomTagsContextMenuFeature(m_PluginConfiguration, m_PluginData); m_NameplatesTagTargetFeature = new NameplateTagTargetFeature(m_PluginConfiguration, m_PluginData); m_ChatTagTargetFeature = new ChatTagTargetFeature(m_PluginConfiguration, m_PluginData); @@ -68,9 +68,7 @@ namespace PlayerTags private void UiBuilder_Draw() { if (m_PluginConfiguration.IsVisible) - { m_PluginConfigurationUI.Draw(); - } } private void UiBuilder_OpenConfigUi() diff --git a/PlayerTags/Resources/Strings.Designer.cs b/PlayerTags/Resources/Strings.Designer.cs index d14322a..907febf 100644 --- a/PlayerTags/Resources/Strings.Designer.cs +++ b/PlayerTags/Resources/Strings.Designer.cs @@ -186,6 +186,15 @@ namespace PlayerTags.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Shows the config window for Player Tags ähnelt. + /// + public static string Loc_Command_playertags { + get { + return ResourceManager.GetString("Loc_Command_playertags", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Custom id ähnelt. /// diff --git a/PlayerTags/Resources/Strings.resx b/PlayerTags/Resources/Strings.resx index 0850b13..96deaf9 100644 --- a/PlayerTags/Resources/Strings.resx +++ b/PlayerTags/Resources/Strings.resx @@ -829,4 +829,7 @@ Use this if you want to to have every option under your control or just want to 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. + + Shows the config window for Player Tags + \ No newline at end of file