mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 01:17:35 +09:00
Remove cruft from SkinnableHealthDisplay
This commit is contained in:
parent
3044b1c432
commit
9fe6e1096a
@ -1,33 +1,12 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
|
||||||
using osu.Framework.Bindables;
|
|
||||||
using osu.Game.Rulesets.Scoring;
|
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play.HUD
|
namespace osu.Game.Screens.Play.HUD
|
||||||
{
|
{
|
||||||
public class SkinnableHealthDisplay : SkinnableDrawable
|
public class SkinnableHealthDisplay : SkinnableDrawable
|
||||||
{
|
{
|
||||||
public Bindable<double> Current { get; } = new BindableDouble(1)
|
|
||||||
{
|
|
||||||
MinValue = 0,
|
|
||||||
MaxValue = 1
|
|
||||||
};
|
|
||||||
|
|
||||||
private HealthProcessor processor;
|
|
||||||
|
|
||||||
public void BindHealthProcessor(HealthProcessor processor)
|
|
||||||
{
|
|
||||||
if (this.processor != null)
|
|
||||||
throw new InvalidOperationException("Can't bind to a processor more than once");
|
|
||||||
|
|
||||||
this.processor = processor;
|
|
||||||
|
|
||||||
Current.BindTo(processor.Health);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SkinnableHealthDisplay()
|
public SkinnableHealthDisplay()
|
||||||
: base(new HUDSkinComponent(HUDSkinComponents.HealthDisplay), _ => new DefaultHealthDisplay())
|
: base(new HUDSkinComponent(HUDSkinComponents.HealthDisplay), _ => new DefaultHealthDisplay())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user