Add support for preview color
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user