Folders - When display mode set to finish, finish all child timelines

Data bindings - Fixed an exception on profile editor undo
Timeline - Added segment options dialog where you can enter a time
This commit is contained in:
SpoinkyNL committed 2020-09-18 22:19:12 +02:00
1 parent 02e8441755
commit d78cc84b1b
18 files changed
+369 -102

No files matched your search

@@ -19,6 +19,23 @@ namespace Artemis.Core
LayerEffectStore.LayerEffectRemoved += LayerEffectStoreOnLayerEffectRemoved;
}
public abstract List<ILayerProperty> GetAllLayerProperties();
#region IDisposable
protected override void Dispose(bool disposing)
{
LayerEffectStore.LayerEffectAdded -= LayerEffectStoreOnLayerEffectAdded;
LayerEffectStore.LayerEffectRemoved -= LayerEffectStoreOnLayerEffectRemoved;
foreach (var baseLayerEffect in LayerEffects)
baseLayerEffect.Dispose();
base.Dispose(disposing);
}
#endregion
internal void ApplyRenderElementDefaults()
{
MainSegmentLength = TimeSpan.FromSeconds(5);
@@ -135,7 +152,13 @@ namespace Artemis.Core
public TimeSpan StartSegmentLength
{
get => _startSegmentLength;
set => SetAndNotify(ref _startSegmentLength, value);
set
{
if (!SetAndNotify(ref _startSegmentLength, value)) return;
UpdateTimelineLength();
if (Parent is RenderProfileElement renderElement)
renderElement.UpdateTimelineLength();
}
}
/// <summary>
@@ -144,7 +167,13 @@ namespace Artemis.Core
public TimeSpan MainSegmentLength
{
get => _mainSegmentLength;
set => SetAndNotify(ref _mainSegmentLength, value);
set
{
if (!SetAndNotify(ref _mainSegmentLength, value)) return;
UpdateTimelineLength();
if (Parent is RenderProfileElement renderElement)
renderElement.UpdateTimelineLength();
}
}
/// <summary>
@@ -153,7 +182,13 @@ namespace Artemis.Core
public TimeSpan EndSegmentLength
{
get => _endSegmentLength;
set => SetAndNotify(ref _endSegmentLength, value);
set
{
if (!SetAndNotify(ref _endSegmentLength, value)) return;
UpdateTimelineLength();
if (Parent is RenderProfileElement renderElement)
renderElement.UpdateTimelineLength();
}
}
/// <summary>
@@ -165,11 +200,6 @@ namespace Artemis.Core
protected set => SetAndNotify(ref _timelinePosition, value);
}
/// <summary>
/// Gets the total combined length of all three segments
/// </summary>
public TimeSpan TimelineLength => StartSegmentLength + MainSegmentLength + EndSegmentLength;
/// <summary>
/// Gets or sets whether main timeline should repeat itself as long as display conditions are met
/// </summary>
@@ -188,6 +218,11 @@ namespace Artemis.Core
set => SetAndNotify(ref _alwaysFinishTimeline, value);
}
/// <summary>
/// Gets the max length of this element and any of its children
/// </summary>
public TimeSpan TimelineLength { get; protected set; }
protected double UpdateTimeline(double deltaTime)
{
var oldPosition = _timelinePosition;
@@ -195,7 +230,6 @@ namespace Artemis.Core
var mainSegmentEnd = StartSegmentLength + MainSegmentLength;
TimelinePosition += deltaTimeSpan;
// Manage segments while the condition is met
if (DisplayConditionMet)
{
@@ -213,6 +247,8 @@ namespace Artemis.Core
return (TimelinePosition - oldPosition).TotalSeconds;
}
protected internal abstract void UpdateTimelineLength();
/// <summary>
/// Overrides the progress of the element
/// </summary>
@@ -380,21 +416,6 @@ namespace Artemis.Core
#endregion
#region IDisposable
protected override void Dispose(bool disposing)
{
LayerEffectStore.LayerEffectAdded -= LayerEffectStoreOnLayerEffectAdded;
LayerEffectStore.LayerEffectRemoved -= LayerEffectStoreOnLayerEffectRemoved;
foreach (var baseLayerEffect in LayerEffects)
baseLayerEffect.Dispose();
base.Dispose(disposing);
}
#endregion
#region Events
public event EventHandler LayerEffectsUpdated;