mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Add basic HP display support.
This commit is contained in:
@ -6,6 +6,8 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Modes.Objects;
|
||||
using OpenTK;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
|
||||
namespace osu.Game.Modes.UI
|
||||
{
|
||||
@ -15,12 +17,19 @@ namespace osu.Game.Modes.UI
|
||||
public ComboCounter ComboCounter;
|
||||
public ScoreCounter ScoreCounter;
|
||||
public PercentageCounter AccuracyCounter;
|
||||
public HPDisplay HPDisplay;
|
||||
public Score Score { get; set; }
|
||||
|
||||
protected abstract KeyCounterCollection CreateKeyCounter();
|
||||
protected abstract ComboCounter CreateComboCounter();
|
||||
protected abstract PercentageCounter CreateAccuracyCounter();
|
||||
protected abstract ScoreCounter CreateScoreCounter();
|
||||
protected virtual HPDisplay CreateHPDisplay() => new HPDisplay
|
||||
{
|
||||
Size = new Vector2(0.5f, 20),
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Padding = new MarginPadding(5)
|
||||
};
|
||||
|
||||
public virtual void OnHit(HitObject h)
|
||||
{
|
||||
@ -44,6 +53,7 @@ namespace osu.Game.Modes.UI
|
||||
ComboCounter = CreateComboCounter(),
|
||||
ScoreCounter = CreateScoreCounter(),
|
||||
AccuracyCounter = CreateAccuracyCounter(),
|
||||
HPDisplay = CreateHPDisplay(),
|
||||
};
|
||||
}
|
||||
|
||||
@ -53,6 +63,7 @@ namespace osu.Game.Modes.UI
|
||||
processor.TotalScore.ValueChanged += delegate { ScoreCounter?.Set((ulong)processor.TotalScore.Value); };
|
||||
processor.Accuracy.ValueChanged += delegate { AccuracyCounter?.Set((float)processor.Accuracy.Value); };
|
||||
processor.Combo.ValueChanged += delegate { ComboCounter?.Set((ulong)processor.Combo.Value); };
|
||||
processor.Health.ValueChanged += delegate { HPDisplay?.Set((ulong)processor.Combo.Value); };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user