From 1cce0f2fa2c39bb303d5c8b43ea7f7ff715ff2d1 Mon Sep 17 00:00:00 2001 From: r00telement <47005506+r00telement@users.noreply.github.com> Date: Sun, 12 Dec 2021 08:36:34 +0000 Subject: [PATCH] UI and string tweaks --- .../Configuration/PluginConfigurationUI.cs | 18 -------- PlayerTags/Data/Tag.cs | 44 +++++++++--------- PlayerTags/Resources/Strings.Designer.cs | 46 +++++++++++++------ PlayerTags/Resources/Strings.resx | 26 +++++++---- 4 files changed, 70 insertions(+), 64 deletions(-) diff --git a/PlayerTags/Configuration/PluginConfigurationUI.cs b/PlayerTags/Configuration/PluginConfigurationUI.cs index 1e0d878..37377e1 100644 --- a/PlayerTags/Configuration/PluginConfigurationUI.cs +++ b/PlayerTags/Configuration/PluginConfigurationUI.cs @@ -55,27 +55,21 @@ namespace PlayerTags.Configuration { ImGui.Spacing(); ImGui.Spacing(); - ImGui.TreePush(); DrawCheckbox(nameof(m_PluginConfiguration.IsCustomTagsContextMenuEnabled), true, ref m_PluginConfiguration.IsCustomTagsContextMenuEnabled, () => m_PluginConfiguration.Save(m_PluginData)); - ImGui.TreePop(); ImGui.Spacing(); ImGui.Spacing(); DrawHeading(Strings.Loc_Static_Nameplates); - ImGui.TreePush(); DrawComboBox(true, true, false, ref m_PluginConfiguration.NameplateFreeCompanyVisibility, () => m_PluginConfiguration.Save(m_PluginData)); DrawComboBox(true, true, false, ref m_PluginConfiguration.NameplateTitleVisibility, () => m_PluginConfiguration.Save(m_PluginData)); DrawComboBox(true, true, false, ref m_PluginConfiguration.NameplateTitlePosition, () => m_PluginConfiguration.Save(m_PluginData)); - ImGui.TreePop(); ImGui.Spacing(); ImGui.Spacing(); DrawHeading(Strings.Loc_Static_Development); - ImGui.TreePush(); DrawCheckbox(nameof(m_PluginConfiguration.IsPlayerNameRandomlyGenerated), true, ref m_PluginConfiguration.IsPlayerNameRandomlyGenerated, () => m_PluginConfiguration.Save(m_PluginData)); - ImGui.TreePop(); ImGui.EndTabItem(); } @@ -84,7 +78,6 @@ namespace PlayerTags.Configuration { ImGui.Spacing(); ImGui.Spacing(); - ImGui.TreePush(); DrawCheckbox(nameof(m_PluginConfiguration.IsShowInheritedPropertiesEnabled), true, ref m_PluginConfiguration.IsShowInheritedPropertiesEnabled, () => m_PluginConfiguration.Save(m_PluginData)); ImGui.BeginGroup(); ImGui.Columns(2); @@ -103,7 +96,6 @@ namespace PlayerTags.Configuration } ImGui.EndGroup(); - ImGui.TreePop(); ImGui.Columns(1); ImGui.EndTabItem(); @@ -113,7 +105,6 @@ namespace PlayerTags.Configuration { ImGui.Spacing(); ImGui.Spacing(); - ImGui.TreePush(); DrawCheckbox(nameof(m_PluginConfiguration.IsPlayersTabOrderedByProximity), true, ref m_PluginConfiguration.IsPlayersTabOrderedByProximity, () => m_PluginConfiguration.Save(m_PluginData)); DrawCheckbox(nameof(m_PluginConfiguration.IsPlayersTabSelfVisible), true, ref m_PluginConfiguration.IsPlayersTabSelfVisible, () => m_PluginConfiguration.Save(m_PluginData)); DrawCheckbox(nameof(m_PluginConfiguration.IsPlayersTabFriendsVisible), true, ref m_PluginConfiguration.IsPlayersTabFriendsVisible, () => m_PluginConfiguration.Save(m_PluginData)); @@ -187,7 +178,6 @@ namespace PlayerTags.Configuration ImGui.EndTable(); } - ImGui.TreePop(); ImGui.EndTabItem(); } @@ -196,7 +186,6 @@ namespace PlayerTags.Configuration { ImGui.Spacing(); ImGui.Spacing(); - ImGui.TreePush(); if (ImGui.BeginTable("##TaggedPlayersTable", 1 + m_PluginData.CustomTags.Count)) { ImGui.TableHeader(Strings.Loc_Static_PlayerName); @@ -224,7 +213,6 @@ namespace PlayerTags.Configuration ImGui.EndTable(); } - ImGui.TreePop(); ImGui.EndTabItem(); } @@ -467,7 +455,6 @@ namespace PlayerTags.Configuration public void DrawControls(Tag tag) { ImGui.PushID(tag.GetHashCode().ToString()); - //ImGui.TreePush(); // Render the add property override button and popup if (ImGui.IsPopupOpen("AddPopup")) @@ -536,7 +523,6 @@ namespace PlayerTags.Configuration DrawHeading(Localizer.GetString(inheritableGroup.Key, false)); } - ImGui.TreePush(); foreach (var selectedInheritable in inheritableGroup) { bool isSelected = false; @@ -563,7 +549,6 @@ namespace PlayerTags.Configuration ImGui.SetTooltip(Localizer.GetString(selectedInheritable.Inheritable.Key, true)); } } - ImGui.TreePop(); } ImGui.EndListBox(); @@ -623,7 +608,6 @@ namespace PlayerTags.Configuration DrawHeading(Localizer.GetString(inheritableGroup.Key, false)); } - ImGui.TreePush(); foreach (var selectedInheritable in inheritableGroup) { if (selectedInheritable.Inheritable.Value is InheritableValue inheritableBool) @@ -655,11 +639,9 @@ namespace PlayerTags.Configuration PluginLog.Warning($"Rendering for inheritable option not implemented: {selectedInheritable.Inheritable.Key}"); } } - ImGui.TreePop(); } - //ImGui.TreePop(); ImGui.PopID(); } diff --git a/PlayerTags/Data/Tag.cs b/PlayerTags/Data/Tag.cs index 5843610..538091a 100644 --- a/PlayerTags/Data/Tag.cs +++ b/PlayerTags/Data/Tag.cs @@ -84,54 +84,54 @@ namespace PlayerTags.Data public InheritableValue IsSelected = new InheritableValue(false); public InheritableValue IsExpanded = new InheritableValue(false); - [InheritableCategory("General")] + [InheritableCategory("GeneralCategory")] public InheritableReference GameObjectNamesToApplyTo = new InheritableReference(""); - [InheritableCategory("Icon")] + [InheritableCategory("IconCategory")] public InheritableValue Icon = new InheritableValue(BitmapFontIcon.Aethernet); - [InheritableCategory("Icon")] + [InheritableCategory("IconCategory")] public InheritableValue IsIconVisibleInChat = new InheritableValue(false); - [InheritableCategory("Icon")] + [InheritableCategory("IconCategory")] public InheritableValue IsIconVisibleInNameplates = new InheritableValue(false); - [InheritableCategory("Text")] + [InheritableCategory("TextCategory")] public InheritableReference Text = new InheritableReference(""); - [InheritableCategory("Text")] + [InheritableCategory("TextCategory")] public InheritableValue TextColor = new InheritableValue(6); - [InheritableCategory("Text")] + [InheritableCategory("TextCategory")] public InheritableValue TextGlowColor = new InheritableValue(6); - [InheritableCategory("Text")] + [InheritableCategory("TextCategory")] public InheritableValue IsTextItalic = new InheritableValue(false); - [InheritableCategory("Text")] + [InheritableCategory("TextCategory")] public InheritableValue IsTextVisibleInChat = new InheritableValue(false); - [InheritableCategory("Text")] + [InheritableCategory("TextCategory")] public InheritableValue IsTextVisibleInNameplates = new InheritableValue(false); - [InheritableCategory("Position")] + [InheritableCategory("PositionCategory")] public InheritableValue TagPositionInChat = new InheritableValue(TagPosition.Before); - [InheritableCategory("Position")] + [InheritableCategory("PositionCategory")] public InheritableValue TagPositionInNameplates = new InheritableValue(TagPosition.Before); - [InheritableCategory("Position")] + [InheritableCategory("PositionCategory")] public InheritableValue TagTargetInNameplates = new InheritableValue(NameplateElement.Name); - [InheritableCategory("ActivityVisibility")] + [InheritableCategory("ActivityCategory")] public InheritableValue IsVisibleInPveDuties = new InheritableValue(false); - [InheritableCategory("ActivityVisibility")] + [InheritableCategory("ActivityCategory")] public InheritableValue IsVisibleInPvpDuties = new InheritableValue(false); - [InheritableCategory("ActivityVisibility")] + [InheritableCategory("ActivityCategory")] public InheritableValue IsVisibleInOverworld = new InheritableValue(false); - [InheritableCategory("PlayerVisibility")] + [InheritableCategory("PlayerCategory")] public InheritableValue IsVisibleForSelf = new InheritableValue(false); - [InheritableCategory("PlayerVisibility")] + [InheritableCategory("PlayerCategory")] public InheritableValue IsVisibleForFriendPlayers = new InheritableValue(false); - [InheritableCategory("PlayerVisibility")] + [InheritableCategory("PlayerCategory")] public InheritableValue IsVisibleForPartyPlayers = new InheritableValue(false); - [InheritableCategory("PlayerVisibility")] + [InheritableCategory("PlayerCategory")] public InheritableValue IsVisibleForAlliancePlayers = new InheritableValue(false); - [InheritableCategory("PlayerVisibility")] + [InheritableCategory("PlayerCategory")] public InheritableValue IsVisibleForEnemyPlayers = new InheritableValue(false); - [InheritableCategory("PlayerVisibility")] + [InheritableCategory("PlayerCategory")] public InheritableValue IsVisibleForOtherPlayers = new InheritableValue(false); public string[] SplitGameObjectNamesToApplyTo diff --git a/PlayerTags/Resources/Strings.Designer.cs b/PlayerTags/Resources/Strings.Designer.cs index 8fbcfcf..9d50aa4 100644 --- a/PlayerTags/Resources/Strings.Designer.cs +++ b/PlayerTags/Resources/Strings.Designer.cs @@ -61,11 +61,11 @@ namespace PlayerTags.Resources { } /// - /// Looks up a localized string similar to Activities. + /// Looks up a localized string similar to Activity properties. /// - public static string Loc_ActivityVisibility { + public static string Loc_ActivityCategory { get { - return ResourceManager.GetString("Loc_ActivityVisibility", resourceCulture); + return ResourceManager.GetString("Loc_ActivityCategory", resourceCulture); } } @@ -124,11 +124,11 @@ namespace PlayerTags.Resources { } /// - /// Looks up a localized string similar to General. + /// Looks up a localized string similar to General properties. /// - public static string Loc_General { + public static string Loc_GeneralCategory { get { - return ResourceManager.GetString("Loc_General", resourceCulture); + return ResourceManager.GetString("Loc_GeneralCategory", resourceCulture); } } @@ -150,6 +150,15 @@ namespace PlayerTags.Resources { } } + /// + /// Looks up a localized string similar to Icon properties. + /// + public static string Loc_IconCategory { + get { + return ResourceManager.GetString("Loc_IconCategory", resourceCulture); + } + } + /// /// Looks up a localized string similar to Context menu integration. /// @@ -394,7 +403,7 @@ namespace PlayerTags.Resources { } /// - /// Looks up a localized string similar to Inherited properties from parent tags will be shown in the property override editor.. + /// Looks up a localized string similar to Properties inherited from parent nodes will be shown in the editor.. /// public static string Loc_IsShowInheritedPropertiesEnabled_Description { get { @@ -403,7 +412,7 @@ namespace PlayerTags.Resources { } /// - /// Looks up a localized string similar to Text italic. + /// Looks up a localized string similar to Italic. /// public static string Loc_IsTextItalic { get { @@ -862,20 +871,20 @@ namespace PlayerTags.Resources { } /// - /// Looks up a localized string similar to Players. + /// Looks up a localized string similar to Player properties. /// - public static string Loc_PlayerVisibility { + public static string Loc_PlayerCategory { get { - return ResourceManager.GetString("Loc_PlayerVisibility", resourceCulture); + return ResourceManager.GetString("Loc_PlayerCategory", resourceCulture); } } /// - /// Looks up a localized string similar to Position. + /// Looks up a localized string similar to Position properties. /// - public static string Loc_Position { + public static string Loc_PositionCategory { get { - return ResourceManager.GetString("Loc_Position", resourceCulture); + return ResourceManager.GetString("Loc_PositionCategory", resourceCulture); } } @@ -1203,6 +1212,15 @@ namespace PlayerTags.Resources { } } + /// + /// Looks up a localized string similar to Text properties. + /// + public static string Loc_TextCategory { + get { + return ResourceManager.GetString("Loc_TextCategory", resourceCulture); + } + } + /// /// Looks up a localized string similar to Color. /// diff --git a/PlayerTags/Resources/Strings.resx b/PlayerTags/Resources/Strings.resx index d0be71d..7a0aacf 100644 --- a/PlayerTags/Resources/Strings.resx +++ b/PlayerTags/Resources/Strings.resx @@ -166,7 +166,7 @@ Show inherited properties - Inherited properties from parent tags will be shown in the property override editor. + Properties inherited from parent nodes will be shown in the editor. Free company visibility @@ -341,7 +341,7 @@ The glow color of the text. - Text italic + Italic Whether the text will be italic. @@ -408,17 +408,23 @@ Enabled - - Position + + General properties - - General + + Icon properties - - Activities + + Text properties - - Players + + Position properties + + + Activity properties + + + Player properties