2019-06-04 15:13:16 +08:00
|
|
|
// 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 System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osu.Game.Rulesets;
|
|
|
|
using osu.Game.Rulesets.Mods;
|
|
|
|
using osu.Game.Screens.Play;
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Gameplay
|
|
|
|
{
|
|
|
|
public class TestSceneFailAnimation : AllPlayersTestScene
|
|
|
|
{
|
|
|
|
protected override Player CreatePlayer(Ruleset ruleset)
|
|
|
|
{
|
2019-12-13 20:45:38 +08:00
|
|
|
SelectedMods.Value = Array.Empty<Mod>();
|
2019-06-04 15:13:16 +08:00
|
|
|
return new FailPlayer();
|
|
|
|
}
|
|
|
|
|
|
|
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
|
|
|
{
|
|
|
|
typeof(AllPlayersTestScene),
|
|
|
|
typeof(TestPlayer),
|
|
|
|
typeof(Player),
|
|
|
|
};
|
|
|
|
|
|
|
|
protected override void AddCheckSteps()
|
|
|
|
{
|
|
|
|
AddUntilStep("wait for fail", () => Player.HasFailed);
|
2019-06-11 13:28:52 +08:00
|
|
|
AddUntilStep("wait for fail overlay", () => ((FailPlayer)Player).FailOverlay.State.Value == Visibility.Visible);
|
2019-06-04 15:13:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
private class FailPlayer : TestPlayer
|
|
|
|
{
|
|
|
|
public new FailOverlay FailOverlay => base.FailOverlay;
|
|
|
|
|
|
|
|
public FailPlayer()
|
|
|
|
: base(false, false)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
{
|
|
|
|
base.LoadComplete();
|
2019-06-21 13:29:16 +08:00
|
|
|
ScoreProcessor.FailConditions += (_, __) => true;
|
2019-06-04 15:13:16 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|