Add argon health display to default skin layout

This commit is contained in:
Dean Herbert 2023-10-06 18:46:50 +09:00
parent 71be3c8f8b
commit 3f2a00d90d
No known key found for this signature in database
2 changed files with 11 additions and 4 deletions

View File

@ -30,16 +30,15 @@ public partial class ArgonHealthDisplay : HealthDisplay, ISerialisableDrawable
public bool UsesFixedAnchor { get; set; }
[SettingSource("Bar height")]
public BindableFloat BarHeight { get; } = new BindableFloat
public BindableFloat BarHeight { get; } = new BindableFloat(20)
{
Default = 32,
MinValue = 0,
MaxValue = 64,
Precision = 1
};
[SettingSource("Bar length")]
public BindableFloat BarLength { get; } = new BindableFloat(1)
public BindableFloat BarLength { get; } = new BindableFloat(0.98f)
{
MinValue = 0.2f,
MaxValue = 1,

View File

@ -109,6 +109,7 @@ public ArgonSkin(SkinInfo skin, IStorageResourceProvider resources)
case SkinComponentsContainerLookup.TargetArea.MainHUDComponents:
var skinnableTargetWrapper = new DefaultSkinComponentsContainer(container =>
{
var health = container.OfType<ArgonHealthDisplay>().FirstOrDefault();
var score = container.OfType<DefaultScoreCounter>().FirstOrDefault();
var accuracy = container.OfType<DefaultAccuracyCounter>().FirstOrDefault();
var combo = container.OfType<DefaultComboCounter>().FirstOrDefault();
@ -128,6 +129,13 @@ public ArgonSkin(SkinInfo skin, IStorageResourceProvider resources)
score.Position = new Vector2(0, vertical_offset);
if (health != null)
{
health.Origin = Anchor.TopCentre;
health.Anchor = Anchor.TopCentre;
health.Y = 5;
}
if (ppCounter != null)
{
ppCounter.Y = score.Position.Y + ppCounter.ScreenSpaceDeltaToParentSpace(score.ScreenSpaceDrawQuad.Size).Y - 4;
@ -191,7 +199,7 @@ public ArgonSkin(SkinInfo skin, IStorageResourceProvider resources)
new DefaultComboCounter(),
new DefaultScoreCounter(),
new DefaultAccuracyCounter(),
new DefaultHealthDisplay(),
new ArgonHealthDisplay(),
new ArgonSongProgress(),
new ArgonKeyCounterDisplay(),
new BarHitErrorMeter(),