diff --git a/src/Artemis.UI/Screens/SurfaceEditor/SurfaceEditorView.xaml b/src/Artemis.UI/Screens/SurfaceEditor/SurfaceEditorView.xaml
index 0101d01e4..f3e5f181c 100644
--- a/src/Artemis.UI/Screens/SurfaceEditor/SurfaceEditorView.xaml
+++ b/src/Artemis.UI/Screens/SurfaceEditor/SurfaceEditorView.xaml
@@ -209,6 +209,13 @@
ToolTip="If selected, each device is completely lid up with a random color">
Show random device colors
+
+ Light up first LED only
+
diff --git a/src/Artemis.UI/Screens/SurfaceEditor/SurfaceEditorViewModel.cs b/src/Artemis.UI/Screens/SurfaceEditor/SurfaceEditorViewModel.cs
index 306928fee..831640a64 100644
--- a/src/Artemis.UI/Screens/SurfaceEditor/SurfaceEditorViewModel.cs
+++ b/src/Artemis.UI/Screens/SurfaceEditor/SurfaceEditorViewModel.cs
@@ -92,7 +92,18 @@ namespace Artemis.UI.Screens.SurfaceEditor
public bool ColorDevices
{
get => _colorDevices;
- set => SetAndNotify(ref _colorDevices, value);
+ set
+ {
+ SetAndNotify(ref _colorDevices, value);
+ if (!value)
+ ColorFirstLedOnly = false;
+ }
+ }
+
+ public bool ColorFirstLedOnly
+ {
+ get => _colorFirstLedOnly;
+ set => SetAndNotify(ref _colorFirstLedOnly, value);
}
public void OpenHyperlink(object sender, RequestNavigateEventArgs e)
@@ -127,8 +138,16 @@ namespace Artemis.UI.Screens.SurfaceEditor
foreach (ListDeviceViewModel listDeviceViewModel in ListDeviceViewModels)
{
- foreach (ArtemisLed artemisLed in listDeviceViewModel.Device.Leds)
- e.Canvas.DrawRect(artemisLed.AbsoluteRectangle, new SKPaint {Color = listDeviceViewModel.Color});
+ // Order by position to accurately get the first LED
+ List leds = listDeviceViewModel.Device.Leds.OrderBy(l => l.Rectangle.Left).ThenBy(l => l.Rectangle.Top).ToList();
+ for (int index = 0; index < leds.Count; index++)
+ {
+ ArtemisLed artemisLed = leds[index];
+ if (ColorFirstLedOnly && index > 0)
+ e.Canvas.DrawRect(artemisLed.AbsoluteRectangle, new SKPaint {Color = new SKColor(0, 0, 0)});
+ else
+ e.Canvas.DrawRect(artemisLed.AbsoluteRectangle, new SKPaint {Color = listDeviceViewModel.Color});
+ }
}
}
@@ -258,6 +277,7 @@ namespace Artemis.UI.Screens.SurfaceEditor
private MouseDragStatus _mouseDragStatus;
private Point _mouseDragStartPoint;
private bool _colorDevices;
+ private bool _colorFirstLedOnly;
// ReSharper disable once UnusedMember.Global - Called from view
public void EditorGridMouseClick(object sender, MouseButtonEventArgs e)