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:
parent
5be9e30cd0
commit
a810f56ec8
@ -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()
|
||||
{
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user