diff --git a/src/Artemis.Core/Models/Profile/Layer.cs b/src/Artemis.Core/Models/Profile/Layer.cs index eea5762ad..e71a843b3 100644 --- a/src/Artemis.Core/Models/Profile/Layer.cs +++ b/src/Artemis.Core/Models/Profile/Layer.cs @@ -500,10 +500,10 @@ namespace Artemis.Core.Models.Profile private void CreateDefaultProperties() { // Shape - var shape = new LayerProperty(this, "Core.Shape", "Shape", "A collection of basic shape properties."); - ShapeTypeProperty = new LayerProperty(this, shape, "Core.ShapeType", "Shape type", "The type of shape to draw in this layer.") {CanUseKeyframes = false}; - FillTypeProperty = new LayerProperty(this, shape, "Core.FillType", "Fill type", "How to make the shape adjust to scale changes.") {CanUseKeyframes = false}; - BlendModeProperty = new LayerProperty(this, shape, "Core.BlendMode", "Blend mode", "How to blend this layer into the resulting image.") {CanUseKeyframes = false}; + var shape = new LayerProperty(this, "Core.Shape", "Shape", "A collection of basic shape properties"); + ShapeTypeProperty = new LayerProperty(this, shape, "Core.ShapeType", "Shape type", "The type of shape to draw in this layer") {CanUseKeyframes = false}; + FillTypeProperty = new LayerProperty(this, shape, "Core.FillType", "Fill type", "How to make the shape adjust to scale changes") {CanUseKeyframes = false}; + BlendModeProperty = new LayerProperty(this, shape, "Core.BlendMode", "Blend mode", "How to blend this layer into the resulting image") {CanUseKeyframes = false}; ShapeTypeProperty.Value = LayerShapeType.Rectangle; FillTypeProperty.Value = LayerFillType.Stretch; BlendModeProperty.Value = SKBlendMode.SrcOver; @@ -513,20 +513,20 @@ namespace Artemis.Core.Models.Profile RegisterLayerProperty(shapeProperty); // Brush - var brush = new LayerProperty(this, "Core.Brush", "Brush", "A collection of properties that configure the selected brush."); - BrushReferenceProperty = new LayerProperty(this, brush, "Core.BrushReference", "Brush type", "The type of brush to use for this layer.") {CanUseKeyframes = false}; + var brush = new LayerProperty(this, "Core.Brush", "Brush", "A collection of properties that configure the selected brush"); + BrushReferenceProperty = new LayerProperty(this, brush, "Core.BrushReference", "Brush type", "The type of brush to use for this layer") {CanUseKeyframes = false}; RegisterLayerProperty(brush); foreach (var brushProperty in brush.Children) RegisterLayerProperty(brushProperty); // Transform - var transform = new LayerProperty(this, "Core.Transform", "Transform", "A collection of transformation properties.") {ExpandByDefault = true}; - AnchorPointProperty = new LayerProperty(this, transform, "Core.AnchorPoint", "Anchor Point", "The point at which the shape is attached to its position.") {InputStepSize = 0.001f}; - PositionProperty = new LayerProperty(this, transform, "Core.Position", "Position", "The position of the shape.") {InputStepSize = 0.001f}; - ScaleProperty = new LayerProperty(this, transform, "Core.Scale", "Scale", "The scale of the shape.") {InputAffix = "%", MinInputValue = 0f}; - RotationProperty = new LayerProperty(this, transform, "Core.Rotation", "Rotation", "The rotation of the shape in degrees.") {InputAffix = "°"}; - OpacityProperty = new LayerProperty(this, transform, "Core.Opacity", "Opacity", "The opacity of the shape.") {InputAffix = "%", MinInputValue = 0f, MaxInputValue = 100f}; + var transform = new LayerProperty(this, "Core.Transform", "Transform", "A collection of transformation properties") {ExpandByDefault = true}; + AnchorPointProperty = new LayerProperty(this, transform, "Core.AnchorPoint", "Anchor Point", "The point at which the shape is attached to its position") {InputStepSize = 0.001f}; + PositionProperty = new LayerProperty(this, transform, "Core.Position", "Position", "The position of the shape") {InputStepSize = 0.001f}; + ScaleProperty = new LayerProperty(this, transform, "Core.Scale", "Scale", "The scale of the shape") {InputAffix = "%", MinInputValue = 0f}; + RotationProperty = new LayerProperty(this, transform, "Core.Rotation", "Rotation", "The rotation of the shape in degrees") {InputAffix = "°"}; + OpacityProperty = new LayerProperty(this, transform, "Core.Opacity", "Opacity", "The opacity of the shape") {InputAffix = "%", MinInputValue = 0f, MaxInputValue = 100f}; ScaleProperty.Value = new SKSize(100, 100); OpacityProperty.Value = 100; diff --git a/src/Artemis.Plugins.LayerBrushes.Color/ColorBrush.cs b/src/Artemis.Plugins.LayerBrushes.Color/ColorBrush.cs index 48db6b15a..c6a66f194 100644 --- a/src/Artemis.Plugins.LayerBrushes.Color/ColorBrush.cs +++ b/src/Artemis.Plugins.LayerBrushes.Color/ColorBrush.cs @@ -18,8 +18,8 @@ namespace Artemis.Plugins.LayerBrushes.Color public ColorBrush(Layer layer, LayerBrushDescriptor descriptor) : base(layer, descriptor) { - ColorProperty = RegisterLayerProperty("Brush.Color", "Color", "The color of the brush."); - GradientTypeProperty = RegisterLayerProperty("Brush.GradientType", "Gradient type", "The scale of the noise."); + ColorProperty = RegisterLayerProperty("Brush.Color", "Color", "The color of the brush", new SKColor(255,0,0)); + GradientTypeProperty = RegisterLayerProperty("Brush.GradientType", "Gradient type", "The type of color brush to draw"); GradientTypeProperty.CanUseKeyframes = false; _testColors = new List(); diff --git a/src/Artemis.Plugins.LayerBrushes.Noise/NoiseBrush.cs b/src/Artemis.Plugins.LayerBrushes.Noise/NoiseBrush.cs index cf68999cb..4ca46a9c7 100644 --- a/src/Artemis.Plugins.LayerBrushes.Noise/NoiseBrush.cs +++ b/src/Artemis.Plugins.LayerBrushes.Noise/NoiseBrush.cs @@ -28,17 +28,17 @@ namespace Artemis.Plugins.LayerBrushes.Noise _z = Rand.Next(0, 4096); _noise = new OpenSimplexNoise(Rand.Next(0, 4096)); - MainColorProperty = RegisterLayerProperty("Brush.MainColor", "Main color", "The main color of the noise."); - SecondaryColorProperty = RegisterLayerProperty("Brush.SecondaryColor", "Secondary color", "The secondary color of the noise."); - ScaleProperty = RegisterLayerProperty("Brush.Scale", "Scale", "The scale of the noise."); + MainColorProperty = RegisterLayerProperty("Brush.MainColor", "Main color", "The main color of the noise", new SKColor(255, 0, 0)); + SecondaryColorProperty = RegisterLayerProperty("Brush.SecondaryColor", "Secondary color", "The secondary color of the noise", new SKColor(0, 0, 255)); + ScaleProperty = RegisterLayerProperty("Brush.Scale", "Scale", "The scale of the noise.", new SKSize(100, 100)); ScaleProperty.MinInputValue = 0f; - HardnessProperty = RegisterLayerProperty("Brush.Hardness", "Hardness", "The hardness of the noise, lower means there are gradients in the noise, higher means hard lines.."); + HardnessProperty = RegisterLayerProperty("Brush.Hardness", "Hardness", "The hardness of the noise, lower means there are gradients in the noise, higher means hard lines", 500f); HardnessProperty.MinInputValue = 0f; HardnessProperty.MaxInputValue = 2048f; - ScrollSpeedProperty = RegisterLayerProperty("Brush.ScrollSpeed", "Movement speed", "The speed at which the noise moves vertically and horizontally."); + ScrollSpeedProperty = RegisterLayerProperty("Brush.ScrollSpeed", "Movement speed", "The speed at which the noise moves vertically and horizontally"); ScrollSpeedProperty.MinInputValue = -64f; ScrollSpeedProperty.MaxInputValue = 64f; - AnimationSpeedProperty = RegisterLayerProperty("Brush.AnimationSpeed", "Animation speed", "The speed at which the noise moves."); + AnimationSpeedProperty = RegisterLayerProperty("Brush.AnimationSpeed", "Animation speed", "The speed at which the noise moves", 25f); AnimationSpeedProperty.MinInputValue = 0f; AnimationSpeedProperty.MaxInputValue = 64f; ScaleProperty.InputAffix = "%"; diff --git a/src/Artemis.UI/Bootstrapper.cs b/src/Artemis.UI/Bootstrapper.cs index 375b0a275..d89c35277 100644 --- a/src/Artemis.UI/Bootstrapper.cs +++ b/src/Artemis.UI/Bootstrapper.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading; using System.Threading.Tasks; using System.Windows; using System.Windows.Threading; @@ -31,21 +32,29 @@ namespace Artemis.UI protected override void Launch() { - StartupArguments = Args.ToList(); - + var logger = Kernel.Get(); var windowManager = Kernel.Get(); - windowManager.ShowWindow(RootViewModel); + var viewManager = Kernel.Get(); - Task.Run(() => + Task.Run(async () => { try { + StartupArguments = Args.ToList(); + if (StartupArguments.Contains("-autorun")) + { + logger.Information("Sleeping for 15 seconds on auto run to allow applications like iCUE and LGS to start"); + await Task.Delay(TimeSpan.FromSeconds(15)); + } + + // Create and bind the root view, this is a tray icon so don't show it with the window manager + Execute.OnUIThread(() => viewManager.CreateAndBindViewForModelIfNecessary(RootViewModel)); + // Start the Artemis core _core = Kernel.Get(); } catch (Exception e) { - var logger = Kernel.Get(); logger.Fatal(e, "Fatal exception during initialization, shutting down."); // TODO: A proper exception viewer diff --git a/src/Artemis.UI/Properties/launchSettings.json b/src/Artemis.UI/Properties/launchSettings.json index 5901254fe..a11fc1923 100644 --- a/src/Artemis.UI/Properties/launchSettings.json +++ b/src/Artemis.UI/Properties/launchSettings.json @@ -1,8 +1,7 @@ { "profiles": { "Artemis.UI": { - "commandName": "Project", - "commandLineArgs": "-autorun" + "commandName": "Project" } } } \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/ProfileEditorViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/ProfileEditorViewModel.cs index 08736326b..d1106e5a9 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/ProfileEditorViewModel.cs +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/ProfileEditorViewModel.cs @@ -120,19 +120,19 @@ namespace Artemis.UI.Screens.Module.ProfileEditor _profileEditorService.RedoUpdateProfile(Module); } - protected override void OnActivate() + protected override void OnInitialActivate() { LoadWorkspaceSettings(); _profileEditorService.StopRegularRender(); Task.Run(LoadProfiles); - base.OnActivate(); + base.OnInitialActivate(); } - protected override void OnDeactivate() + protected override void OnClose() { SaveWorkspaceSettings(); _profileEditorService.ResumeRegularRender(); - base.OnDeactivate(); + base.OnClose(); } private void ChangeSelectedProfile(Profile profile) diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/Visualization/ProfileViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/Visualization/ProfileViewModel.cs index 3c2e20506..aed25d5ac 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/Visualization/ProfileViewModel.cs +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/Visualization/ProfileViewModel.cs @@ -114,7 +114,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization } } - protected override void OnActivate() + protected override void OnInitialActivate() { HighlightSelectedLayer = _settingsService.GetSetting("ProfileEditor.HighlightSelectedLayer", true); PauseRenderingOnFocusLoss = _settingsService.GetSetting("ProfileEditor.PauseRenderingOnFocusLoss", true); @@ -122,10 +122,10 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization HighlightSelectedLayer.SettingChanged += HighlightSelectedLayerOnSettingChanged; _updateTrigger.Start(); - base.OnActivate(); + base.OnInitialActivate(); } - protected override void OnDeactivate() + protected override void OnClose() { HighlightSelectedLayer.Save(); PauseRenderingOnFocusLoss.Save(); @@ -139,7 +139,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization // TODO: Remove when fixed in RGB.NET, or avoid double stopping } - base.OnDeactivate(); + base.OnClose(); } private void CreateUpdateTrigger() diff --git a/src/Artemis.UI/Screens/Settings/Debug/DebugViewModel.cs b/src/Artemis.UI/Screens/Settings/Debug/DebugViewModel.cs index 2b348789a..d37b81718 100644 --- a/src/Artemis.UI/Screens/Settings/Debug/DebugViewModel.cs +++ b/src/Artemis.UI/Screens/Settings/Debug/DebugViewModel.cs @@ -36,18 +36,18 @@ namespace Artemis.UI.Screens.Settings.Debug GC.WaitForPendingFinalizers(); } - protected override void OnActivate() + protected override void OnInitialActivate() { _coreService.FrameRendered += CoreServiceOnFrameRendered; _coreService.FrameRendering += CoreServiceOnFrameRendering; - base.OnActivate(); + base.OnInitialActivate(); } - protected override void OnDeactivate() + protected override void OnClose() { _coreService.FrameRendered -= CoreServiceOnFrameRendered; _coreService.FrameRendering -= CoreServiceOnFrameRendering; - base.OnDeactivate(); + base.OnClose(); } private void CoreServiceOnFrameRendered(object sender, FrameRenderedEventArgs e) diff --git a/src/Artemis.UI/Screens/SurfaceEditor/SurfaceEditorViewModel.cs b/src/Artemis.UI/Screens/SurfaceEditor/SurfaceEditorViewModel.cs index 87239d9ae..7e6e395c4 100644 --- a/src/Artemis.UI/Screens/SurfaceEditor/SurfaceEditorViewModel.cs +++ b/src/Artemis.UI/Screens/SurfaceEditor/SurfaceEditorViewModel.cs @@ -142,17 +142,17 @@ namespace Artemis.UI.Screens.SurfaceEditor #region Overrides of Screen - protected override void OnActivate() + protected override void OnInitialActivate() { LoadSurfaceConfigurations(); LoadWorkspaceSettings(); - base.OnActivate(); + base.OnInitialActivate(); } - protected override void OnDeactivate() + protected override void OnClose() { SaveWorkspaceSettings(); - base.OnDeactivate(); + base.OnClose(); } #endregion diff --git a/src/Artemis.UI/Screens/TrayView.xaml b/src/Artemis.UI/Screens/TrayView.xaml index 7e976721c..65778bd48 100644 --- a/src/Artemis.UI/Screens/TrayView.xaml +++ b/src/Artemis.UI/Screens/TrayView.xaml @@ -1,4 +1,4 @@ - - +