mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 06:36:31 +09:00
Inherit PerformanceStatistic from CounterStatistic
This commit is contained in:
@ -4,18 +4,12 @@
|
||||
using System.Threading;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens.Ranking.Expanded.Accuracy;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Screens.Ranking.Expanded.Statistics
|
||||
{
|
||||
public class PerformanceStatistic : StatisticDisplay
|
||||
public class PerformanceStatistic : CounterStatistic
|
||||
{
|
||||
private readonly ScoreInfo score;
|
||||
|
||||
@ -23,10 +17,8 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
|
||||
|
||||
private readonly CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
|
||||
|
||||
private RollingCounter<int> counter;
|
||||
|
||||
public PerformanceStatistic(ScoreInfo score)
|
||||
: base("PP")
|
||||
: base("PP", 0)
|
||||
{
|
||||
this.score = score;
|
||||
}
|
||||
@ -49,22 +41,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
|
||||
public override void Appear()
|
||||
{
|
||||
base.Appear();
|
||||
counter.Current.BindTo(performance);
|
||||
}
|
||||
|
||||
protected override Drawable CreateContent() => counter = new Counter();
|
||||
|
||||
private class Counter : RollingCounter<int>
|
||||
{
|
||||
protected override double RollingDuration => AccuracyCircle.ACCURACY_TRANSFORM_DURATION;
|
||||
|
||||
protected override Easing RollingEasing => AccuracyCircle.ACCURACY_TRANSFORM_EASING;
|
||||
|
||||
protected override OsuSpriteText CreateSpriteText() => base.CreateSpriteText().With(s =>
|
||||
{
|
||||
s.Font = OsuFont.Torus.With(size: 20, fixedWidth: true);
|
||||
s.Spacing = new Vector2(-2, 0);
|
||||
});
|
||||
Counter.Current.BindTo(performance);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
|
Reference in New Issue
Block a user