From f6f65f7ef0205c77f4bf1f6a98d7e0ba9c5e3a5c Mon Sep 17 00:00:00 2001 From: Robert Date: Mon, 31 Oct 2022 21:46:03 +0100 Subject: [PATCH 1/4] Color gradient editor - Fixed deleting stops with the X-button --- .../Controls/GradientPicker/GradientPicker.cs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/Artemis.UI.Shared/Controls/GradientPicker/GradientPicker.cs b/src/Artemis.UI.Shared/Controls/GradientPicker/GradientPicker.cs index 0066ad760..5bc9eebd5 100644 --- a/src/Artemis.UI.Shared/Controls/GradientPicker/GradientPicker.cs +++ b/src/Artemis.UI.Shared/Controls/GradientPicker/GradientPicker.cs @@ -87,12 +87,12 @@ public class GradientPicker : TemplatedControl if (ColorGradient.Count <= 2) return; - int index = ColorGradient.IndexOf(s); - ColorGradient.Remove(s); - if (index > ColorGradient.Count - 1) + int index = EditingColorGradient.IndexOf(s); + EditingColorGradient.Remove(s); + if (index > EditingColorGradient.Count - 1) index--; - SelectedColorStop = ColorGradient.ElementAtOrDefault(index); + SelectedColorStop = EditingColorGradient.ElementAtOrDefault(index); }); } @@ -309,13 +309,8 @@ public class GradientPicker : TemplatedControl if (e.Key != Key.Delete || SelectedColorStop == null || EditingColorGradient.Count <= 2) return; - - int index = EditingColorGradient.IndexOf(SelectedColorStop); - EditingColorGradient.Remove(SelectedColorStop); - if (index > EditingColorGradient.Count - 1) - index--; - - SelectedColorStop = EditingColorGradient.ElementAtOrDefault(index); + + DeleteStop.Execute(SelectedColorStop); e.Handled = true; } From 5ef6f044c4db00c22499401efdc58b63ee412cf5 Mon Sep 17 00:00:00 2001 From: Robert Date: Mon, 31 Oct 2022 21:53:44 +0100 Subject: [PATCH 2/4] UI - Limit satellite resource languages to English reducing install size --- src/Artemis.UI.Linux/Artemis.UI.Linux.csproj | 3 ++- src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj | 1 + src/Artemis.UI.Windows/Artemis.UI.Windows.csproj | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Artemis.UI.Linux/Artemis.UI.Linux.csproj b/src/Artemis.UI.Linux/Artemis.UI.Linux.csproj index 54d227c86..7d19d5e97 100644 --- a/src/Artemis.UI.Linux/Artemis.UI.Linux.csproj +++ b/src/Artemis.UI.Linux/Artemis.UI.Linux.csproj @@ -8,7 +8,8 @@ bin Artemis linux-x64 - False + False + en diff --git a/src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj b/src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj index 143c04393..65ef347d2 100644 --- a/src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj +++ b/src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj @@ -8,6 +8,7 @@ bin Artemis False + en diff --git a/src/Artemis.UI.Windows/Artemis.UI.Windows.csproj b/src/Artemis.UI.Windows/Artemis.UI.Windows.csproj index f9985abca..74ef13f12 100644 --- a/src/Artemis.UI.Windows/Artemis.UI.Windows.csproj +++ b/src/Artemis.UI.Windows/Artemis.UI.Windows.csproj @@ -8,6 +8,7 @@ False Artemis ..\Artemis.UI\Assets\Images\Logo\application.ico + en From 6ac3d00116224b0de789a79489bc510b349400fd Mon Sep 17 00:00:00 2001 From: Robert Date: Mon, 31 Oct 2022 22:47:31 +0100 Subject: [PATCH 3/4] Layers - Fixed node scripts not loading on duplicated/pasted scripts --- src/Artemis.Core/Models/Profile/Layer.cs | 5 ++++- src/Artemis.UI/Extensions/ProfileElementExtensions.cs | 2 +- .../Panels/ProfileTree/LayerTreeItemViewModel.cs | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Artemis.Core/Models/Profile/Layer.cs b/src/Artemis.Core/Models/Profile/Layer.cs index 9dec90456..beca25a7d 100644 --- a/src/Artemis.Core/Models/Profile/Layer.cs +++ b/src/Artemis.Core/Models/Profile/Layer.cs @@ -50,7 +50,8 @@ public sealed class Layer : RenderProfileElement /// The profile the layer belongs to /// The parent of the layer /// The entity of the layer - public Layer(Profile profile, ProfileElement parent, LayerEntity layerEntity) : base(parent, parent.Profile) + /// A boolean indicating whether or not to attempt to load the node script straight away + public Layer(Profile profile, ProfileElement parent, LayerEntity layerEntity, bool loadNodeScript = false) : base(parent, parent.Profile) { LayerEntity = layerEntity; EntityId = layerEntity.Id; @@ -62,6 +63,8 @@ public sealed class Layer : RenderProfileElement Load(); Initialize(); + if (loadNodeScript) + LoadNodeScript(); } /// diff --git a/src/Artemis.UI/Extensions/ProfileElementExtensions.cs b/src/Artemis.UI/Extensions/ProfileElementExtensions.cs index 08ca23e2c..905c6aa10 100644 --- a/src/Artemis.UI/Extensions/ProfileElementExtensions.cs +++ b/src/Artemis.UI/Extensions/ProfileElementExtensions.cs @@ -55,7 +55,7 @@ public static class ProfileElementExtensions return folderClipboardModel.Paste(parent.Profile, parent); case LayerEntity layerEntity: layerEntity.Id = Guid.NewGuid(); - return new Layer(parent.Profile, parent, layerEntity); + return new Layer(parent.Profile, parent, layerEntity, true); default: return null; } diff --git a/src/Artemis.UI/Screens/ProfileEditor/Panels/ProfileTree/LayerTreeItemViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/Panels/ProfileTree/LayerTreeItemViewModel.cs index c6cb955ae..526c5412d 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Panels/ProfileTree/LayerTreeItemViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/Panels/ProfileTree/LayerTreeItemViewModel.cs @@ -41,7 +41,7 @@ public class LayerTreeItemViewModel : TreeItemViewModel copy.Id = Guid.NewGuid(); copy.Name = Layer.Parent.GetNewFolderName(copy.Name + " - copy"); - Layer copied = new(Layer.Profile, Layer.Parent, copy); + Layer copied = new(Layer.Profile, Layer.Parent, copy, true); ProfileEditorService.ExecuteCommand(new AddProfileElement(copied, Layer.Parent, Layer.Order - 1)); Layer.Profile.PopulateLeds(_rgbService.EnabledDevices); } From 3819a6e3be2de455804494e924b831e88b4185a1 Mon Sep 17 00:00:00 2001 From: Robert Date: Tue, 1 Nov 2022 21:21:24 +0100 Subject: [PATCH 4/4] Profile scripts - Fixed new scripts not appearing in the list --- src/Artemis.UI/Screens/Scripting/ScriptsDialogViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Artemis.UI/Screens/Scripting/ScriptsDialogViewModel.cs b/src/Artemis.UI/Screens/Scripting/ScriptsDialogViewModel.cs index 6318e1ad6..9f50cb387 100644 --- a/src/Artemis.UI/Screens/Scripting/ScriptsDialogViewModel.cs +++ b/src/Artemis.UI/Screens/Scripting/ScriptsDialogViewModel.cs @@ -64,7 +64,7 @@ public class ScriptsDialogViewModel : DialogViewModelBase .Subscribe() .DisposeWith(d); - _scriptConfigurations = scriptConfigurationViewModels; + ScriptConfigurations = scriptConfigurationViewModels; SelectedScript = ScriptConfigurations.FirstOrDefault(); Disposable.Create(() => profileService.SaveProfile(Profile, false)).DisposeWith(d); });