From e2a227a23c4f7825b2d7781b894ef9497f3b1357 Mon Sep 17 00:00:00 2001 From: Shawrkie Williams Date: Thu, 25 Dec 2025 01:38:55 -0500 Subject: [PATCH] Add support for preview color --- AetherBags/Nodes/Color/ColorInputRow.cs | 5 +++++ .../Currency/CurrencyConfigurationNode.cs | 20 ++++++++++--------- .../Layout/CompactLookaheadNode.cs | 2 -- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/AetherBags/Nodes/Color/ColorInputRow.cs b/AetherBags/Nodes/Color/ColorInputRow.cs index 5263b08..6bc91d6 100644 --- a/AetherBags/Nodes/Color/ColorInputRow.cs +++ b/AetherBags/Nodes/Color/ColorInputRow.cs @@ -35,6 +35,11 @@ public class ColorInputRow : HorizontalListNode _initialColor = color; OnColorConfirmed?.Invoke(color); }; + _colorPickerAddon?.OnColorPreviewed = color => + { + _colorPreview?.Color = color; + OnColorChange?.Invoke(color); + }; _colorPickerAddon?.OnColorCancelled = () => OnColorCanceled?.Invoke(_initialColor); } }; diff --git a/AetherBags/Nodes/Configuration/Currency/CurrencyConfigurationNode.cs b/AetherBags/Nodes/Configuration/Currency/CurrencyConfigurationNode.cs index d3c4816..0d2814b 100644 --- a/AetherBags/Nodes/Configuration/Currency/CurrencyConfigurationNode.cs +++ b/AetherBags/Nodes/Configuration/Currency/CurrencyConfigurationNode.cs @@ -1,12 +1,8 @@ -using System.Drawing; using System.Numerics; using AetherBags.Configuration; using AetherBags.Nodes.Color; -using Dalamud.Interface; using KamiToolKit.Classes; using KamiToolKit.Nodes; -using KamiToolKit.Premade.Addons; -using KamiToolKit.Premade.Nodes; namespace AetherBags.Nodes.Configuration.Currency; @@ -49,11 +45,9 @@ public sealed class CurrencyConfigurationNode : TabbedVerticalListNode Size = new Vector2(300, 24), CurrentColor = config.DefaultColor, DefaultColor = new CurrencySettings().DefaultColor, - OnColorConfirmed = color => - { - config.DefaultColor = color; - RefreshCurrency(); - }, + OnColorConfirmed = ApplyColorChange, + OnColorChange = ApplyColorChange, + OnColorCanceled = ApplyColorChange, }; AddNode(defaultCurrencyColorNode); @@ -120,6 +114,14 @@ public sealed class CurrencyConfigurationNode : TabbedVerticalListNode }, }; AddNode(limitCurrencyColorNode); + + return; + + void ApplyColorChange(Vector4 color) + { + config.DefaultColor = color; + RefreshCurrency(); + } } private void RefreshCurrency() => System.AddonInventoryWindow.ManualCurrencyRefresh(); diff --git a/AetherBags/Nodes/Configuration/Layout/CompactLookaheadNode.cs b/AetherBags/Nodes/Configuration/Layout/CompactLookaheadNode.cs index 7067cd2..50adb3d 100644 --- a/AetherBags/Nodes/Configuration/Layout/CompactLookaheadNode.cs +++ b/AetherBags/Nodes/Configuration/Layout/CompactLookaheadNode.cs @@ -1,6 +1,4 @@ using AetherBags.Configuration; -using FFXIVClientStructs.FFXIV.Component.GUI; -using KamiToolKit.Classes; using KamiToolKit.Classes.Timelines; using KamiToolKit.Nodes; using System.Numerics;