mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Use a more explicit flow to set and reset GameplayClockContainer
start time
This commit is contained in:
@ -607,13 +607,13 @@ namespace osu.Game.Screens.Play
|
||||
private ScheduledDelegate frameStablePlaybackResetDelegate;
|
||||
|
||||
/// <summary>
|
||||
/// Seeks to a specific time in gameplay, bypassing frame stability.
|
||||
/// Specify and seek to a custom start time from which gameplay should be observed.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Intermediate hitobject judgements may not be applied or reverted correctly during this seek.
|
||||
/// This performance a non-frame-stable seek. Intermediate hitobject judgements may not be applied or reverted correctly during this seek.
|
||||
/// </remarks>
|
||||
/// <param name="time">The destination time to seek to.</param>
|
||||
internal void NonFrameStableSeek(double time)
|
||||
protected void SetGameplayStartTime(double time)
|
||||
{
|
||||
if (frameStablePlaybackResetDelegate?.Cancelled == false && !frameStablePlaybackResetDelegate.Completed)
|
||||
frameStablePlaybackResetDelegate.RunTask();
|
||||
@ -621,7 +621,7 @@ namespace osu.Game.Screens.Play
|
||||
bool wasFrameStable = DrawableRuleset.FrameStablePlayback;
|
||||
DrawableRuleset.FrameStablePlayback = false;
|
||||
|
||||
Seek(time);
|
||||
GameplayClockContainer.Reset(gameplayStartTime: time);
|
||||
|
||||
// Delay resetting frame-stable playback for one frame to give the FrameStabilityContainer a chance to seek.
|
||||
frameStablePlaybackResetDelegate = ScheduleAfterChildren(() => DrawableRuleset.FrameStablePlayback = wasFrameStable);
|
||||
@ -981,7 +981,7 @@ namespace osu.Game.Screens.Play
|
||||
if (GameplayClockContainer.GameplayClock.IsRunning)
|
||||
throw new InvalidOperationException($"{nameof(StartGameplay)} should not be called when the gameplay clock is already running");
|
||||
|
||||
GameplayClockContainer.Reset();
|
||||
GameplayClockContainer.Reset(true);
|
||||
}
|
||||
|
||||
public override void OnSuspending(IScreen next)
|
||||
|
Reference in New Issue
Block a user