2018-01-05 19:21:19 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-02-07 12:59:30 +08:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
2016-10-16 04:16:02 +08:00
|
|
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
|
|
|
|
|
2017-05-05 12:00:05 +08:00
|
|
|
|
namespace osu.Game.Screens.Play.HUD
|
2016-10-16 04:16:02 +08:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Used to display combo with a roll-up animation in results screen.
|
|
|
|
|
/// </summary>
|
2017-07-15 00:14:07 +08:00
|
|
|
|
public class ComboResultCounter : RollingCounter<long>
|
2016-10-16 04:16:02 +08:00
|
|
|
|
{
|
2016-10-18 10:40:50 +08:00
|
|
|
|
protected override double RollingDuration => 500;
|
2017-07-23 02:50:25 +08:00
|
|
|
|
protected override Easing RollingEasing => Easing.Out;
|
2016-10-16 04:16:02 +08:00
|
|
|
|
|
2017-07-15 00:14:07 +08:00
|
|
|
|
protected override double GetProportionalDuration(long currentValue, long newValue)
|
2016-10-16 04:16:02 +08:00
|
|
|
|
{
|
|
|
|
|
return currentValue > newValue ? currentValue - newValue : newValue - currentValue;
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-15 00:14:07 +08:00
|
|
|
|
protected override string FormatCount(long count)
|
2016-10-16 04:16:02 +08:00
|
|
|
|
{
|
|
|
|
|
return $@"{count}x";
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-15 00:14:07 +08:00
|
|
|
|
public override void Increment(long amount)
|
2016-10-19 18:44:03 +08:00
|
|
|
|
{
|
2017-03-10 12:08:59 +08:00
|
|
|
|
Current.Value = Current + amount;
|
2016-10-19 18:44:03 +08:00
|
|
|
|
}
|
2016-10-16 04:16:02 +08:00
|
|
|
|
}
|
|
|
|
|
}
|