1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 02:43:19 +08:00

Ensure editor test player is exited on completion

This commit is contained in:
Bartłomiej Dach 2021-11-11 15:25:58 +01:00
parent 6ce1a78723
commit 385df51b06
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497
2 changed files with 12 additions and 2 deletions

View File

@ -106,8 +106,7 @@ namespace osu.Game.Tests.Visual.Editing
EditorPlayer editorPlayer = null;
AddUntilStep("player pushed", () => (editorPlayer = Stack.CurrentScreen as EditorPlayer) != null);
AddAssert("beatmap has 1 object", () => editorPlayer.Beatmap.Value.Beatmap.HitObjects.Count == 1);
AddStep("exit player", () => editorPlayer.Exit());
AddUntilStep("current screen is editor", () => Stack.CurrentScreen is Editor);
AddUntilStep("wait for return to editor", () => Stack.CurrentScreen is Editor);
}
public override void TearDownSteps()

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Screens;
using osu.Game.Screens.Play;
namespace osu.Game.Screens.Edit
@ -12,6 +13,16 @@ namespace osu.Game.Screens.Edit
{
}
protected override void LoadComplete()
{
base.LoadComplete();
ScoreProcessor.HasCompleted.BindValueChanged(completed =>
{
if (completed.NewValue)
Scheduler.AddDelayed(this.Exit, RESULTS_DISPLAY_DELAY);
});
}
protected override void PrepareReplay()
{
// don't record replays.