Merge branch 'dev/pie-lover'
This commit is contained in:
@@ -21,6 +21,9 @@ public class AddonCategoryConfigurationWindow : NativeAddon
|
||||
|
||||
private List<CategoryWrapper> _categoryWrappers = new();
|
||||
|
||||
private bool _suppressSelectionListRefresh;
|
||||
private bool _pendingSelectionListRefresh;
|
||||
|
||||
protected override unsafe void OnSetup(AtkUnitBase* addon)
|
||||
{
|
||||
_categoryWrappers = CreateCategoryWrappers();
|
||||
@@ -79,12 +82,27 @@ public class AddonCategoryConfigurationWindow : NativeAddon
|
||||
{
|
||||
if (_configNode is null) return;
|
||||
|
||||
_suppressSelectionListRefresh = true;
|
||||
try
|
||||
{
|
||||
_configNode.IsVisible = newOption is not null;
|
||||
|
||||
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<CategoryWrapper> 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();
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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<VerticalListNod
|
||||
Size = new Vector2(300, 20),
|
||||
IsEnabled = true,
|
||||
LabelText = "Stack Mode",
|
||||
LabelTextFlags = TextFlags.AutoAdjustNodeSize,
|
||||
Options = Enum.GetNames(typeof(InventoryStackMode)).ToList(),
|
||||
SelectedOption = config.StackMode.ToString(),
|
||||
OnOptionSelected = selected =>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user