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 />
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))

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 />

View File

@ -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);
}

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