From 7c8ae6b87be6171c2247dae48be596191cf05086 Mon Sep 17 00:00:00 2001 From: Shawrkie Williams Date: Sat, 27 Dec 2025 07:55:58 -0500 Subject: [PATCH] Minor visual nitpick changes --- .../AddonCategoryConfigurationWindow.cs | 41 +++++++++++++++++-- AetherBags/Addons/AddonConfigurationWindow.cs | 2 - AetherBags/Nodes/Color/ColorInputRow.cs | 4 +- .../CategoryDefinitionConfigurationNode.cs | 32 +++++++++++---- .../Category/RarityEditorNode.cs | 6 ++- .../Category/StateFilterRowNode.cs | 6 ++- .../Category/StringListEditorNode.cs | 6 ++- .../Category/UintListEditorNode.cs | 7 +++- .../General/GeneralScrollingAreaNode.cs | 2 + .../Layout/CompactLookaheadNode.cs | 4 +- .../Layout/LayoutConfigurationNode.cs | 6 +-- AetherBags/Nodes/Input/LabeledDropdownNode.cs | 7 +++- 12 files changed, 94 insertions(+), 29 deletions(-) diff --git a/AetherBags/Addons/AddonCategoryConfigurationWindow.cs b/AetherBags/Addons/AddonCategoryConfigurationWindow.cs index 3f0ac09..b3cf4d8 100644 --- a/AetherBags/Addons/AddonCategoryConfigurationWindow.cs +++ b/AetherBags/Addons/AddonCategoryConfigurationWindow.cs @@ -21,6 +21,9 @@ public class AddonCategoryConfigurationWindow : NativeAddon private List _categoryWrappers = new(); + private bool _suppressSelectionListRefresh; + private bool _pendingSelectionListRefresh; + protected override unsafe void OnSetup(AtkUnitBase* addon) { _categoryWrappers = CreateCategoryWrappers(); @@ -79,11 +82,26 @@ public class AddonCategoryConfigurationWindow : NativeAddon { if (_configNode is null) return; - _configNode.IsVisible = newOption is not null; - if (_nothingSelectedTextNode is not null) - _nothingSelectedTextNode.IsVisible = newOption is null; + _suppressSelectionListRefresh = true; + try + { + _configNode.IsVisible = newOption is not null; - _configNode.ConfigurationOption = newOption; + if (_nothingSelectedTextNode is not null) + _nothingSelectedTextNode.IsVisible = newOption is null; + + _configNode.ConfigurationOption = newOption; + } + finally + { + _suppressSelectionListRefresh = false; + + if (_pendingSelectionListRefresh) + { + _pendingSelectionListRefresh = false; + _selectionListNode?.UpdateList(); + } + } } private void OnAddNewCategory(ModifyListNode listNode) @@ -99,6 +117,8 @@ public class AddonCategoryConfigurationWindow : NativeAddon var newWrapper = new CategoryWrapper(newCategory); _categoryWrappers.Add(newWrapper); listNode.AddOption(newWrapper); + + RefreshSelectionList(); } private void OnRemoveCategory(CategoryWrapper categoryWrapper) @@ -107,10 +127,23 @@ public class AddonCategoryConfigurationWindow : NativeAddon System.Config.Categories.UserCategories.Remove(categoryWrapper.CategoryDefinition); _categoryWrappers.Remove(categoryWrapper); + + RefreshSelectionList(); + + if (_configNode is not null && ReferenceEquals(_configNode.ConfigurationOption, categoryWrapper)) + { + OnOptionChanged(null); + } } private void RefreshSelectionList() { + if (_suppressSelectionListRefresh) + { + _pendingSelectionListRefresh = true; + return; + } + _selectionListNode?.UpdateList(); } } \ No newline at end of file diff --git a/AetherBags/Addons/AddonConfigurationWindow.cs b/AetherBags/Addons/AddonConfigurationWindow.cs index 228b4ed..85e6692 100644 --- a/AetherBags/Addons/AddonConfigurationWindow.cs +++ b/AetherBags/Addons/AddonConfigurationWindow.cs @@ -1,6 +1,4 @@ -using System; using System.Collections.Generic; -using AetherBags.Nodes.Configuration; using AetherBags.Nodes.Configuration.Category; using AetherBags.Nodes.Configuration.Currency; using AetherBags.Nodes.Configuration.General; diff --git a/AetherBags/Nodes/Color/ColorInputRow.cs b/AetherBags/Nodes/Color/ColorInputRow.cs index 6bc91d6..c8e4ae3 100644 --- a/AetherBags/Nodes/Color/ColorInputRow.cs +++ b/AetherBags/Nodes/Color/ColorInputRow.cs @@ -1,5 +1,6 @@ using System; using System.Numerics; +using FFXIVClientStructs.FFXIV.Component.GUI; using KamiToolKit.Nodes; using KamiToolKit.Premade.Addons; @@ -47,8 +48,9 @@ public class ColorInputRow : HorizontalListNode _labelTextNode = new LabelTextNode { + TextFlags = TextFlags.AutoAdjustNodeSize, Position = new Vector2(28, 0), - Size = Size with { Y = 24 }, + Height = 24, String = Label ?? string.Empty, }; _labelTextNode.AttachNode(this); diff --git a/AetherBags/Nodes/Configuration/Category/CategoryDefinitionConfigurationNode.cs b/AetherBags/Nodes/Configuration/Category/CategoryDefinitionConfigurationNode.cs index d5d261f..97d8255 100644 --- a/AetherBags/Nodes/Configuration/Category/CategoryDefinitionConfigurationNode.cs +++ b/AetherBags/Nodes/Configuration/Category/CategoryDefinitionConfigurationNode.cs @@ -3,6 +3,7 @@ using System.Numerics; using AetherBags.Configuration; using AetherBags.Nodes.Color; using Dalamud.Utility; +using FFXIVClientStructs.FFXIV.Component.GUI; using KamiToolKit.Classes; using KamiToolKit.Nodes; using Lumina.Excel; @@ -80,7 +81,12 @@ public sealed class CategoryDefinitionConfigurationNode : VerticalListNode }; AddNode(_enabledCheckbox); - AddNode(new LabelTextNode { Size = new Vector2(80, 20), String = "Name:" }); + AddNode(new LabelTextNode + { + TextFlags = TextFlags.AutoAdjustNodeSize, + Size = new Vector2(80, 20), + String = "Name:" + }); _nameInputNode = new TextInputNode { Size = new Vector2(250, 28), @@ -95,7 +101,12 @@ public sealed class CategoryDefinitionConfigurationNode : VerticalListNode }; AddNode(_nameInputNode); - AddNode(new LabelTextNode { Size = new Vector2(80, 20), String = "Description:" }); + AddNode(new LabelTextNode + { + TextFlags = TextFlags.AutoAdjustNodeSize, + Size = new Vector2(80, 20), + String = "Description:" + }); _descriptionInputNode = new TextInputNode { Size = new Vector2(250, 28), @@ -128,7 +139,12 @@ public sealed class CategoryDefinitionConfigurationNode : VerticalListNode }; AddNode(_colorInputNode); - AddNode(new LabelTextNode { Size = new Vector2(80, 20), String = "Priority:" }); + AddNode(new LabelTextNode + { + TextFlags = TextFlags.AutoAdjustNodeSize, + Size = new Vector2(80, 20), + String = "Priority:" + }); _priorityInputNode = new NumericInputNode { Size = new Vector2(120, 28), @@ -144,7 +160,7 @@ public sealed class CategoryDefinitionConfigurationNode : VerticalListNode }; AddNode(_priorityInputNode); - AddNode(new LabelTextNode { Size = new Vector2(80, 20), String = "Order:" }); + AddNode(new LabelTextNode { TextFlags = TextFlags.AutoAdjustNodeSize, Size = new Vector2(80, 20), String = "Order:" }); _orderInputNode = new NumericInputNode { Size = new Vector2(120, 28), @@ -334,9 +350,9 @@ public sealed class CategoryDefinitionConfigurationNode : VerticalListNode }; var rangeRow = new HorizontalListNode { Size = new Vector2(300, 28), ItemSpacing = 8.0f }; - rangeRow.AddNode(new LabelTextNode { Size = new Vector2(30, 28), String = "Min:" }); + rangeRow.AddNode(new LabelTextNode { TextFlags = TextFlags.AutoAdjustNodeSize, Size = new Vector2(30, 28), String = "Min:" }); rangeRow.AddNode(minNode); - rangeRow.AddNode(new LabelTextNode { Size = new Vector2(30, 28), String = "Max:" }); + rangeRow.AddNode(new LabelTextNode { TextFlags = TextFlags.AutoAdjustNodeSize, Size = new Vector2(30, 28), String = "Max:" }); rangeRow.AddNode(maxNode); AddNode(rangeRow); @@ -386,9 +402,9 @@ public sealed class CategoryDefinitionConfigurationNode : VerticalListNode }; var rangeRow = new HorizontalListNode { Size = new Vector2(300, 28), ItemSpacing = 8.0f }; - rangeRow.AddNode(new LabelTextNode { Size = new Vector2(30, 28), String = "Min:" }); + rangeRow.AddNode(new LabelTextNode { TextFlags = TextFlags.AutoAdjustNodeSize, Size = new Vector2(30, 28), String = "Min:" }); rangeRow.AddNode(minNode); - rangeRow.AddNode(new LabelTextNode { Size = new Vector2(30, 28), String = "Max:" }); + rangeRow.AddNode(new LabelTextNode { TextFlags = TextFlags.AutoAdjustNodeSize, Size = new Vector2(30, 28), String = "Max:" }); rangeRow.AddNode(maxNode); AddNode(rangeRow); diff --git a/AetherBags/Nodes/Configuration/Category/RarityEditorNode.cs b/AetherBags/Nodes/Configuration/Category/RarityEditorNode.cs index 3182704..c100034 100644 --- a/AetherBags/Nodes/Configuration/Category/RarityEditorNode.cs +++ b/AetherBags/Nodes/Configuration/Category/RarityEditorNode.cs @@ -1,8 +1,9 @@ +using FFXIVClientStructs.FFXIV.Component.GUI; +using KamiToolKit.Classes; +using KamiToolKit.Nodes; using System; using System.Collections.Generic; using System.Numerics; -using KamiToolKit.Classes; -using KamiToolKit.Nodes; namespace AetherBags.Nodes.Configuration.Category; @@ -24,6 +25,7 @@ public sealed class RarityEditorNode : VerticalListNode var headerLabel = new LabelTextNode { + TextFlags = TextFlags.AutoAdjustNodeSize, Size = new Vector2(280, 18), String = "Allowed Rarities:", TextColor = ColorHelper.GetColor(8), diff --git a/AetherBags/Nodes/Configuration/Category/StateFilterRowNode.cs b/AetherBags/Nodes/Configuration/Category/StateFilterRowNode.cs index f96a972..d11d251 100644 --- a/AetherBags/Nodes/Configuration/Category/StateFilterRowNode.cs +++ b/AetherBags/Nodes/Configuration/Category/StateFilterRowNode.cs @@ -1,8 +1,9 @@ -using System; -using System.Numerics; using AetherBags.Configuration; +using FFXIVClientStructs.FFXIV.Component.GUI; using KamiToolKit.Classes; using KamiToolKit.Nodes; +using System; +using System.Numerics; namespace AetherBags.Nodes.Configuration.Category; @@ -24,6 +25,7 @@ public sealed class StateFilterRowNode : HorizontalListNode _labelNode = new LabelTextNode { + TextFlags = TextFlags.AutoAdjustNodeSize, Size = new Vector2(100, 24), String = $"{label}:", TextColor = ColorHelper.GetColor(8), diff --git a/AetherBags/Nodes/Configuration/Category/StringListEditorNode.cs b/AetherBags/Nodes/Configuration/Category/StringListEditorNode.cs index e8378b2..2a22566 100644 --- a/AetherBags/Nodes/Configuration/Category/StringListEditorNode.cs +++ b/AetherBags/Nodes/Configuration/Category/StringListEditorNode.cs @@ -1,8 +1,9 @@ +using FFXIVClientStructs.FFXIV.Component.GUI; +using KamiToolKit.Classes; +using KamiToolKit.Nodes; using System; using System.Collections.Generic; using System.Numerics; -using KamiToolKit.Classes; -using KamiToolKit.Nodes; namespace AetherBags.Nodes.Configuration.Category; @@ -23,6 +24,7 @@ public sealed class StringListEditorNode : VerticalListNode var headerLabel = new LabelTextNode { + TextFlags = TextFlags.AutoAdjustNodeSize, Size = new Vector2(280, 18), String = label, TextColor = ColorHelper.GetColor(8), diff --git a/AetherBags/Nodes/Configuration/Category/UintListEditorNode.cs b/AetherBags/Nodes/Configuration/Category/UintListEditorNode.cs index 6aae6fb..93dbef1 100644 --- a/AetherBags/Nodes/Configuration/Category/UintListEditorNode.cs +++ b/AetherBags/Nodes/Configuration/Category/UintListEditorNode.cs @@ -1,8 +1,9 @@ +using FFXIVClientStructs.FFXIV.Component.GUI; +using KamiToolKit.Classes; +using KamiToolKit.Nodes; using System; using System.Collections.Generic; using System.Numerics; -using KamiToolKit.Classes; -using KamiToolKit.Nodes; namespace AetherBags.Nodes.Configuration.Category; @@ -25,6 +26,7 @@ public sealed class UintListEditorNode : VerticalListNode var headerLabel = new LabelTextNode { + TextFlags = TextFlags.AutoAdjustNodeSize, Size = new Vector2(280, 18), String = label, TextColor = ColorHelper.GetColor(8), @@ -117,6 +119,7 @@ public sealed class UintListItemNode : HorizontalListNode var displayText = labelResolver != null ? $"{value} - {labelResolver(value)}" : value.ToString(); var itemLabel = new LabelTextNode { + TextFlags = TextFlags.AutoAdjustNodeSize, Size = new Vector2(220, 22), String = displayText, TextColor = ColorHelper.GetColor(3), diff --git a/AetherBags/Nodes/Configuration/General/GeneralScrollingAreaNode.cs b/AetherBags/Nodes/Configuration/General/GeneralScrollingAreaNode.cs index f744cb6..0a52953 100644 --- a/AetherBags/Nodes/Configuration/General/GeneralScrollingAreaNode.cs +++ b/AetherBags/Nodes/Configuration/General/GeneralScrollingAreaNode.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Numerics; using AetherBags.Configuration; using AetherBags.Nodes.Configuration.Layout; +using FFXIVClientStructs.FFXIV.Component.GUI; using KamiToolKit.Nodes; namespace AetherBags.Nodes.Configuration.General; @@ -23,6 +24,7 @@ public sealed class GeneralScrollingAreaNode : ScrollingAreaNode diff --git a/AetherBags/Nodes/Configuration/Layout/CompactLookaheadNode.cs b/AetherBags/Nodes/Configuration/Layout/CompactLookaheadNode.cs index 50adb3d..b01c560 100644 --- a/AetherBags/Nodes/Configuration/Layout/CompactLookaheadNode.cs +++ b/AetherBags/Nodes/Configuration/Layout/CompactLookaheadNode.cs @@ -2,6 +2,7 @@ using KamiToolKit.Classes.Timelines; using KamiToolKit.Nodes; using System.Numerics; +using FFXIVClientStructs.FFXIV.Component.GUI; namespace AetherBags.Nodes.Configuration.Layout; @@ -16,7 +17,8 @@ internal sealed class CompactLookaheadNode : SimpleComponentNode TitleNode = new LabelTextNode { - Size = Size with { Y = 24 }, + TextFlags = TextFlags.AutoAdjustNodeSize, + Height = 24, String = "Compact Lookahead", }; TitleNode.AttachNode(this); diff --git a/AetherBags/Nodes/Configuration/Layout/LayoutConfigurationNode.cs b/AetherBags/Nodes/Configuration/Layout/LayoutConfigurationNode.cs index c33cf4a..c7d3e0e 100644 --- a/AetherBags/Nodes/Configuration/Layout/LayoutConfigurationNode.cs +++ b/AetherBags/Nodes/Configuration/Layout/LayoutConfigurationNode.cs @@ -15,12 +15,10 @@ internal class LayoutConfigurationNode : TabbedVerticalListNode { GeneralSettings config = System.Config.General; - var titleNode = new LabelTextNode + var titleNode = new CategoryTextNode { - Size = Size with { Y = 18 }, + Height = 18, String = "Layout Configuration", - TextColor = ColorHelper.GetColor(2), - TextOutlineColor = ColorHelper.GetColor(0), }; AddNode(titleNode); diff --git a/AetherBags/Nodes/Input/LabeledDropdownNode.cs b/AetherBags/Nodes/Input/LabeledDropdownNode.cs index c3e98e9..216eb58 100644 --- a/AetherBags/Nodes/Input/LabeledDropdownNode.cs +++ b/AetherBags/Nodes/Input/LabeledDropdownNode.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using FFXIVClientStructs.FFXIV.Component.GUI; -using KamiToolKit.Classes; using KamiToolKit.Nodes; namespace AetherBags.Nodes; @@ -60,4 +59,10 @@ public class LabeledDropdownNode : SimpleComponentNode { get => _dropDownNode.Options!; set => _dropDownNode.Options = value; } + + public TextFlags LabelTextFlags + { + get => _labelNode.TextFlags; + set => _labelNode.TextFlags = value; + } }