mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 09:32:55 +08:00
Update failing test coverage and fix onFail
being called too often
This commit is contained in:
parent
4ad3cb3b49
commit
ef5dd24589
@ -179,7 +179,6 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
addFakeHit();
|
addFakeHit();
|
||||||
|
|
||||||
AddUntilStep("wait for fail", () => Player.GameplayState.HasFailed);
|
AddUntilStep("wait for fail", () => Player.GameplayState.HasFailed);
|
||||||
AddStep("exit", () => Player.Exit());
|
|
||||||
|
|
||||||
AddUntilStep("wait for submission", () => Player.SubmittedScore != null);
|
AddUntilStep("wait for submission", () => Player.SubmittedScore != null);
|
||||||
AddAssert("ensure failing submission", () => Player.SubmittedScore.ScoreInfo.Passed == false);
|
AddAssert("ensure failing submission", () => Player.SubmittedScore.ScoreInfo.Passed == false);
|
||||||
|
@ -933,6 +933,7 @@ namespace osu.Game.Screens.Play
|
|||||||
if (GameplayState.Mods.OfType<IApplicableFailOverride>().Any(m => m.RestartOnFail))
|
if (GameplayState.Mods.OfType<IApplicableFailOverride>().Any(m => m.RestartOnFail))
|
||||||
Restart(true);
|
Restart(true);
|
||||||
|
|
||||||
|
OnFail();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,8 +54,6 @@ namespace osu.Game.Screens.Play
|
|||||||
}
|
}
|
||||||
|
|
||||||
AddInternal(new PlayerTouchInputDetector());
|
AddInternal(new PlayerTouchInputDetector());
|
||||||
|
|
||||||
HealthProcessor.Failed += onFail;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadAsyncComplete()
|
protected override void LoadAsyncComplete()
|
||||||
@ -167,10 +165,11 @@ namespace osu.Game.Screens.Play
|
|||||||
spectatorClient.BeginPlaying(token, GameplayState, Score);
|
spectatorClient.BeginPlaying(token, GameplayState, Score);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool onFail()
|
protected override void OnFail()
|
||||||
{
|
{
|
||||||
|
base.OnFail();
|
||||||
|
|
||||||
submitFromFailOrQuit();
|
submitFromFailOrQuit();
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool OnExiting(ScreenExitEvent e)
|
public override bool OnExiting(ScreenExitEvent e)
|
||||||
|
Loading…
Reference in New Issue
Block a user