mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 12:22:56 +08:00
Add support for ScorePrefix and ScoreOverlap values in legacy skins
This commit is contained in:
parent
583fdc3a95
commit
085d8d0ecb
@ -15,6 +15,9 @@ namespace osu.Game.Skinning
|
||||
{
|
||||
private readonly ISkin skin;
|
||||
|
||||
private readonly string scorePrefix;
|
||||
private readonly int scoreOverlap;
|
||||
|
||||
public LegacyAccuracyCounter(ISkin skin)
|
||||
{
|
||||
Anchor = Anchor.TopRight;
|
||||
@ -24,16 +27,19 @@ namespace osu.Game.Skinning
|
||||
Margin = new MarginPadding(10);
|
||||
|
||||
this.skin = skin;
|
||||
scorePrefix = skin.GetConfig<LegacySkinConfiguration.LegacySetting, string>(LegacySkinConfiguration.LegacySetting.ScorePrefix)?.Value ?? "score";
|
||||
scoreOverlap = skin.GetConfig<LegacySkinConfiguration.LegacySetting, int>(LegacySkinConfiguration.LegacySetting.ScoreOverlap)?.Value ?? -2;
|
||||
}
|
||||
|
||||
[Resolved(canBeNull: true)]
|
||||
private HUDOverlay hud { get; set; }
|
||||
|
||||
protected sealed override OsuSpriteText CreateSpriteText() =>
|
||||
new LegacySpriteText(skin, "score" /*, true*/)
|
||||
new LegacySpriteText(skin, scorePrefix)
|
||||
{
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
Spacing = new Vector2(-scoreOverlap, 0)
|
||||
};
|
||||
|
||||
protected override void Update()
|
||||
|
@ -5,6 +5,7 @@ using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Skinning
|
||||
{
|
||||
@ -12,6 +13,9 @@ namespace osu.Game.Skinning
|
||||
{
|
||||
private readonly ISkin skin;
|
||||
|
||||
private readonly string scorePrefix;
|
||||
private readonly int scoreOverlap;
|
||||
|
||||
protected override double RollingDuration => 1000;
|
||||
protected override Easing RollingEasing => Easing.Out;
|
||||
|
||||
@ -24,18 +28,21 @@ namespace osu.Game.Skinning
|
||||
Origin = Anchor.TopRight;
|
||||
|
||||
this.skin = skin;
|
||||
scorePrefix = skin.GetConfig<LegacySkinConfiguration.LegacySetting, string>(LegacySkinConfiguration.LegacySetting.ScorePrefix)?.Value ?? "score";
|
||||
scoreOverlap = skin.GetConfig<LegacySkinConfiguration.LegacySetting, int>(LegacySkinConfiguration.LegacySetting.ScoreOverlap)?.Value ?? -2;
|
||||
|
||||
// base class uses int for display, but externally we bind to ScoreProcesssor as a double for now.
|
||||
// base class uses int for display, but externally we bind to ScoreProcessor as a double for now.
|
||||
Current.BindValueChanged(v => base.Current.Value = (int)v.NewValue);
|
||||
|
||||
Margin = new MarginPadding(10);
|
||||
}
|
||||
|
||||
protected sealed override OsuSpriteText CreateSpriteText() =>
|
||||
new LegacySpriteText(skin, "score" /*, true*/)
|
||||
new LegacySpriteText(skin, scorePrefix)
|
||||
{
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
Spacing = new Vector2(-scoreOverlap, 0)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,8 @@ namespace osu.Game.Skinning
|
||||
Version,
|
||||
ComboPrefix,
|
||||
ComboOverlap,
|
||||
ScorePrefix,
|
||||
ScoreOverlap,
|
||||
AnimationFramerate,
|
||||
LayeredHitSounds
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user