diff --git a/Content.Client/Decals/UI/DecalPlacerWindow.xaml b/Content.Client/Decals/UI/DecalPlacerWindow.xaml
index d5baf345e8..a2f1c6be7b 100644
--- a/Content.Client/Decals/UI/DecalPlacerWindow.xaml
+++ b/Content.Client/Decals/UI/DecalPlacerWindow.xaml
@@ -11,7 +11,10 @@
-
+
+
+
+
diff --git a/Content.Client/Decals/UI/DecalPlacerWindow.xaml.cs b/Content.Client/Decals/UI/DecalPlacerWindow.xaml.cs
index 781f843b90..977f9bbe3b 100644
--- a/Content.Client/Decals/UI/DecalPlacerWindow.xaml.cs
+++ b/Content.Client/Decals/UI/DecalPlacerWindow.xaml.cs
@@ -1,4 +1,5 @@
-using Content.Client.Stylesheets;
+using System.Linq;
+using Content.Client.Stylesheets;
using Content.Shared.Decals;
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
@@ -19,6 +20,8 @@ public sealed partial class DecalPlacerWindow : DefaultWindow
public FloatSpinBox RotationSpinBox;
+ private PaletteColorPicker? _picker;
+
private Dictionary? _decals;
private string? _selected;
private Color _color = Color.White;
@@ -44,12 +47,34 @@ public sealed partial class DecalPlacerWindow : DefaultWindow
SpinBoxContainer.AddChild(RotationSpinBox);
Search.OnTextChanged += _ => RefreshList();
- ColorPicker.OnColorChanged += color =>
+ ColorPicker.OnColorChanged += OnColorPicked;
+
+ PickerOpen.OnPressed += _ =>
{
- _color = color;
- UpdateDecalPlacementInfo();
- RefreshList();
+ if (_picker is null)
+ {
+ _picker = new PaletteColorPicker();
+ _picker.OpenToLeft();
+ _picker.PaletteList.OnItemSelected += args =>
+ {
+ var color = (args.ItemList.GetSelected().First().Metadata as Color?)!.Value;
+ ColorPicker.Color = color;
+ OnColorPicked(color);
+ };
+ }
+ else
+ {
+ if (_picker.IsOpen)
+ {
+ _picker.Close();
+ }
+ else
+ {
+ _picker.Open();
+ }
+ }
};
+
RotationSpinBox.OnValueChanged += args =>
{
_rotation = args.Value;
@@ -77,6 +102,13 @@ public sealed partial class DecalPlacerWindow : DefaultWindow
Populate();
}
+ private void OnColorPicked(Color color)
+ {
+ _color = color;
+ UpdateDecalPlacementInfo();
+ RefreshList();
+ }
+
private void UpdateDecalPlacementInfo()
{
if (_selected is null)
diff --git a/Resources/Locale/en-US/decals/decal-window.ftl b/Resources/Locale/en-US/decals/decal-window.ftl
index eebe945402..2eb4ea050a 100644
--- a/Resources/Locale/en-US/decals/decal-window.ftl
+++ b/Resources/Locale/en-US/decals/decal-window.ftl
@@ -4,4 +4,5 @@ decal-placer-window-rotation = Rotation
decal-placer-window-zindex = Draw Depth
decal-placer-window-enable-snap = Snap To Tile
decal-placer-window-enable-cleanable = Cleanable
+decal-placer-window-palette = Palette
palette-color-picker-window-title = Palettes