diff --git a/src/Artemis.Core/Models/Profile/Layer.cs b/src/Artemis.Core/Models/Profile/Layer.cs index 9e2a5ee98..b1113a996 100644 --- a/src/Artemis.Core/Models/Profile/Layer.cs +++ b/src/Artemis.Core/Models/Profile/Layer.cs @@ -296,10 +296,9 @@ namespace Artemis.Core.Models.Profile var transformProperty = new LayerProperty(this, null, "Transform", "The default properties collection every layer has, allows you to transform the shape.", null); AnchorPointProperty = new LayerProperty(this, transformProperty, "Anchor Point", "The point at which the shape is attached to its position.", typeof(SKPoint)); PositionProperty = new LayerProperty(this, transformProperty, "Position", "The position of the shape.", typeof(SKPoint)); - ScaleProperty = new LayerProperty(this, transformProperty, "Scale", "The scale of the shape.", typeof(SKSize)); - RotationProperty = new LayerProperty(this, transformProperty, "Rotation", "The rotation of the shape in degrees.", typeof(int)); - OpacityProperty = new LayerProperty(this, transformProperty, "Opacity", "The opacity of the shape from 0 to 1.", typeof(float)); - + ScaleProperty = new LayerProperty(this, transformProperty, "Scale", "The scale of the shape.", typeof(SKSize)) { InputAffix = "%" }; + RotationProperty = new LayerProperty(this, transformProperty, "Rotation", "The rotation of the shape in degrees.", typeof(int)) {InputAffix = "°" }; + OpacityProperty = new LayerProperty(this, transformProperty, "Opacity", "The opacity of the shape.", typeof(float)) {InputAffix = "%"}; transformProperty.Children.Add(AnchorPointProperty); transformProperty.Children.Add(PositionProperty); transformProperty.Children.Add(ScaleProperty); diff --git a/src/Artemis.Core/Models/Profile/LayerProperty.cs b/src/Artemis.Core/Models/Profile/LayerProperty.cs index 9cb8ce13e..a18d78351 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperty.cs +++ b/src/Artemis.Core/Models/Profile/LayerProperty.cs @@ -26,6 +26,8 @@ namespace Artemis.Core.Models.Profile public string Name { get; set; } public string Description { get; set; } + public string InputPrefix { get; set; } + public string InputAffix { get; set; } public Type Type { get; set; } public object BaseValue diff --git a/src/Artemis.UI/Artemis.UI.csproj b/src/Artemis.UI/Artemis.UI.csproj index 2d2630d14..914cd321b 100644 --- a/src/Artemis.UI/Artemis.UI.csproj +++ b/src/Artemis.UI/Artemis.UI.csproj @@ -162,6 +162,11 @@ + + + + + @@ -304,6 +309,22 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -468,6 +489,7 @@ SettingsSingleFileGenerator Settings.Designer.cs + @@ -497,41 +519,46 @@ - + - + - + - + - + - + - + - + - + - + + + + - false + + + diff --git a/src/Artemis.UI/Properties/Resources.Designer.cs b/src/Artemis.UI/Properties/Resources.Designer.cs index 9aff96daa..0b1cc4c0d 100644 --- a/src/Artemis.UI/Properties/Resources.Designer.cs +++ b/src/Artemis.UI/Properties/Resources.Designer.cs @@ -90,6 +90,26 @@ namespace Artemis.UI.Properties { } } + /// + /// Looks up a localized resource of type System.Byte[]. + /// + internal static byte[] aero_drag { + get { + object obj = ResourceManager.GetObject("aero_drag", resourceCulture); + return ((byte[])(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Byte[]. + /// + internal static byte[] aero_drag_ew { + get { + object obj = ResourceManager.GetObject("aero_drag_ew", resourceCulture); + return ((byte[])(obj)); + } + } + /// /// Looks up a localized resource of type System.Byte[]. /// @@ -179,5 +199,15 @@ namespace Artemis.UI.Properties { return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// Looks up a localized resource of type System.Byte[]. + /// + internal static byte[] RobotoMono_Regular { + get { + object obj = ResourceManager.GetObject("RobotoMono_Regular", resourceCulture); + return ((byte[])(obj)); + } + } } } diff --git a/src/Artemis.UI/Properties/Resources.resx b/src/Artemis.UI/Properties/Resources.resx index ffa40844b..980545d14 100644 --- a/src/Artemis.UI/Properties/Resources.resx +++ b/src/Artemis.UI/Properties/Resources.resx @@ -127,6 +127,12 @@ ..\Resources\aero_crosshair_plus.cur;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\Resources\aero_drag.cur;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\aero_drag_ew.cur;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + ..\Resources\aero_fill.cur;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -154,4 +160,7 @@ ..\Resources\logo-512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\RobotoMono-Regular.ttf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/src/Artemis.UI/Resources/RobotoMono-Regular.ttf b/src/Artemis.UI/Resources/RobotoMono-Regular.ttf new file mode 100644 index 000000000..5919b5d1b Binary files /dev/null and b/src/Artemis.UI/Resources/RobotoMono-Regular.ttf differ diff --git a/src/Artemis.UI/Resources/aero_drag.cur b/src/Artemis.UI/Resources/aero_drag.cur new file mode 100644 index 000000000..327857bd2 Binary files /dev/null and b/src/Artemis.UI/Resources/aero_drag.cur differ diff --git a/src/Artemis.UI/Resources/aero_drag_ew.cur b/src/Artemis.UI/Resources/aero_drag_ew.cur new file mode 100644 index 000000000..1052f9914 Binary files /dev/null and b/src/Artemis.UI/Resources/aero_drag_ew.cur differ diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/FloatPropertyInputView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/FloatPropertyInputView.xaml new file mode 100644 index 000000000..8183ab3ec --- /dev/null +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/FloatPropertyInputView.xaml @@ -0,0 +1,21 @@ + + + + + + + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/FloatPropertyInputViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/FloatPropertyInputViewModel.cs new file mode 100644 index 000000000..256820991 --- /dev/null +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/FloatPropertyInputViewModel.cs @@ -0,0 +1,16 @@ +using Artemis.UI.Exceptions; + +namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.PropertyInput +{ + public class FloatPropertyInputViewModel : PropertyInputViewModel + { + public FloatPropertyInputViewModel(LayerPropertyViewModel layerPropertyViewModel) : base(layerPropertyViewModel) + { + if (layerPropertyViewModel.LayerProperty.Type != typeof(float)) + { + throw new ArtemisUIException("This input VM expects a layer property of type float, " + + $"not the provided type {layerPropertyViewModel.LayerProperty.Type.Name}"); + } + } + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/IntPropertyInputView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/IntPropertyInputView.xaml new file mode 100644 index 000000000..63a2b3ea9 --- /dev/null +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/IntPropertyInputView.xaml @@ -0,0 +1,21 @@ + + + + + + + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/IntPropertyInputViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/IntPropertyInputViewModel.cs new file mode 100644 index 000000000..46b58cd47 --- /dev/null +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/IntPropertyInputViewModel.cs @@ -0,0 +1,16 @@ +using Artemis.UI.Exceptions; + +namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.PropertyInput +{ + public class IntPropertyInputViewModel : PropertyInputViewModel + { + public IntPropertyInputViewModel(LayerPropertyViewModel layerPropertyViewModel) : base(layerPropertyViewModel) + { + if (layerPropertyViewModel.LayerProperty.Type != typeof(int)) + { + throw new ArtemisUIException("This input VM expects a layer property of type int, " + + $"not the provided type {layerPropertyViewModel.LayerProperty.Type.Name}"); + } + } + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/PropertyInputViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/PropertyInputViewModel.cs new file mode 100644 index 000000000..6f8b6babe --- /dev/null +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/PropertyInputViewModel.cs @@ -0,0 +1,14 @@ +using Stylet; + +namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.PropertyInput +{ + public abstract class PropertyInputViewModel : PropertyChangedBase + { + protected PropertyInputViewModel(LayerPropertyViewModel layerPropertyViewModel) + { + LayerPropertyViewModel = layerPropertyViewModel; + } + + public LayerPropertyViewModel LayerPropertyViewModel { get; } + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKPointPropertyInputView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKPointPropertyInputView.xaml new file mode 100644 index 000000000..24ec22465 --- /dev/null +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKPointPropertyInputView.xaml @@ -0,0 +1,30 @@ + + + + + , + + + + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKPointPropertyInputViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKPointPropertyInputViewModel.cs new file mode 100644 index 000000000..7dd58c2f0 --- /dev/null +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKPointPropertyInputViewModel.cs @@ -0,0 +1,17 @@ +using Artemis.UI.Exceptions; +using SkiaSharp; + +namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.PropertyInput +{ + public class SKPointPropertyInputViewModel : PropertyInputViewModel + { + public SKPointPropertyInputViewModel(LayerPropertyViewModel layerPropertyViewModel) : base(layerPropertyViewModel) + { + if (layerPropertyViewModel.LayerProperty.Type != typeof(SKPoint)) + { + throw new ArtemisUIException($"This input VM expects a layer property of type {nameof(SKPoint)}, " + + $"not the provided type {layerPropertyViewModel.LayerProperty.Type.Name}"); + } + } + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKSizePropertyInputView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKSizePropertyInputView.xaml new file mode 100644 index 000000000..db8eae794 --- /dev/null +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKSizePropertyInputView.xaml @@ -0,0 +1,30 @@ + + + + + , + + + + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKSizePropertyInputViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKSizePropertyInputViewModel.cs new file mode 100644 index 000000000..00dcb43da --- /dev/null +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKSizePropertyInputViewModel.cs @@ -0,0 +1,17 @@ +using Artemis.UI.Exceptions; +using SkiaSharp; + +namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.PropertyInput +{ + public class SKSizePropertyInputViewModel : PropertyInputViewModel + { + public SKSizePropertyInputViewModel(LayerPropertyViewModel layerPropertyViewModel) : base(layerPropertyViewModel) + { + if (layerPropertyViewModel.LayerProperty.Type != typeof(SKSize)) + { + throw new ArtemisUIException($"This input VM expects a layer property of type {nameof(SKSize)}, " + + $"not the provided type {layerPropertyViewModel.LayerProperty.Type.Name}"); + } + } + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyTreeChildView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyTreeChildView.xaml index 708ed22b1..b54b1c412 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyTreeChildView.xaml +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyTreeChildView.xaml @@ -5,6 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:s="https://github.com/canton7/Stylet" mc:Ignorable="d" d:DesignHeight="19" d:DesignWidth="800" @@ -35,16 +36,8 @@ ToolTip="{Binding LayerPropertyViewModel.LayerProperty.Description}" HorizontalAlignment="Left" /> - - - - - + +