Bind every HealthDisplay on Player load

This commit is contained in:
Lucas A
2020-03-17 22:57:47 +01:00
parent 6b0c5bc65d
commit ed4f9f8ba9
4 changed files with 19 additions and 0 deletions

View File

@ -25,6 +25,7 @@ namespace osu.Game.Screens.Play.HUD
public FaillingLayer()
{
RelativeSizeAxes = Axes.Both;
Child = box = new Box
{
RelativeSizeAxes = Axes.Both,

View File

@ -3,6 +3,7 @@
using osu.Framework.Bindables;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Screens.Play.HUD
{
@ -13,5 +14,10 @@ namespace osu.Game.Screens.Play.HUD
MinValue = 0,
MaxValue = 1
};
public virtual void BindHealthProcessor(HealthProcessor processor)
{
Current.BindTo(processor.Health);
}
}
}

View File

@ -24,6 +24,7 @@ using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.UI;
using osu.Game.Scoring;
using osu.Game.Screens.Play.HUD;
using osu.Game.Screens.Ranking;
using osu.Game.Skinning;
using osu.Game.Users;
@ -184,6 +185,9 @@ namespace osu.Game.Screens.Play
foreach (var mod in Mods.Value.OfType<IApplicableToHealthProcessor>())
mod.ApplyToHealthProcessor(HealthProcessor);
foreach (var overlay in DrawableRuleset.Overlays.OfType<HealthDisplay>())
overlay.BindHealthProcessor(HealthProcessor);
BreakOverlay.IsBreakTime.BindValueChanged(onBreakTimeChanged, true);
}