Add support for preview color
This commit is contained in:
@@ -35,6 +35,11 @@ public class ColorInputRow : HorizontalListNode
|
|||||||
_initialColor = color;
|
_initialColor = color;
|
||||||
OnColorConfirmed?.Invoke(color);
|
OnColorConfirmed?.Invoke(color);
|
||||||
};
|
};
|
||||||
|
_colorPickerAddon?.OnColorPreviewed = color =>
|
||||||
|
{
|
||||||
|
_colorPreview?.Color = color;
|
||||||
|
OnColorChange?.Invoke(color);
|
||||||
|
};
|
||||||
_colorPickerAddon?.OnColorCancelled = () => OnColorCanceled?.Invoke(_initialColor);
|
_colorPickerAddon?.OnColorCancelled = () => OnColorCanceled?.Invoke(_initialColor);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,12 +1,8 @@
|
|||||||
using System.Drawing;
|
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using AetherBags.Configuration;
|
using AetherBags.Configuration;
|
||||||
using AetherBags.Nodes.Color;
|
using AetherBags.Nodes.Color;
|
||||||
using Dalamud.Interface;
|
|
||||||
using KamiToolKit.Classes;
|
using KamiToolKit.Classes;
|
||||||
using KamiToolKit.Nodes;
|
using KamiToolKit.Nodes;
|
||||||
using KamiToolKit.Premade.Addons;
|
|
||||||
using KamiToolKit.Premade.Nodes;
|
|
||||||
|
|
||||||
namespace AetherBags.Nodes.Configuration.Currency;
|
namespace AetherBags.Nodes.Configuration.Currency;
|
||||||
|
|
||||||
@@ -49,11 +45,9 @@ public sealed class CurrencyConfigurationNode : TabbedVerticalListNode
|
|||||||
Size = new Vector2(300, 24),
|
Size = new Vector2(300, 24),
|
||||||
CurrentColor = config.DefaultColor,
|
CurrentColor = config.DefaultColor,
|
||||||
DefaultColor = new CurrencySettings().DefaultColor,
|
DefaultColor = new CurrencySettings().DefaultColor,
|
||||||
OnColorConfirmed = color =>
|
OnColorConfirmed = ApplyColorChange,
|
||||||
{
|
OnColorChange = ApplyColorChange,
|
||||||
config.DefaultColor = color;
|
OnColorCanceled = ApplyColorChange,
|
||||||
RefreshCurrency();
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
AddNode(defaultCurrencyColorNode);
|
AddNode(defaultCurrencyColorNode);
|
||||||
|
|
||||||
@@ -120,6 +114,14 @@ public sealed class CurrencyConfigurationNode : TabbedVerticalListNode
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
AddNode(limitCurrencyColorNode);
|
AddNode(limitCurrencyColorNode);
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
|
void ApplyColorChange(Vector4 color)
|
||||||
|
{
|
||||||
|
config.DefaultColor = color;
|
||||||
|
RefreshCurrency();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RefreshCurrency() => System.AddonInventoryWindow.ManualCurrencyRefresh();
|
private void RefreshCurrency() => System.AddonInventoryWindow.ManualCurrencyRefresh();
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using AetherBags.Configuration;
|
using AetherBags.Configuration;
|
||||||
using FFXIVClientStructs.FFXIV.Component.GUI;
|
|
||||||
using KamiToolKit.Classes;
|
|
||||||
using KamiToolKit.Classes.Timelines;
|
using KamiToolKit.Classes.Timelines;
|
||||||
using KamiToolKit.Nodes;
|
using KamiToolKit.Nodes;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
|||||||
Reference in New Issue
Block a user