mirror of
https://github.com/ppy/osu.git
synced 2025-03-05 11:43:01 +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));
|
Assert.That(oneTime.EndTime, Is.EqualTo(4000 + loop_duration));
|
||||||
|
|
||||||
StoryboardSprite manyTimes = background.Elements.OfType<StoryboardSprite>().Single(s => s.Path == "many-times.png");
|
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 readonly int TotalIterations;
|
||||||
|
|
||||||
public override double StartTime => LoopStartTime + CommandsStartTime;
|
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>
|
/// <summary>
|
||||||
/// Construct a new command loop.
|
/// Construct a new command loop.
|
||||||
|
@ -84,9 +84,6 @@ namespace osu.Game.Storyboards
|
|||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public virtual double EndTime => CommandsEndTime;
|
public virtual double EndTime => CommandsEndTime;
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public double Duration => EndTime - StartTime;
|
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public bool HasCommands
|
public bool HasCommands
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user