mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 08:27:49 +08:00
Fix storyboard incorrectly re-ordering elements (#7302)
Fix storyboard incorrectly re-ordering elements
This commit is contained in:
commit
ce41be59aa
@ -71,7 +71,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
Assert.AreEqual(new Vector2(320, 240), sprite.InitialPosition);
|
Assert.AreEqual(new Vector2(320, 240), sprite.InitialPosition);
|
||||||
Assert.IsTrue(sprite.IsDrawable);
|
Assert.IsTrue(sprite.IsDrawable);
|
||||||
Assert.AreEqual(Anchor.Centre, sprite.Origin);
|
Assert.AreEqual(Anchor.Centre, sprite.Origin);
|
||||||
Assert.AreEqual("SB/black.jpg", sprite.Path);
|
Assert.AreEqual("SB/lyric/ja-21.png", sprite.Path);
|
||||||
|
|
||||||
var animation = background.Elements.OfType<StoryboardAnimation>().First();
|
var animation = background.Elements.OfType<StoryboardAnimation>().First();
|
||||||
Assert.NotNull(animation);
|
Assert.NotNull(animation);
|
||||||
|
@ -5,7 +5,6 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
using osu.Framework.Extensions;
|
using osu.Framework.Extensions;
|
||||||
@ -42,10 +41,6 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
{
|
{
|
||||||
this.storyboard = storyboard;
|
this.storyboard = storyboard;
|
||||||
base.ParseStreamInto(stream, storyboard);
|
base.ParseStreamInto(stream, storyboard);
|
||||||
|
|
||||||
// OrderBy is used to guarantee that the parsing order of elements with equal start times is maintained (stably-sorted)
|
|
||||||
foreach (StoryboardLayer layer in storyboard.Layers)
|
|
||||||
layer.Elements = layer.Elements.OrderBy(h => h.StartTime).ToList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void ParseLine(Storyboard storyboard, Section section, string line)
|
protected override void ParseLine(Storyboard storyboard, Section section, string line)
|
||||||
|
Loading…
Reference in New Issue
Block a user