1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

Move "flash on hit only" logic to binding

This commit is contained in:
Dean Herbert 2020-10-16 14:49:05 +09:00
parent 5be9e30cd0
commit a810f56ec8
2 changed files with 9 additions and 9 deletions

View File

@ -107,13 +107,7 @@ namespace osu.Game.Screens.Play.HUD
GlowColour = colours.BlueDarker;
}
public override void Flash(JudgementResult result)
{
if (!result.IsHit)
return;
Scheduler.AddOnce(flash);
}
public override void Flash(JudgementResult result) => Scheduler.AddOnce(flash);
private void flash()
{

View File

@ -315,8 +315,14 @@ namespace osu.Game.Screens.Play
AccuracyCounter?.Current.BindTo(processor.Accuracy);
ComboCounter?.Current.BindTo(processor.Combo);
if (HealthDisplay.Drawable is IHealthDisplay shd)
processor.NewJudgement += shd.Flash;
if (HealthDisplay is IHealthDisplay shd)
{
processor.NewJudgement += judgement =>
{
if (judgement.IsHit)
shd.Flash(judgement);
};
}
}
protected virtual void BindHealthProcessor(HealthProcessor processor)