Profile editor - Fixed new layers not saving in some situations

Profile tree - Improved buttons visibility
Layer brushes - Support transformation by default, unless a RGB.NET brush
This commit is contained in:
SpoinkyNL committed 2020-06-11 21:16:13 +02:00
1 parent c60ae48e66
commit f917728ac8
13 files changed
+88 -40

No files matched your search

@@ -1,5 +1,6 @@
using System;
using Artemis.Core.Models.Profile;
using Artemis.Core.Plugins.Exceptions;
using Artemis.Core.Plugins.Models;
using Artemis.Core.Services.Interfaces;
using SkiaSharp;
@@ -11,6 +12,8 @@ namespace Artemis.Core.Plugins.LayerBrush.Abstract
/// </summary>
public abstract class BaseLayerBrush : IDisposable
{
private bool _supportsTransformation = true;
/// <summary>
/// Gets the layer this brush is applied to
/// </summary>
@@ -37,9 +40,19 @@ namespace Artemis.Core.Plugins.LayerBrush.Abstract
public virtual LayerPropertyGroup BaseProperties => null;
/// <summary>
/// Gets whether the brush supports transformations, RGB.NET brushes never support transformation
/// Gets or sets whether the brush supports transformations
/// <para>Note: RGB.NET brushes can never be transformed and setting this to true will throw an exception</para>
/// </summary>
public bool SupportsTransformation { get; protected set; }
public bool SupportsTransformation
{
get => _supportsTransformation;
protected set
{
if (BrushType == LayerBrushType.RgbNet)
throw new ArtemisPluginException(PluginInfo, "An RGB.NET brush cannot support transformation");
_supportsTransformation = value;
}
}
public void Dispose()
{
@@ -13,6 +13,7 @@ namespace Artemis.Core.Plugins.LayerBrush.Abstract
protected RgbNetLayerBrush()
{
BrushType = LayerBrushType.RgbNet;
SupportsTransformation = false;
}
/// <summary>