Profile editor - Reimplemented a way to get all keyframe times

New implementation does not add clutter to the core
This commit is contained in:
SpoinkyNL committed 2020-09-12 10:39:44 +02:00
1 parent 952e28c9b9
commit af133a5881
6 files changed
+63 -39

No files matched your search

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using Artemis.Core;
using Artemis.UI.Ninject.Factories;
using Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree;
@@ -69,5 +70,28 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties
disposableChild.Dispose();
}
}
public void UpdateOrder(int order)
{
LayerPropertyGroup.LayerEffect.Order = order;
NotifyOfPropertyChange(nameof(IsExpanded));
}
public List<TimeSpan> GetAllKeyframePositions(bool expandedOnly)
{
var result = new List<TimeSpan>();
if (expandedOnly == IsExpanded)
return result;
foreach (var child in Children)
{
if (child is LayerPropertyViewModel layerPropertyViewModel)
result.AddRange(layerPropertyViewModel.LayerPropertyTimelineViewModel.GetAllKeyframePositions());
else if (child is LayerPropertyGroupViewModel layerPropertyGroupViewModel)
result.AddRange(layerPropertyGroupViewModel.GetAllKeyframePositions(expandedOnly));
}
return result;
}
}
}