Move seekOffset back to MasterGameplayClockContainer

This commit is contained in:
smoogipoo 2021-04-20 18:25:46 +09:00
parent a683e5ec34
commit ec080fcb32
2 changed files with 10 additions and 9 deletions

View File

@ -29,11 +29,6 @@ namespace osu.Game.Screens.Play
/// </summary>
protected readonly DecoupleableInterpolatingFramedClock AdjustableSource;
/// <summary>
/// The offset at which to start playing. Affects the time which the clock is reset to via <see cref="Reset"/>.
/// </summary>
protected virtual double StartOffset => 0;
/// <summary>
/// The source clock.
/// </summary>
@ -105,7 +100,7 @@ namespace osu.Game.Screens.Play
/// </summary>
public virtual void Reset()
{
Seek(StartOffset);
Seek(0);
// Manually stop the source in order to not affect the IsPaused state.
AdjustableSource.Stop();

View File

@ -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<double> 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<bool> 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.