Add basic component structure for skinnable health displays

This commit is contained in:
Dean Herbert
2020-10-16 13:42:50 +09:00
parent 583fdc3a95
commit c0a1f2158c
7 changed files with 154 additions and 14 deletions

View File

@ -3,6 +3,7 @@
using osu.Framework.Bindables;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.UI;
@ -12,14 +13,18 @@ namespace osu.Game.Screens.Play.HUD
/// A container for components displaying the current player health.
/// Gets bound automatically to the <see cref="HealthProcessor"/> when inserted to <see cref="DrawableRuleset.Overlays"/> hierarchy.
/// </summary>
public abstract class HealthDisplay : Container
public abstract class HealthDisplay : Container, IHealthDisplay
{
public readonly BindableDouble Current = new BindableDouble(1)
public Bindable<double> Current { get; } = new BindableDouble(1)
{
MinValue = 0,
MaxValue = 1
};
public virtual void Flash(JudgementResult result)
{
}
/// <summary>
/// Bind the tracked fields of <see cref="HealthProcessor"/> to this health display.
/// </summary>