mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Allow providing custom sprite text for RollingCounter<T>
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Screens.Ranking.Expanded.Accuracy;
|
||||
using osu.Game.Utils;
|
||||
@ -43,16 +44,18 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
|
||||
|
||||
protected override Easing RollingEasing => AccuracyCircle.ACCURACY_TRANSFORM_EASING;
|
||||
|
||||
public Counter()
|
||||
{
|
||||
DisplayedCountSpriteText.Font = OsuFont.Torus.With(size: 20, fixedWidth: true);
|
||||
DisplayedCountSpriteText.Spacing = new Vector2(-2, 0);
|
||||
}
|
||||
|
||||
protected override string FormatCount(double count) => count.FormatAccuracy();
|
||||
|
||||
public override void Increment(double amount)
|
||||
=> Current.Value += amount;
|
||||
|
||||
protected override OsuSpriteText CreateSpriteText()
|
||||
{
|
||||
var spriteText = base.CreateSpriteText();
|
||||
spriteText.Font = OsuFont.Torus.With(size: 20, fixedWidth: true);
|
||||
spriteText.Spacing = new Vector2(-2, 0);
|
||||
return spriteText;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Screens.Ranking.Expanded.Accuracy;
|
||||
using osuTK;
|
||||
@ -43,10 +44,12 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
|
||||
|
||||
protected override Easing RollingEasing => AccuracyCircle.ACCURACY_TRANSFORM_EASING;
|
||||
|
||||
public Counter()
|
||||
protected override OsuSpriteText CreateSpriteText()
|
||||
{
|
||||
DisplayedCountSpriteText.Font = OsuFont.Torus.With(size: 20, fixedWidth: true);
|
||||
DisplayedCountSpriteText.Spacing = new Vector2(-2, 0);
|
||||
var spriteText = base.CreateSpriteText();
|
||||
spriteText.Font = OsuFont.Torus.With(size: 20, fixedWidth: true);
|
||||
spriteText.Spacing = new Vector2(-2, 0);
|
||||
return spriteText;
|
||||
}
|
||||
|
||||
public override void Increment(int amount)
|
||||
|
Reference in New Issue
Block a user