Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions fluXis.Import.osu/Storyboards/OsuStoryboardParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public Storyboard Parse(string data)
{
if (initialValues.Add(animation.Type))
{
toAdd.Add(new StoryboardAnimation
toAdd.Add(new StoryboardAnimation(element)
{
Type = animation.Type,
ValueStart = animation.ValueStart,
Expand Down Expand Up @@ -208,7 +208,7 @@ private void parseLine(string line)

buffer = new[]
{
new StoryboardAnimation
new StoryboardAnimation(currentElement)
{
Type = StoryboardAnimationType.Fade,
StartTime = startTime,
Expand All @@ -229,7 +229,7 @@ private void parseLine(string line)

buffer = new[]
{
new StoryboardAnimation
new StoryboardAnimation(currentElement)
{
Type = StoryboardAnimationType.Scale,
StartTime = startTime,
Expand All @@ -252,7 +252,7 @@ private void parseLine(string line)

buffer = new[]
{
new StoryboardAnimation
new StoryboardAnimation(currentElement)
{
Type = StoryboardAnimationType.ScaleVector,
StartTime = startTime,
Expand All @@ -276,7 +276,7 @@ private void parseLine(string line)

buffer = new[]
{
new StoryboardAnimation
new StoryboardAnimation(currentElement)
{
Type = StoryboardAnimationType.Rotate,
StartTime = startTime,
Expand All @@ -299,7 +299,7 @@ private void parseLine(string line)

buffer = new[]
{
new StoryboardAnimation
new StoryboardAnimation(currentElement)
{
Type = StoryboardAnimationType.MoveX,
StartTime = startTime,
Expand All @@ -308,7 +308,7 @@ private void parseLine(string line)
ValueStart = startX.ToStringInvariant(),
ValueEnd = endX.ToStringInvariant()
},
new StoryboardAnimation
new StoryboardAnimation(currentElement)
{
Type = StoryboardAnimationType.MoveY,
StartTime = startTime,
Expand All @@ -329,7 +329,7 @@ private void parseLine(string line)

buffer = new[]
{
new StoryboardAnimation
new StoryboardAnimation(currentElement)
{
Type = StoryboardAnimationType.MoveX,
StartTime = startTime,
Expand All @@ -350,7 +350,7 @@ private void parseLine(string line)

buffer = new[]
{
new StoryboardAnimation
new StoryboardAnimation(currentElement)
{
Type = StoryboardAnimationType.MoveY,
StartTime = startTime,
Expand Down Expand Up @@ -378,7 +378,7 @@ private void parseLine(string line)

buffer = new[]
{
new StoryboardAnimation
new StoryboardAnimation(currentElement)
{
Type = StoryboardAnimationType.Color,
StartTime = startTime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private void load()

private void addNew()
{
var animation = new StoryboardAnimation
var animation = new StoryboardAnimation(Item)
{
StartTime = clock.CurrentTime - Item.StartTime,
ValueStart = getDefault(type),
Expand All @@ -114,7 +114,12 @@ private void remove(StoryboardAnimation animation)
}

private StoryboardAnimationEntry createEntry(StoryboardAnimation anim)
=> new(anim, this, color) { RequestRemove = remove };
{
// Restore the parent reference lost during json deserialization (because of [JsonIgnore] on ParentElement).
anim.ParentElement ??= Item;

return new StoryboardAnimationEntry(anim, this, color) { RequestRemove = remove };
}

private static string getDefault(StoryboardAnimationType type)
{
Expand Down
Loading
Loading