mirror of https://github.com/ppy/osu
Fix lead-in logic to match stable
Also adds storyboard event priority support.
This commit is contained in:
parent
d1d1c4ee7a
commit
e03a664970
|
@ -34,7 +34,6 @@ public GameplayClock(IFrameBasedClock underlyingClock)
|
|||
public void ProcessFrame()
|
||||
{
|
||||
// we do not want to process the underlying clock.
|
||||
// this is handled by PauseContainer.
|
||||
}
|
||||
|
||||
public double ElapsedFrameTime => underlyingClock.ElapsedFrameTime;
|
||||
|
|
|
@ -99,7 +99,13 @@ private void load(OsuConfigManager config)
|
|||
userAudioOffset = config.GetBindable<double>(OsuSetting.AudioOffset);
|
||||
userAudioOffset.BindValueChanged(offset => userOffsetClock.Offset = offset.NewValue, true);
|
||||
|
||||
adjustableClock.Seek(Math.Min(0, gameplayStartTime - totalOffset - (allowLeadIn ? beatmap.BeatmapInfo.AudioLeadIn : 0)));
|
||||
double startTime = -beatmap.BeatmapInfo.AudioLeadIn;
|
||||
|
||||
startTime = Math.Min(startTime, beatmap.Storyboard.FirstEventTime);
|
||||
startTime = Math.Min(startTime, gameplayStartTime);
|
||||
startTime = Math.Min(startTime, 0);
|
||||
|
||||
Seek(startTime);
|
||||
adjustableClock.ProcessFrame();
|
||||
|
||||
UserPlaybackRate.ValueChanged += _ => updateRate();
|
||||
|
|
|
@ -17,6 +17,8 @@ public class Storyboard
|
|||
|
||||
public bool HasDrawable => Layers.Any(l => l.Elements.Any(e => e.IsDrawable));
|
||||
|
||||
public double FirstEventTime => Layers.Min(l => l.Elements.FirstOrDefault()?.StartTime ?? 0);
|
||||
|
||||
public Storyboard()
|
||||
{
|
||||
layers.Add("Background", new StoryboardLayer("Background", 3));
|
||||
|
|
Loading…
Reference in New Issue