mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 22:26:41 +09:00
Merge remote-tracking branch 'origin/master' into auto-restart-mod-perfect
# Conflicts: # osu.Game/Screens/Play/Player.cs
This commit is contained in:
@ -86,6 +86,12 @@ namespace osu.Game.Screens.Play
|
||||
[Cached(Type = typeof(IBindable<IReadOnlyList<Mod>>))]
|
||||
protected new readonly Bindable<IReadOnlyList<Mod>> Mods = new Bindable<IReadOnlyList<Mod>>(Array.Empty<Mod>());
|
||||
|
||||
/// <summary>
|
||||
/// Whether failing should be allowed.
|
||||
/// By default, this checks whether all selected mods allow failing.
|
||||
/// </summary>
|
||||
protected virtual bool AllowFail => Mods.Value.OfType<IApplicableFailOverride>().All(m => m.AllowFail);
|
||||
|
||||
private readonly bool allowPause;
|
||||
private readonly bool showResults;
|
||||
|
||||
@ -360,9 +366,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private bool onFail()
|
||||
{
|
||||
var failOverrideMods = Mods.Value.OfType<IApplicableFailOverride>();
|
||||
|
||||
if (failOverrideMods.Any(m => !m.AllowFail))
|
||||
if (!AllowFail)
|
||||
return false;
|
||||
|
||||
HasFailed = true;
|
||||
@ -374,7 +378,8 @@ namespace osu.Game.Screens.Play
|
||||
PauseOverlay.Hide();
|
||||
|
||||
failAnimation.Start();
|
||||
if (failOverrideMods.Any(m => m.RestartOnFail))
|
||||
|
||||
if (Mods.Value.OfType<IApplicableFailOverride>().Any(m => m.RestartOnFail))
|
||||
Restart();
|
||||
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user