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

Profile - Tweak initial load timeline behaviour

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

View File

@ -99,11 +99,12 @@ namespace Artemis.Core
/// <inheritdoc /> /// <inheritdoc />
public override void Reset() public override void Reset()
{ {
DisplayConditionMet = false; UpdateDisplayCondition();
Timeline.JumpToEnd();
foreach (ProfileElement child in Children) if (DisplayConditionMet)
child.Reset(); Timeline.JumpToStart();
else
Timeline.JumpToEnd();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -243,6 +244,7 @@ namespace Artemis.Core
internal override void Load() internal override void Load()
{ {
ExpandedPropertyGroups.AddRange(FolderEntity.ExpandedPropertyGroups); ExpandedPropertyGroups.AddRange(FolderEntity.ExpandedPropertyGroups);
Reset();
// Load child folders // Load child folders
foreach (FolderEntity childFolder in Profile.ProfileEntity.Folders.Where(f => f.ParentId == EntityId)) foreach (FolderEntity childFolder in Profile.ProfileEntity.Folders.Where(f => f.ParentId == EntityId))

View File

@ -329,7 +329,11 @@ namespace Artemis.Core
/// <inheritdoc /> /// <inheritdoc />
public override void Reset() public override void Reset()
{ {
DisplayConditionMet = false; UpdateDisplayCondition();
if (DisplayConditionMet)
Timeline.JumpToStart();
else
Timeline.JumpToEnd(); Timeline.JumpToEnd();
} }

View File

@ -125,6 +125,7 @@ namespace Artemis.Core
bool stickToMainSegment = Timeline.PlayMode == TimelinePlayMode.Repeat && DisplayConditionMet; bool stickToMainSegment = Timeline.PlayMode == TimelinePlayMode.Repeat && DisplayConditionMet;
if (DisplayCondition != null && DisplayCondition.ContainsEvents) if (DisplayCondition != null && DisplayCondition.ContainsEvents)
stickToMainSegment = false; stickToMainSegment = false;
Timeline.Update(TimeSpan.FromSeconds(deltaTime), stickToMainSegment); Timeline.Update(TimeSpan.FromSeconds(deltaTime), stickToMainSegment);
} }

View File

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Linq; using System.Linq;
using System.Threading;
using Artemis.Storage.Entities.Profile; using Artemis.Storage.Entities.Profile;
namespace Artemis.Core namespace Artemis.Core