mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 11:26:27 +00:00
Profile editor - Added effect renaming
Core - Fixed effect loading Core - Fixed some effects not applying on per-LED brushes
This commit is contained in:
1 parent
2bf36fbf20
commit
cd8656cb0d
18 files changed
+292
-79
No files matched your search
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using Artemis.Core.JsonConverters;
|
||||
using Artemis.Core.Services;
|
||||
using Artemis.Core.Services.Core;
|
||||
@@ -14,6 +15,11 @@ namespace Artemis.Core
|
||||
/// </summary>
|
||||
public static class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// The Artemis.Core assembly
|
||||
/// </summary>
|
||||
public static readonly Assembly CoreAssembly = typeof(Constants).Assembly;
|
||||
|
||||
/// <summary>
|
||||
/// The full path to the Artemis application folder
|
||||
/// </summary>
|
||||
|
||||
@@ -627,13 +627,12 @@ namespace Artemis.Core
|
||||
if (LayerBrush == null)
|
||||
throw new ArtemisCoreException("The layer is not yet ready for rendering");
|
||||
|
||||
using SKAutoCanvasRestore _ = new(canvas);
|
||||
foreach (BaseLayerEffect baseLayerEffect in LayerEffects)
|
||||
{
|
||||
if (!baseLayerEffect.Suspended)
|
||||
baseLayerEffect.InternalPreProcess(canvas, bounds, layerPaint);
|
||||
}
|
||||
|
||||
using SKAutoCanvasRestore _ = new(canvas);
|
||||
canvas.ClipPath(renderPath);
|
||||
|
||||
// Restore the blend mode before doing the actual render
|
||||
|
||||
@@ -35,7 +35,6 @@ namespace Artemis.Core.LayerBrushes
|
||||
canvas.SetMatrix(canvas.TotalMatrix.PreConcat(Layer.GetTransformMatrix(true, false, false, true).Invert()));
|
||||
|
||||
using SKPath pointsPath = new();
|
||||
using SKPaint ledPaint = new();
|
||||
foreach (ArtemisLed artemisLed in Layer.Leds)
|
||||
{
|
||||
pointsPath.AddPoly(new[]
|
||||
@@ -61,7 +60,7 @@ namespace Artemis.Core.LayerBrushes
|
||||
continue;
|
||||
|
||||
// Let the brush determine the color
|
||||
ledPaint.Color = GetColor(artemisLed, renderPoint);
|
||||
paint.Color = GetColor(artemisLed, renderPoint);
|
||||
|
||||
SKRect ledRectangle = SKRect.Create(
|
||||
artemisLed.AbsoluteRectangle.Left - Layer.Bounds.Left,
|
||||
@@ -70,7 +69,7 @@ namespace Artemis.Core.LayerBrushes
|
||||
artemisLed.AbsoluteRectangle.Height
|
||||
);
|
||||
|
||||
canvas.DrawRect(ledRectangle, ledPaint);
|
||||
canvas.DrawRect(ledRectangle, paint);
|
||||
}
|
||||
}, "Failed to render");
|
||||
}
|
||||
|
||||
@@ -222,8 +222,8 @@ namespace Artemis.Core.LayerEffects
|
||||
/// <inheritdoc />
|
||||
public void Load()
|
||||
{
|
||||
Name = LayerEffectEntity.Name;
|
||||
HasBeenRenamed = LayerEffectEntity.HasBeenRenamed;
|
||||
Name = HasBeenRenamed ? LayerEffectEntity.Name : Descriptor.DisplayName;
|
||||
Order = LayerEffectEntity.Order;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,6 +87,7 @@ public class LayerEffectDescriptor
|
||||
else
|
||||
{
|
||||
effect.LayerEffectEntity = new LayerEffectEntity();
|
||||
effect.Name = DisplayName;
|
||||
effect.Initialize();
|
||||
effect.Save();
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Artemis.Core
|
||||
{
|
||||
lock (Registrations)
|
||||
{
|
||||
return Registrations.FirstOrDefault(d => d.PluginFeature.Id == providerId && d.LayerEffectDescriptor.LayerEffectType?.Name == typeName);
|
||||
return Registrations.FirstOrDefault(d => d.PluginFeature.Id == providerId && d.LayerEffectDescriptor.LayerEffectType?.FullName == typeName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user