mirror of
https://github.com/osukey/osukey.git
synced 2025-05-08 23:27:38 +09:00
Fix multiple calls to seek method potentially not working
This commit is contained in:
parent
c3280083a2
commit
be03a2d7d2
@ -583,6 +583,8 @@ namespace osu.Game.Screens.Play
|
|||||||
/// <param name="time">The destination time to seek to.</param>
|
/// <param name="time">The destination time to seek to.</param>
|
||||||
public void Seek(double time) => GameplayClockContainer.Seek(time);
|
public void Seek(double time) => GameplayClockContainer.Seek(time);
|
||||||
|
|
||||||
|
private ScheduledDelegate frameStablePlaybackResetDelegate;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Seeks to a specific time in gameplay, bypassing frame stability.
|
/// Seeks to a specific time in gameplay, bypassing frame stability.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -592,13 +594,16 @@ namespace osu.Game.Screens.Play
|
|||||||
/// <param name="time">The destination time to seek to.</param>
|
/// <param name="time">The destination time to seek to.</param>
|
||||||
public void NonFrameStableSeek(double time)
|
public void NonFrameStableSeek(double time)
|
||||||
{
|
{
|
||||||
|
if (frameStablePlaybackResetDelegate?.Cancelled == false && !frameStablePlaybackResetDelegate.Completed)
|
||||||
|
frameStablePlaybackResetDelegate.RunTask();
|
||||||
|
|
||||||
bool wasFrameStable = DrawableRuleset.FrameStablePlayback;
|
bool wasFrameStable = DrawableRuleset.FrameStablePlayback;
|
||||||
DrawableRuleset.FrameStablePlayback = false;
|
DrawableRuleset.FrameStablePlayback = false;
|
||||||
|
|
||||||
Seek(time);
|
Seek(time);
|
||||||
|
|
||||||
// Delay resetting frame-stable playback for one frame to give the FrameStabilityContainer a chance to seek.
|
// Delay resetting frame-stable playback for one frame to give the FrameStabilityContainer a chance to seek.
|
||||||
ScheduleAfterChildren(() => DrawableRuleset.FrameStablePlayback = wasFrameStable);
|
frameStablePlaybackResetDelegate = ScheduleAfterChildren(() => DrawableRuleset.FrameStablePlayback = wasFrameStable);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -931,11 +936,10 @@ namespace osu.Game.Screens.Play
|
|||||||
/// Creates the player's <see cref="Scoring.Score"/>.
|
/// Creates the player's <see cref="Scoring.Score"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The <see cref="Scoring.Score"/>.</returns>
|
/// <returns>The <see cref="Scoring.Score"/>.</returns>
|
||||||
protected virtual Score CreateScore() =>
|
protected virtual Score CreateScore() => new Score
|
||||||
new Score
|
{
|
||||||
{
|
ScoreInfo = new ScoreInfo { User = api.LocalUser.Value },
|
||||||
ScoreInfo = new ScoreInfo { User = api.LocalUser.Value },
|
};
|
||||||
};
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Imports the player's <see cref="Scoring.Score"/> to the local database.
|
/// Imports the player's <see cref="Scoring.Score"/> to the local database.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user