mirror of
https://github.com/ppy/osu
synced 2024-12-15 03:16:17 +00:00
Update accuracy counter design
This commit is contained in:
parent
cbea2db4be
commit
e6d3085353
@ -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 },
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
accuracy.Position = new Vector2(-20, 20);
|
||||
accuracy.Anchor = Anchor.TopRight;
|
||||
accuracy.Origin = Anchor.TopRight;
|
||||
}
|
||||
|
||||
var hitError = container.OfType<HitErrorMeter>().FirstOrDefault();
|
||||
|
Loading…
Reference in New Issue
Block a user