Modules - Improved override behavior when activation reqs are met

Profile editor - Fixed error when pressing play without a selected element
This commit is contained in:
SpoinkyNL committed 2020-09-27 22:09:28 +02:00
1 parent fc91fd7225
commit e30e37e8e3
2 files changed
+38 -19

No files matched your search

@@ -562,20 +562,23 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties
Execute.PostToUIThread(() =>
{
var newTime = ProfileEditorService.CurrentTime.Add(TimeSpan.FromSeconds(e.DeltaTime));
if (Repeating && RepeatTimeline)
if (SelectedProfileElement != null)
{
if (newTime > SelectedProfileElement.TimelineLength)
newTime = TimeSpan.Zero;
}
else if (Repeating && RepeatSegment)
{
if (newTime > GetCurrentSegmentEnd())
newTime = GetCurrentSegmentStart();
}
else if (newTime > SelectedProfileElement.TimelineLength)
{
newTime = SelectedProfileElement.TimelineLength;
Pause();
if (Repeating && RepeatTimeline)
{
if (newTime > SelectedProfileElement.TimelineLength)
newTime = TimeSpan.Zero;
}
else if (Repeating && RepeatSegment)
{
if (newTime > GetCurrentSegmentEnd())
newTime = GetCurrentSegmentStart();
}
else if (newTime > SelectedProfileElement.TimelineLength)
{
newTime = SelectedProfileElement.TimelineLength;
Pause();
}
}
ProfileEditorService.CurrentTime = newTime;