1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-05 10:33:22 +08:00
This commit is contained in:
Dean Herbert 2024-12-03 16:58:59 +09:00 committed by GitHub
commit f7f6a6aaba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 25 additions and 0 deletions

View File

@ -83,6 +83,11 @@ namespace osu.Game.Screens.Play
/// </summary>
protected virtual bool PauseOnFocusLost => true;
/// <summary>
/// Whether to show the fail overlay (with buttons to retry / exit) on failing.
/// </summary>
protected virtual bool ShowFailOverlay => true;
public Action<bool> RestartRequested;
private bool isRestarting;
@ -1009,6 +1014,9 @@ namespace osu.Game.Screens.Play
/// </summary>
private void onFailComplete()
{
if (!ShowFailOverlay)
return;
GameplayClockContainer.Stop();
FailOverlay.Retries = RestartCount;

View File

@ -11,6 +11,7 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Framework.Screens;
using osu.Game.Beatmaps;
using osu.Game.Configuration;
using osu.Game.Input.Bindings;
@ -34,6 +35,8 @@ namespace osu.Game.Screens.Play
protected override UserActivity InitialActivity => new UserActivity.WatchingReplay(Score.ScoreInfo);
protected override bool ShowFailOverlay => false;
// Disallow replays from failing. (see https://github.com/ppy/osu/issues/6108)
protected override bool CheckModsAllowFailure()
{
@ -157,6 +160,20 @@ namespace osu.Game.Screens.Play
Seek(target);
}
protected override void OnFail()
{
// Replays will always show the results screen on failing.
Scheduler.AddDelayed(() =>
{
if (!this.IsCurrentScreen())
// This player instance may already be in the process of exiting.
return;
ValidForResume = false;
this.Push(CreateResults(Score.ScoreInfo));
}, RESULTS_DISPLAY_DELAY);
}
public void OnReleased(KeyBindingReleaseEvent<GlobalAction> e)
{
}