Core - Add HidSharp to force plugins to share the HidSharp types

Core - For now, set default log level to debug
ColorGradient- Improved GetColor performance
ColorGradient - GetColor now handles colors not between two stops properly
Home - Fix links
Plugins - Only allow layer property registration through Brushes
Color brush - Default to solid color
This commit is contained in:
SpoinkyNL committed 2020-04-21 19:59:05 +02:00
1 parent 8c3212451b
commit 9f8fc9f70e
21 files changed
+279 -172

No files matched your search

+4 -1
View File
@@ -14,7 +14,10 @@ namespace Artemis.UI.Screens.Home
{
// Don't open anything but valid URIs
if (Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute))
Process.Start(url);
{
url = url.Replace("&", "^&");
Process.Start(new ProcessStartInfo("cmd", $"/c start {url}") {CreateNoWindow = true});
}
}
}
}
@@ -261,7 +261,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties
{
// End time is the last keyframe + 10 sec
var lastKeyFrame = PropertyTimeline.PropertyTrackViewModels.SelectMany(r => r.KeyframeViewModels).OrderByDescending(t => t.Keyframe.Position).FirstOrDefault();
return lastKeyFrame?.Keyframe.Position.Add(new TimeSpan(0, 0, 0, 10)) ?? TimeSpan.FromSeconds(10);
return lastKeyFrame?.Keyframe.Position.Add(new TimeSpan(0, 0, 0, 10)) ?? TimeSpan.MaxValue;
}
private void CoreServiceOnFrameRendering(object sender, FrameRenderingEventArgs e)
@@ -51,7 +51,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.P
{
}
private void LayerPropertyOnValueChanged(object? sender, EventArgs e)
private void LayerPropertyOnValueChanged(object sender, EventArgs e)
{
Update();
}
@@ -10,6 +10,7 @@ using System.Windows.Media;
using Artemis.Core.Models.Surface;
using Artemis.Core.Plugins.Models;
using Artemis.Core.Services;
using Artemis.Core.Services.Interfaces;
using Artemis.Core.Services.Storage.Interfaces;
using Artemis.UI.Screens.Shared;
using Artemis.UI.Screens.SurfaceEditor.Dialogs;
@@ -24,9 +25,11 @@ namespace Artemis.UI.Screens.SurfaceEditor
private readonly IDeviceService _deviceService;
private readonly IDialogService _dialogService;
private readonly ISettingsService _settingsService;
private readonly IRgbService _rgbService;
private readonly ISurfaceService _surfaceService;
public SurfaceEditorViewModel(ISurfaceService surfaceService, IDialogService dialogService, ISettingsService settingsService, IDeviceService deviceService)
public SurfaceEditorViewModel(IRgbService rgbService, ISurfaceService surfaceService, IDialogService dialogService, ISettingsService settingsService,
IDeviceService deviceService)
{
DisplayName = "Surface Editor";
@@ -36,6 +39,7 @@ namespace Artemis.UI.Screens.SurfaceEditor
PanZoomViewModel = new PanZoomViewModel();
Cursor = null;
_rgbService = rgbService;
_surfaceService = surfaceService;
_dialogService = dialogService;
_settingsService = settingsService;
@@ -90,7 +94,9 @@ namespace Artemis.UI.Screens.SurfaceEditor
{
activeConfig = CreateSurfaceConfiguration("Default");
configs.Add(activeConfig);
_rgbService.UpdateTrigger.Stop();
_surfaceService.SetActiveSurfaceConfiguration(activeConfig);
_rgbService.UpdateTrigger.Start();
}
Execute.PostToUIThread(() =>
@@ -134,7 +140,9 @@ namespace Artemis.UI.Screens.SurfaceEditor
}
});
_rgbService.UpdateTrigger.Stop();
_surfaceService.SetActiveSurfaceConfiguration(SelectedSurface);
_rgbService.UpdateTrigger.Start();
}
#region Overrides of Screen
@@ -195,7 +203,7 @@ namespace Artemis.UI.Screens.SurfaceEditor
deviceViewModel.Device.ZIndex = i + 1;
}
_surfaceService.UpdateSurfaceConfiguration(SelectedSurface, true);
SafeUpdateSurfaceConfiguration();
}
public void BringForward(SurfaceDeviceViewModel surfaceDeviceViewModel)
@@ -210,7 +218,7 @@ namespace Artemis.UI.Screens.SurfaceEditor
deviceViewModel.Device.ZIndex = i + 1;
}
_surfaceService.UpdateSurfaceConfiguration(SelectedSurface, true);
SafeUpdateSurfaceConfiguration();
}
public void SendToBack(SurfaceDeviceViewModel surfaceDeviceViewModel)
@@ -222,7 +230,7 @@ namespace Artemis.UI.Screens.SurfaceEditor
deviceViewModel.Device.ZIndex = i + 1;
}
_surfaceService.UpdateSurfaceConfiguration(SelectedSurface, true);
SafeUpdateSurfaceConfiguration();
}
public void SendBackward(SurfaceDeviceViewModel surfaceDeviceViewModel)
@@ -236,7 +244,7 @@ namespace Artemis.UI.Screens.SurfaceEditor
deviceViewModel.Device.ZIndex = i + 1;
}
_surfaceService.UpdateSurfaceConfiguration(SelectedSurface, true);
SafeUpdateSurfaceConfiguration();
}
public async Task ViewProperties(SurfaceDeviceViewModel surfaceDeviceViewModel)
@@ -247,7 +255,7 @@ namespace Artemis.UI.Screens.SurfaceEditor
});
if ((bool) madeChanges)
_surfaceService.UpdateSurfaceConfiguration(SelectedSurface, true);
SafeUpdateSurfaceConfiguration();
}
#endregion
@@ -343,8 +351,7 @@ namespace Artemis.UI.Screens.SurfaceEditor
}
}
else
_surfaceService.UpdateSurfaceConfiguration(SelectedSurface, true);
SafeUpdateSurfaceConfiguration();
_mouseDragStatus = MouseDragStatus.None;
}
@@ -372,6 +379,13 @@ namespace Artemis.UI.Screens.SurfaceEditor
device.UpdateMouseDrag(position);
}
private void SafeUpdateSurfaceConfiguration()
{
_rgbService.UpdateTrigger.Stop();
_surfaceService.UpdateSurfaceConfiguration(SelectedSurface, true);
_rgbService.UpdateTrigger.Start();
}
#endregion
#region Panning and zooming