mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Noise brush - Added option to map noise to a gradient
Color brush - Only show gradient/color option when applicable Gradient picker - Design tweaks
This commit is contained in:
1 parent
5dea0b25e5
commit
a8912076d3
10 files changed
+201
-82
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Artemis.Core.Models.Profile;
|
||||
using Artemis.Core.Models.Profile.LayerProperties;
|
||||
using Artemis.Core.Services.Interfaces;
|
||||
@@ -76,15 +77,31 @@ namespace Artemis.Core.Plugins.LayerBrush
|
||||
/// <returns>The layer property</returns>
|
||||
protected LayerProperty<T> RegisterLayerProperty<T>(string id, string name, string description, T defaultValue = default)
|
||||
{
|
||||
var property = new LayerProperty<T>(
|
||||
Layer, Descriptor.LayerBrushProvider.PluginInfo, Layer.Properties.BrushReference.Parent, id, name, description
|
||||
) {Value = defaultValue};
|
||||
var property = new LayerProperty<T>(Layer, Descriptor.LayerBrushProvider.PluginInfo, Layer.Properties.BrushReference.Parent, id, name, description)
|
||||
{
|
||||
Value = defaultValue
|
||||
};
|
||||
|
||||
Layer.Properties.RegisterLayerProperty(property);
|
||||
// It's fine if this is null, it'll be picked up by SetLayerService later
|
||||
_layerService?.InstantiateKeyframeEngine(property);
|
||||
return property;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Allows you to remove layer properties previously added by using <see cref="RegisterLayerProperty{T}(BaseLayerProperty,string,string,string,T)" />.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="layerProperty"></param>
|
||||
protected void UnRegisterLayerProperty<T>(LayerProperty<T> layerProperty)
|
||||
{
|
||||
if (layerProperty == null)
|
||||
return;
|
||||
|
||||
if (Layer.Properties.Any(p => p == layerProperty))
|
||||
Layer.Properties.RemoveLayerProperty(layerProperty);
|
||||
}
|
||||
|
||||
internal void SetLayerService(ILayerService layerService)
|
||||
{
|
||||
_layerService = layerService;
|
||||
|
||||
Reference in new issue
Block a user