* Made HSV default for character editor * Adds/fixes comments to HSV defaulting * Added dropbox fix, potentially cursed * Revert "Added dropbox fix, potentially cursed" This reverts commit a709883366fbee813e839742125e70844672af29. --------- Co-authored-by: TrixxedHeart <46364955+TrixxedBit@users.noreply.github.com>
42 lines
1001 B
C#
42 lines
1001 B
C#
using Robust.Client.UserInterface;
|
|
using Robust.Client.UserInterface.Controls;
|
|
|
|
namespace Content.Client.Humanoid;
|
|
|
|
public sealed class EyeColorPicker : Control
|
|
{
|
|
public event Action<Color>? OnEyeColorPicked;
|
|
|
|
private readonly ColorSelectorSliders _colorSelectors;
|
|
|
|
private Color _lastColor;
|
|
|
|
public void SetData(Color color)
|
|
{
|
|
_lastColor = color;
|
|
|
|
_colorSelectors.Color = color;
|
|
}
|
|
|
|
public EyeColorPicker()
|
|
{
|
|
var vBox = new BoxContainer
|
|
{
|
|
Orientation = BoxContainer.LayoutOrientation.Vertical
|
|
};
|
|
AddChild(vBox);
|
|
|
|
vBox.AddChild(_colorSelectors = new ColorSelectorSliders());
|
|
_colorSelectors.SelectorType = ColorSelectorSliders.ColorSelectorType.Hsv; // defaults color selector to HSV
|
|
|
|
_colorSelectors.OnColorChanged += ColorValueChanged;
|
|
}
|
|
|
|
private void ColorValueChanged(Color newColor)
|
|
{
|
|
OnEyeColorPicked?.Invoke(newColor);
|
|
|
|
_lastColor = newColor;
|
|
}
|
|
}
|