From ec080fcb32fdf2fa1ca7fd4b2d8db1c7a4d2ffc7 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 20 Apr 2021 18:25:46 +0900 Subject: [PATCH] Move seekOffset back to MasterGameplayClockContainer --- osu.Game/Screens/Play/GameplayClockContainer.cs | 7 +------ .../Screens/Play/MasterGameplayClockContainer.cs | 12 +++++++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/osu.Game/Screens/Play/GameplayClockContainer.cs b/osu.Game/Screens/Play/GameplayClockContainer.cs index e9a9c83119..5cd17d92c4 100644 --- a/osu.Game/Screens/Play/GameplayClockContainer.cs +++ b/osu.Game/Screens/Play/GameplayClockContainer.cs @@ -29,11 +29,6 @@ namespace osu.Game.Screens.Play /// protected readonly DecoupleableInterpolatingFramedClock AdjustableSource; - /// - /// The offset at which to start playing. Affects the time which the clock is reset to via . - /// - protected virtual double StartOffset => 0; - /// /// The source clock. /// @@ -105,7 +100,7 @@ namespace osu.Game.Screens.Play /// public virtual void Reset() { - Seek(StartOffset); + Seek(0); // Manually stop the source in order to not affect the IsPaused state. AdjustableSource.Stop(); diff --git a/osu.Game/Screens/Play/MasterGameplayClockContainer.cs b/osu.Game/Screens/Play/MasterGameplayClockContainer.cs index 1b893a76c5..affe24069d 100644 --- a/osu.Game/Screens/Play/MasterGameplayClockContainer.cs +++ b/osu.Game/Screens/Play/MasterGameplayClockContainer.cs @@ -47,9 +47,6 @@ namespace osu.Game.Screens.Play private readonly BindableDouble pauseFreqAdjust = new BindableDouble(1); - protected override double StartOffset => startOffset; - private double startOffset; - private readonly WorkingBeatmap beatmap; private readonly double gameplayStartTime; private readonly bool startAtGameplayStart; @@ -59,6 +56,7 @@ namespace osu.Game.Screens.Play private FramedOffsetClock platformOffsetClock; private LocalGameplayClock localGameplayClock; private Bindable userAudioOffset; + private double startOffset; public MasterGameplayClockContainer(WorkingBeatmap beatmap, double gameplayStartTime, bool startAtGameplayStart = false) : base(beatmap.Track) @@ -94,6 +92,8 @@ namespace osu.Game.Screens.Play if (beatmap.BeatmapInfo.AudioLeadIn > 0) startOffset = Math.Min(startOffset, firstHitObjectTime - beatmap.BeatmapInfo.AudioLeadIn); } + + Seek(startOffset); } protected override void OnIsPausedChanged(ValueChangedEvent isPaused) @@ -142,6 +142,12 @@ namespace osu.Game.Screens.Play Seek(skipTarget); } + public override void Reset() + { + base.Reset(); + Seek(startOffset); + } + protected override GameplayClock CreateGameplayClock(IFrameBasedClock source) { // Lazer's audio timings in general doesn't match stable. This is the result of user testing, albeit limited.