1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Keyframes - If needed enable keyframes on properties when pasting

This commit is contained in:
SpoinkyNL 2020-12-03 19:48:03 +01:00
parent 408916ea6a
commit 5b0e1c91dd
3 changed files with 11 additions and 0 deletions

View File

@ -276,6 +276,9 @@ namespace Artemis.Core
keyframe.LayerProperty = this; keyframe.LayerProperty = this;
_keyframes.Add(keyframe); _keyframes.Add(keyframe);
if (!KeyframesEnabled)
KeyframesEnabled = true;
SortKeyframes(); SortKeyframes();
OnKeyframeAdded(); OnKeyframeAdded();
} }

View File

@ -87,6 +87,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline
private void UpdateKeyframes() private void UpdateKeyframes()
{ {
NotifyOfPropertyChange(nameof(LayerProperty.KeyframesEnabled));
// Only show keyframes if they are enabled // Only show keyframes if they are enabled
if (LayerProperty.KeyframesEnabled) if (LayerProperty.KeyframesEnabled)
{ {

View File

@ -23,6 +23,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree
LayerProperty.VisibilityChanged += LayerPropertyOnVisibilityChanged; LayerProperty.VisibilityChanged += LayerPropertyOnVisibilityChanged;
LayerProperty.DataBindingEnabled += LayerPropertyOnDataBindingChange; LayerProperty.DataBindingEnabled += LayerPropertyOnDataBindingChange;
LayerProperty.DataBindingDisabled += LayerPropertyOnDataBindingChange; LayerProperty.DataBindingDisabled += LayerPropertyOnDataBindingChange;
LayerProperty.KeyframesToggled += LayerPropertyOnKeyframesToggled;
LayerPropertyViewModel.IsVisible = !LayerProperty.IsHidden; LayerPropertyViewModel.IsVisible = !LayerProperty.IsHidden;
} }
@ -100,6 +101,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree
LayerProperty.VisibilityChanged -= LayerPropertyOnVisibilityChanged; LayerProperty.VisibilityChanged -= LayerPropertyOnVisibilityChanged;
LayerProperty.DataBindingEnabled -= LayerPropertyOnDataBindingChange; LayerProperty.DataBindingEnabled -= LayerPropertyOnDataBindingChange;
LayerProperty.DataBindingDisabled -= LayerPropertyOnDataBindingChange; LayerProperty.DataBindingDisabled -= LayerPropertyOnDataBindingChange;
LayerProperty.KeyframesToggled -= LayerPropertyOnKeyframesToggled;
} }
#endregion #endregion
@ -121,6 +123,11 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree
NotifyOfPropertyChange(nameof(HasDataBinding)); NotifyOfPropertyChange(nameof(HasDataBinding));
} }
private void LayerPropertyOnKeyframesToggled(object sender, LayerPropertyEventArgs<T> e)
{
NotifyOfPropertyChange(nameof(KeyframesEnabled));
}
#endregion #endregion
} }