Profile - Tweak initial load timeline behaviour

This commit is contained in:
Robert committed 2021-06-08 23:24:43 +02:00
1 parent 887154d738
commit 730207ccd0
4 files changed
+15 -7

No files matched your search

+6 -4
View File
@@ -99,11 +99,12 @@ namespace Artemis.Core
/// <inheritdoc />
public override void Reset()
{
DisplayConditionMet = false;
Timeline.JumpToEnd();
UpdateDisplayCondition();
foreach (ProfileElement child in Children)
child.Reset();
if (DisplayConditionMet)
Timeline.JumpToStart();
else
Timeline.JumpToEnd();
}
/// <inheritdoc />
@@ -243,6 +244,7 @@ namespace Artemis.Core
internal override void Load()
{
ExpandedPropertyGroups.AddRange(FolderEntity.ExpandedPropertyGroups);
Reset();
// Load child folders
foreach (FolderEntity childFolder in Profile.ProfileEntity.Folders.Where(f => f.ParentId == EntityId))
+6 -2
View File
@@ -329,8 +329,12 @@ namespace Artemis.Core
/// <inheritdoc />
public override void Reset()
{
DisplayConditionMet = false;
Timeline.JumpToEnd();
UpdateDisplayCondition();
if (DisplayConditionMet)
Timeline.JumpToStart();
else
Timeline.JumpToEnd();
}
/// <inheritdoc />
@@ -125,6 +125,7 @@ namespace Artemis.Core
bool stickToMainSegment = Timeline.PlayMode == TimelinePlayMode.Repeat && DisplayConditionMet;
if (DisplayCondition != null && DisplayCondition.ContainsEvents)
stickToMainSegment = false;
Timeline.Update(TimeSpan.FromSeconds(deltaTime), stickToMainSegment);
}
+2 -1
View File
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading;
using Artemis.Storage.Entities.Profile;
namespace Artemis.Core
@@ -322,7 +323,7 @@ namespace Artemis.Core
IsOverridden = false;
_lastOverridePosition = Position;
if (stickToMainSegment && Position > MainSegmentEndPosition)
{
// If the main segment has no length, simply stick to the start of the segment