diff --git a/osu.Game/Graphics/UserInterface/RollingCounter.cs b/osu.Game/Graphics/UserInterface/RollingCounter.cs index db6e6ff44f..2afa4da058 100644 --- a/osu.Game/Graphics/UserInterface/RollingCounter.cs +++ b/osu.Game/Graphics/UserInterface/RollingCounter.cs @@ -15,6 +15,7 @@ using OpenTK.Graphics; namespace osu.Game.Graphics.UserInterface { public abstract class RollingCounter : Container, IHasAccentColour + where T : struct, IEquatable { /// /// The current value. @@ -193,27 +194,12 @@ namespace osu.Game.Graphics.UserInterface /// protected void TransformCount(Transform transform, T currentValue, T newValue) { - Type type = transform.GetType(); - - Flush(false, type); - - if (RollingDuration < 1) - { - DisplayedCount = Current; - return; - } - double rollingTotalDuration = IsRollingProportional ? GetProportionalDuration(currentValue, newValue) : RollingDuration; - transform.StartTime = TransformStartTime; - transform.EndTime = TransformStartTime + rollingTotalDuration; - transform.EndValue = newValue; - transform.Easing = RollingEasing; - - Transforms.Add(transform); + TransformTo(newValue, rollingTotalDuration, RollingEasing, transform); } } } diff --git a/osu.Game/Screens/Play/HUD/ComboCounter.cs b/osu.Game/Screens/Play/HUD/ComboCounter.cs index f527eaacaf..4a9ea0fa59 100644 --- a/osu.Game/Screens/Play/HUD/ComboCounter.cs +++ b/osu.Game/Screens/Play/HUD/ComboCounter.cs @@ -188,20 +188,7 @@ namespace osu.Game.Screens.Play.HUD private void transformRoll(TransformComboRoll transform, int currentValue, int newValue) { - Flush(false, typeof(TransformComboRoll)); - - if (RollingDuration < 1) - { - DisplayedCount = Current; - return; - } - - transform.StartTime = Time.Current; - transform.EndTime = Time.Current + getProportionalDuration(currentValue, newValue); - transform.EndValue = newValue; - transform.Easing = RollingEasing; - - Transforms.Add(transform); + TransformTo(newValue, getProportionalDuration(currentValue, newValue), RollingEasing, new TransformComboRoll()); } protected class TransformComboRoll : Transform