Add fail dialog and flow.

This commit is contained in:
Dean Herbert
2017-01-20 15:51:43 +08:00
parent 1d24ad3db6
commit 139cac5e57
5 changed files with 89 additions and 6 deletions

View File

@ -30,6 +30,22 @@ namespace osu.Game.Modes
public readonly BindableInt Combo = new BindableInt();
/// <summary>
/// Are we allowed to fail?
/// </summary>
protected bool CanFail => true;
protected bool HasFailed;
/// <summary>
/// Called when we reach a failing health of zero.
/// </summary>
public event Action Failed;
/// <summary>
/// Keeps track of the highest combo ever achieved in this play.
/// This is handled automatically by ScoreProcessor.
/// </summary>
public readonly BindableInt HighestCombo = new BindableInt();
public readonly List<JudgementInfo> Judgements;
@ -51,6 +67,11 @@ namespace osu.Game.Modes
UpdateCalculations(judgement);
judgement.ComboAtHit = (ulong)Combo.Value;
if (Health.Value == Health.MinValue && !HasFailed)
{
HasFailed = true;
Failed?.Invoke();
}
}
/// <summary>