Update accuracy counter design

This commit is contained in:
Salman Ahmed 2023-11-08 01:48:21 +03:00
parent cbea2db4be
commit e6d3085353
3 changed files with 27 additions and 15 deletions

View File

@ -1,18 +1,30 @@
// 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.
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Framework.Graphics.Sprites;
using osu.Game.Configuration;
using osu.Game.Skinning;
using osuTK;
namespace osu.Game.Screens.Play.HUD
{
public partial class ArgonAccuracyCounter : GameplayAccuracyCounter, ISerialisableDrawable
{
[SettingSource("Wireframe opacity", "Controls the opacity of the wire frames behind the digits.")]
public BindableFloat WireframeOpacity { get; } = new BindableFloat(0.4f)
{
Precision = 0.01f,
MinValue = 0,
MaxValue = 1,
};
public bool UsesFixedAnchor { get; set; }
protected override OsuSpriteText CreateSpriteText()
=> base.CreateSpriteText().With(s => s.Font = OsuFont.Default.With(size: 19.2f));
protected override IHasText CreateText() => new ArgonCounterTextComponent(Anchor.TopLeft, "ACCURACY", new Vector2(-4, 0))
{
WireframeOpacity = { BindTarget = WireframeOpacity },
};
}
}

View File

@ -38,7 +38,7 @@ namespace osu.Game.Screens.Play.HUD
}
}
public ArgonCounterTextComponent(Anchor anchor, LocalisableString? label = null)
public ArgonCounterTextComponent(Anchor anchor, LocalisableString? label = null, Vector2? spacing = null)
{
Anchor = anchor;
Origin = anchor;
@ -49,11 +49,13 @@ namespace osu.Game.Screens.Play.HUD
{
Anchor = anchor,
Origin = anchor,
Spacing = spacing ?? new Vector2(-2, 0),
};
textPart = new ArgonCounterSpriteText
{
Anchor = anchor,
Origin = anchor,
Spacing = spacing ?? new Vector2(-2, 0),
};
}
@ -115,9 +117,7 @@ namespace osu.Game.Screens.Play.HUD
private void load(ISkinSource skin)
{
// todo: rename font
Font = new FontUsage(@"argon-score", 1, fixedWidth: true);
Spacing = new Vector2(-2, 0);
Font = new FontUsage(@"argon-score", 1);
glyphStore = new GlyphStore(skin, glyphLookupOverride);
}

View File

@ -143,14 +143,14 @@ namespace osu.Game.Skinning
score.Origin = Anchor.TopRight;
score.Position = new Vector2(components_x_offset + 200, scoreWedge.Y + 30);
}
}
if (accuracy != null)
{
// +4 to vertically align the accuracy counter with the score counter.
accuracy.Position = new Vector2(components_x_offset + 4, scoreWedge.Y + 45);
accuracy.Anchor = Anchor.TopLeft;
accuracy.Origin = Anchor.TopLeft;
}
if (accuracy != null)
{
// +4 to vertically align the accuracy counter with the score counter.
accuracy.Position = new Vector2(-20, 20);
accuracy.Anchor = Anchor.TopRight;
accuracy.Origin = Anchor.TopRight;
}
var hitError = container.OfType<HitErrorMeter>().FirstOrDefault();