mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Nicer generic rolling counters
This commit is contained in:
@ -13,8 +13,6 @@ namespace osu.Game.Graphics.UserInterface
|
||||
/// </summary>
|
||||
public class SimpleComboCounter : RollingCounter<int>
|
||||
{
|
||||
protected override Type TransformType => typeof(TransformCounterCount);
|
||||
|
||||
protected override double RollingDuration => 750;
|
||||
|
||||
public SimpleComboCounter()
|
||||
@ -36,23 +34,5 @@ namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
Current.Value = Current + amount;
|
||||
}
|
||||
|
||||
private class TransformCounterCount : Transform<int, Drawable>
|
||||
{
|
||||
public int CurrentValue
|
||||
{
|
||||
get
|
||||
{
|
||||
double time = Time?.Current ?? 0;
|
||||
if (time < StartTime) return StartValue;
|
||||
if (time >= EndTime) return EndValue;
|
||||
|
||||
return (int)Interpolation.ValueAt(time, StartValue, EndValue, StartTime, EndTime, Easing);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Apply(Drawable d) => ((SimpleComboCounter)d).DisplayedCount = CurrentValue;
|
||||
public override void ReadIntoStartValue(Drawable d) => StartValue = ((SimpleComboCounter)d).DisplayedCount;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user