1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 01:27:29 +08:00

Use WaitingOnFrames instead

This commit is contained in:
Dan Balasescu 2022-06-21 12:23:41 +09:00
parent 98d69c846c
commit b3e5642dfd

View File

@ -45,6 +45,20 @@ namespace osu.Game.Screens.Play
});
}
protected override void LoadComplete()
{
base.LoadComplete();
DrawableRuleset.FrameStableClock.WaitingOnFrames.BindValueChanged(waiting =>
{
if (GameplayClockContainer is MasterGameplayClockContainer master)
{
if (master.UserPlaybackRate.Value > 1 && waiting.NewValue)
master.UserPlaybackRate.Value = 1;
}
}, true);
}
protected override void StartGameplay()
{
base.StartGameplay();
@ -83,18 +97,6 @@ namespace osu.Game.Screens.Play
SetGameplayStartTime(score.Replay.Frames[0].Time);
}
protected override void Update()
{
base.Update();
if (HUDOverlay.PlayerSettingsOverlay.PlaybackSettings.UserPlaybackRate.Value > 1
&& score.Replay.Frames.Count > 0
&& DrawableRuleset.FrameStableClock.CurrentTime >= score.Replay.Frames[^1].Time)
{
HUDOverlay.PlayerSettingsOverlay.PlaybackSettings.UserPlaybackRate.Value = 1;
}
}
protected override Score CreateScore(IBeatmap beatmap) => score;
protected override ResultsScreen CreateResults(ScoreInfo score)