Fix lead-in logic to match stable

Also adds storyboard event priority support.
This commit is contained in:
Dean Herbert 2019-03-26 16:18:15 +09:00
parent d1d1c4ee7a
commit e03a664970
3 changed files with 9 additions and 2 deletions

View File

@ -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;

View File

@ -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();

View File

@ -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));