mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 08:52:55 +08:00
Merge pull request #22532 from peppy/fix-long-storyboard-outro
Fix storyboard outro time potentially running too long
This commit is contained in:
commit
12f6d461b9
@ -214,7 +214,9 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
||||
Assert.That(oneTime.EndTime, Is.EqualTo(4000 + loop_duration));
|
||||
|
||||
StoryboardSprite manyTimes = background.Elements.OfType<StoryboardSprite>().Single(s => s.Path == "many-times.png");
|
||||
Assert.That(manyTimes.EndTime, Is.EqualTo(9000 + 40 * loop_duration));
|
||||
// It is intentional that we don't consider the loop count (40) as part of the end time calculation to match stable's handling.
|
||||
// If we were to include the loop count, storyboards which loop for stupid long loop counts would continue playing the outro forever.
|
||||
Assert.That(manyTimes.EndTime, Is.EqualTo(9000 + loop_duration));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,12 @@ namespace osu.Game.Storyboards
|
||||
public readonly int TotalIterations;
|
||||
|
||||
public override double StartTime => LoopStartTime + CommandsStartTime;
|
||||
public override double EndTime => StartTime + CommandsDuration * TotalIterations;
|
||||
|
||||
public override double EndTime =>
|
||||
// In an ideal world, we would multiply the command duration by TotalIterations here.
|
||||
// Unfortunately this would clash with how stable handled end times, and results in some storyboards playing outro
|
||||
// sequences for minutes or hours.
|
||||
StartTime + CommandsDuration;
|
||||
|
||||
/// <summary>
|
||||
/// Construct a new command loop.
|
||||
|
@ -84,9 +84,6 @@ namespace osu.Game.Storyboards
|
||||
[JsonIgnore]
|
||||
public virtual double EndTime => CommandsEndTime;
|
||||
|
||||
[JsonIgnore]
|
||||
public double Duration => EndTime - StartTime;
|
||||
|
||||
[JsonIgnore]
|
||||
public bool HasCommands
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user