diff --git a/PlayerTags/Configuration/PluginConfigurationUI.cs b/PlayerTags/Configuration/PluginConfigurationUI.cs index 7c67cb8..7dfa20a 100644 --- a/PlayerTags/Configuration/PluginConfigurationUI.cs +++ b/PlayerTags/Configuration/PluginConfigurationUI.cs @@ -107,6 +107,11 @@ namespace PlayerTags.Configuration { ImGui.Spacing(); ImGui.Spacing(); + DrawComboBox(true, true, false, ref m_PluginConfiguration.DefaultPluginDataTemplate, () => + { + m_PluginData.ReloadDefault(); + SaveSettings(); + }, true, true); DrawCheckbox(nameof(m_PluginConfiguration.IsShowInheritedPropertiesEnabled), true, ref m_PluginConfiguration.IsShowInheritedPropertiesEnabled, () => SaveSettings()); ImGui.BeginGroup(); ImGui.Columns(2); @@ -272,7 +277,7 @@ namespace PlayerTags.Configuration m_PluginConfiguration.StatusIconPriorizerSettings.ResetToDefault(); SaveSettings(); } - else if (ImGui.IsItemHovered()) + if (ImGui.IsItemHovered()) ImGui.SetTooltip(Strings.Loc_StatusIconPriorizer_ResetToDefault_Description); ImGui.SameLine(); @@ -282,7 +287,7 @@ namespace PlayerTags.Configuration m_PluginConfiguration.StatusIconPriorizerSettings.ResetToEmpty(); SaveSettings(); } - else if (ImGui.IsItemHovered()) + if (ImGui.IsItemHovered()) ImGui.SetTooltip(Strings.Loc_StatusIconPriorizer_ResetToEmpty_Description); ImGui.Spacing(); @@ -294,9 +299,6 @@ namespace PlayerTags.Configuration { var conditionSet = m_PluginConfiguration.StatusIconPriorizerSettings.GetConditionSet(conditionSetName); - if (ImGui.IsItemHovered()) - ImGui.SetTooltip(Localizer.GetString(conditionSetName, true)); - foreach (var statusIcon in statusIcons) { var isChecked = conditionSet.Contains(statusIcon); @@ -314,6 +316,9 @@ namespace PlayerTags.Configuration } } + if (ImGui.IsItemHovered()) + ImGui.SetTooltip(Localizer.GetString(conditionSetName, true)); + ImGui.Spacing(); } } @@ -1207,12 +1212,14 @@ namespace PlayerTags.Configuration ImGui.PopStyleVar(); } - private void DrawComboBox(bool isLabelVisible, bool shouldLocalizeNames, bool shouldOrderNames, ref TEnum currentValue, System.Action changed) + private void DrawComboBox(bool isLabelVisible, bool shouldLocalizeNames, bool shouldOrderNames, ref TEnum currentValue, System.Action changed, bool showToolTipToLabel = false, bool showLabelInSameLine = false) where TEnum : Enum { if (isLabelVisible) { ImGui.Text(Localizer.GetString(false)); + if (showLabelInSameLine) + ImGui.SameLine(); } var currentDisplayName = shouldLocalizeNames ? Localizer.GetString(currentValue, false) : currentValue.ToString(); @@ -1253,7 +1260,10 @@ namespace PlayerTags.Configuration if (ImGui.IsItemHovered() && shouldLocalizeNames) { - ImGui.SetTooltip(Localizer.GetString(currentValue, true)); + if (showToolTipToLabel) + ImGui.SetTooltip(Localizer.GetString(typeof(TEnum).Name, true)); + else + ImGui.SetTooltip(Localizer.GetString(currentValue, true)); } } diff --git a/PlayerTags/Data/PluginData.cs b/PlayerTags/Data/PluginData.cs index fb45206..c8b5481 100644 --- a/PlayerTags/Data/PluginData.cs +++ b/PlayerTags/Data/PluginData.cs @@ -25,12 +25,16 @@ namespace PlayerTags.Data public List CustomTags; public List Identities; - private PluginConfiguration m_PluginConfiguration; + private PluginConfiguration pluginConfiguration; public PluginData(PluginConfiguration pluginConfiguration) { - m_PluginConfiguration = pluginConfiguration; + this.pluginConfiguration = pluginConfiguration; + ReloadDefault(); + } + public void ReloadDefault() + { Default = new DefaultPluginData(pluginConfiguration.DefaultPluginDataTemplate); // Set the default changes and saved changes @@ -261,7 +265,7 @@ namespace PlayerTags.Data if (identity.WorldId == null && worldId != null) { identity.WorldId = worldId; - m_PluginConfiguration.Save(this); + pluginConfiguration.Save(this); return identity; } diff --git a/PlayerTags/Resources/Strings.Designer.cs b/PlayerTags/Resources/Strings.Designer.cs index b09f035..b2f08bf 100644 --- a/PlayerTags/Resources/Strings.Designer.cs +++ b/PlayerTags/Resources/Strings.Designer.cs @@ -204,6 +204,104 @@ namespace PlayerTags.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Template ähnelt. + /// + public static string Loc_DefaultPluginDataTemplate { + get { + return ResourceManager.GetString("Loc_DefaultPluginDataTemplate", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Basic ähnelt. + /// + public static string Loc_DefaultPluginDataTemplate_Basic { + get { + return ResourceManager.GetString("Loc_DefaultPluginDataTemplate_Basic", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Same as Empty, but includes a very basic pre-confiuration for formatting and coloring. + ///Can also be used if you want to make your own cofiguration but want basic formatting. ähnelt. + /// + public static string Loc_DefaultPluginDataTemplate_Basic_Description { + get { + return ResourceManager.GetString("Loc_DefaultPluginDataTemplate_Basic_Description", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Here you can choose the template for all the settings below. + ///The template is used as basic set of properties. Every change you are making is what get saved. But all options from this template will not be saved. + ///This helpes you by not needing to overwrite so much properties - or by doing your completely own configuration without a template. + /// + ///Warning: + ///Changing this can cause properties to be resetted. You may loose a part of your configuration. + ///After you changed this, ensure everything is setted up how [Rest der Zeichenfolge wurde abgeschnitten]"; ähnelt. + /// + public static string Loc_DefaultPluginDataTemplate_Description { + get { + return ResourceManager.GetString("Loc_DefaultPluginDataTemplate_Description", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Full ähnelt. + /// + public static string Loc_DefaultPluginDataTemplate_Full { + get { + return ResourceManager.GetString("Loc_DefaultPluginDataTemplate_Full", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Show the job tag with color and also color the player name element. ähnelt. + /// + public static string Loc_DefaultPluginDataTemplate_Full_Description { + get { + return ResourceManager.GetString("Loc_DefaultPluginDataTemplate_Full_Description", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Empty ähnelt. + /// + public static string Loc_DefaultPluginDataTemplate_None { + get { + return ResourceManager.GetString("Loc_DefaultPluginDataTemplate_None", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die No single configuration made. This is an completley empty template. + ///Use this if you want to to have every option under your control or just want to make only a few configurations. ähnelt. + /// + public static string Loc_DefaultPluginDataTemplate_None_Description { + get { + return ResourceManager.GetString("Loc_DefaultPluginDataTemplate_None_Description", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Simple ähnelt. + /// + public static string Loc_DefaultPluginDataTemplate_Simple { + get { + return ResourceManager.GetString("Loc_DefaultPluginDataTemplate_Simple", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Shows the job tag with color and the role icon by replacing the title. ähnelt. + /// + public static string Loc_DefaultPluginDataTemplate_Simple_Description { + get { + return ResourceManager.GetString("Loc_DefaultPluginDataTemplate_Simple_Description", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Melee ähnelt. /// diff --git a/PlayerTags/Resources/Strings.resx b/PlayerTags/Resources/Strings.resx index 9fed405..6629cd8 100644 --- a/PlayerTags/Resources/Strings.resx +++ b/PlayerTags/Resources/Strings.resx @@ -754,4 +754,42 @@ When disabled, only the disconnected status icon is priorized. Viewing Cutscene + + Template + + + Basic + + + Same as Empty, but includes a very basic pre-confiuration for formatting and coloring. +Can also be used if you want to make your own cofiguration but want basic formatting. + + + Here you can choose the template for all the settings below. +The template is used as basic set of properties. Every change you are making is what get saved. But all options from this template will not be saved. +This helpes you by not needing to overwrite so much properties - or by doing your completely own configuration without a template. + +Warning: +Changing this can cause properties to be resetted. You may loose a part of your configuration. +After you changed this, ensure everything is setted up how you like it. + + + Full + + + Show the job tag with color and also color the player name element. + + + Empty + + + No single configuration made. This is an completley empty template. +Use this if you want to to have every option under your control or just want to make only a few configurations. + + + Simple + + + Shows the job tag with color and the role icon by replacing the title. + \ No newline at end of file