From 7df35e1197c65613a93eb44893af14b85ff31df4 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Thu, 20 Apr 2017 19:45:15 +0900 Subject: [PATCH] Bind to method instead of exposing ScoreProcessor to HealthDisplay. --- osu.Game/Rulesets/UI/StandardHealthDisplay.cs | 7 +------ osu.Game/Rulesets/UI/StandardHudOverlay.cs | 3 ++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/osu.Game/Rulesets/UI/StandardHealthDisplay.cs b/osu.Game/Rulesets/UI/StandardHealthDisplay.cs index 51f47f3b2c..a0fb0e95ab 100644 --- a/osu.Game/Rulesets/UI/StandardHealthDisplay.cs +++ b/osu.Game/Rulesets/UI/StandardHealthDisplay.cs @@ -93,12 +93,7 @@ namespace osu.Game.Rulesets.UI }; } - public void BindProcessor(ScoreProcessor processor) - { - processor.NewJudgement += onNewJudgement; - } - - private void onNewJudgement(Judgement judgement) + public void Flash(Judgement judgement) { if (judgement.Result == HitResult.Miss) return; diff --git a/osu.Game/Rulesets/UI/StandardHudOverlay.cs b/osu.Game/Rulesets/UI/StandardHudOverlay.cs index 97593ade15..c68e29f98a 100644 --- a/osu.Game/Rulesets/UI/StandardHudOverlay.cs +++ b/osu.Game/Rulesets/UI/StandardHudOverlay.cs @@ -84,7 +84,8 @@ namespace osu.Game.Rulesets.UI base.BindProcessor(processor); var shd = HealthDisplay as StandardHealthDisplay; - shd?.BindProcessor(processor); + if (shd != null) + processor.NewJudgement += shd.Flash; } } }