mirror of
https://github.com/ppy/osu.git
synced 2024-12-05 02:53:21 +08:00
Merge 8f7d2752c0
into f09d8f097a
This commit is contained in:
commit
bb5a9b8606
@ -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;
|
||||
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user