mirror of
https://github.com/ppy/osu
synced 2024-12-14 19:06:07 +00:00
36 lines
1.1 KiB
C#
36 lines
1.1 KiB
C#
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
using System;
|
|
using osu.Framework.Graphics;
|
|
using osu.Framework.Graphics.Transforms;
|
|
using osu.Framework.MathUtils;
|
|
using osu.Game.Graphics.UserInterface;
|
|
|
|
namespace osu.Game.Screens.Play.HUD
|
|
{
|
|
/// <summary>
|
|
/// Used to display combo with a roll-up animation in results screen.
|
|
/// </summary>
|
|
public class ComboResultCounter : RollingCounter<long>
|
|
{
|
|
protected override double RollingDuration => 500;
|
|
protected override EasingTypes RollingEasing => EasingTypes.Out;
|
|
|
|
protected override double GetProportionalDuration(long currentValue, long newValue)
|
|
{
|
|
return currentValue > newValue ? currentValue - newValue : newValue - currentValue;
|
|
}
|
|
|
|
protected override string FormatCount(long count)
|
|
{
|
|
return $@"{count}x";
|
|
}
|
|
|
|
public override void Increment(long amount)
|
|
{
|
|
Current.Value = Current + amount;
|
|
}
|
|
}
|
|
}
|