1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

Base wait steps duration on the delay used for results display

With `* 2` for safety of not potentially going to the next step and the delegate not executed yet.
This commit is contained in:
Salman Ahmed 2020-04-20 06:42:33 +03:00
parent 6f233917b1
commit e12e3391fb
2 changed files with 11 additions and 2 deletions

View File

@ -24,6 +24,9 @@ namespace osu.Game.Tests.Visual.Gameplay
[Resolved]
private AudioManager audio { get; set; }
private int resultsDisplayWaitCount =>
(int)((Screens.Play.Player.RESULTS_DISPLAY_DELAY / TimePerAction) * 2);
protected override bool AllowFail => false;
public TestSceneCompletionCancellation()
@ -83,7 +86,8 @@ namespace osu.Game.Tests.Visual.Gameplay
AddStep("rewind to cancel", () => track.Seek(4000));
AddUntilStep("completion cleared by processor", () => !Player.ScoreProcessor.HasCompleted.Value);
AddWaitStep("wait", 5);
// wait to ensure there was no attempt of pushing the results screen.
AddWaitStep("wait", resultsDisplayWaitCount);
}
protected override WorkingBeatmap CreateWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard = null)

View File

@ -37,6 +37,11 @@ namespace osu.Game.Screens.Play
[Cached]
public class Player : ScreenWithBeatmapBackground
{
/// <summary>
/// The delay upon completion of the beatmap before displaying the results screen.
/// </summary>
public const double RESULTS_DISPLAY_DELAY = 1000.0;
public override bool AllowBackButton => false; // handled by HoldForMenuButton
protected override UserActivity InitialActivity => new UserActivity.SoloGame(Beatmap.Value.BeatmapInfo, Ruleset.Value);
@ -436,7 +441,7 @@ namespace osu.Game.Screens.Play
if (!showResults) return;
using (BeginDelayedSequence(1000))
using (BeginDelayedSequence(RESULTS_DISPLAY_DELAY))
scheduleGotoRanking();
}