1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 13:22:55 +08:00

Add handling for miss judgements in HealthDisplay

This commit is contained in:
Salman Ahmed 2023-10-01 00:21:12 +03:00
parent 869f8e5e1b
commit 33b0cb15a8

View File

@ -29,10 +29,22 @@ namespace osu.Game.Screens.Play.HUD
MaxValue = 1
};
/// <summary>
/// Triggered when a <see cref="Judgement"/> is a successful hit, signaling the health display to perform a flash animation (if designed to do so).
/// </summary>
/// <param name="result">The judgement result.</param>
protected virtual void Flash(JudgementResult result)
{
}
/// <summary>
/// Triggered when a <see cref="Judgement"/> resulted in the player losing health.
/// </summary>
/// <param name="result">The judgement result.</param>
protected virtual void Miss(JudgementResult result)
{
}
[Resolved]
private HUDOverlay? hudOverlay { get; set; }
@ -54,6 +66,8 @@ namespace osu.Game.Screens.Play.HUD
{
if (judgement.IsHit && judgement.Type != HitResult.IgnoreHit)
Flash(judgement);
else if (judgement.Judgement.HealthIncreaseFor(judgement) < 0)
Miss(judgement);
}
protected override void Dispose(bool isDisposing)