mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Layer properties - Fixed some checks
This commit is contained in:
parent
10e9e9446a
commit
7b1cefca8b
@ -40,8 +40,8 @@ namespace Artemis.Core.Models.Profile.LayerProperties.Attributes
|
||||
public object MaxInputValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not keyframes are supported, true by default and cannot be changed at runtime
|
||||
/// Whether or not keyframes are always disabled
|
||||
/// </summary>
|
||||
public bool KeyframesSupported { get; set; } = true;
|
||||
public bool DisableKeyframes { get; set; }
|
||||
}
|
||||
}
|
||||
@ -156,14 +156,9 @@ namespace Artemis.Core.Models.Profile
|
||||
instance.ProfileElement = profileElement;
|
||||
instance.Parent = this;
|
||||
instance.PropertyDescription = (PropertyDescriptionAttribute) propertyDescription;
|
||||
if (!instance.KeyframesSupported && instance.PropertyDescription.KeyframesSupported)
|
||||
{
|
||||
throw new ArtemisPluginException($"Failed to create instance of layer property at {path + propertyInfo.Name}. " +
|
||||
$"In the description attribute {nameof(instance.KeyframesSupported)} is set to true but this layer property type " +
|
||||
"does not support keyframes.");
|
||||
}
|
||||
if (instance.PropertyDescription.DisableKeyframes)
|
||||
instance.KeyframesSupported = false;
|
||||
|
||||
instance.KeyframesSupported = instance.PropertyDescription.KeyframesSupported;
|
||||
InitializeProperty(profileElement, path + propertyInfo.Name, instance);
|
||||
|
||||
propertyInfo.SetValue(this, instance);
|
||||
|
||||
@ -21,7 +21,7 @@ namespace Artemis.Plugins.LayerBrushes.Color
|
||||
[PropertyDescription(Description = "The gradient of the brush")]
|
||||
public ColorGradientLayerProperty Gradient { get; set; }
|
||||
|
||||
[PropertyDescription(KeyframesSupported = false, Description = "How many times to repeat the colors in the selected gradient", MinInputValue = 0, MaxInputValue = 10)]
|
||||
[PropertyDescription(DisableKeyframes = true, Description = "How many times to repeat the colors in the selected gradient", MinInputValue = 0, MaxInputValue = 10)]
|
||||
public IntLayerProperty GradientRepeat { get; set; }
|
||||
|
||||
protected override void PopulateDefaults()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user