| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- 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.OnColorChanged += ColorValueChanged;
- }
- private void ColorValueChanged(Color newColor)
- {
- OnEyeColorPicked?.Invoke(newColor);
- _lastColor = newColor;
- }
- }
|