mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Normalize all the line endings
This commit is contained in:
@ -1,54 +1,54 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
public class ScoreCounter : RollingCounter<double>
|
||||
{
|
||||
protected override double RollingDuration => 1000;
|
||||
protected override Easing RollingEasing => Easing.Out;
|
||||
|
||||
public bool UseCommaSeparator;
|
||||
|
||||
/// <summary>
|
||||
/// How many leading zeroes the counter has.
|
||||
/// </summary>
|
||||
public uint LeadingZeroes
|
||||
{
|
||||
get;
|
||||
protected set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Displays score.
|
||||
/// </summary>
|
||||
/// <param name="leading">How many leading zeroes the counter will have.</param>
|
||||
public ScoreCounter(uint leading = 0)
|
||||
{
|
||||
DisplayedCountSpriteText.FixedWidth = true;
|
||||
LeadingZeroes = leading;
|
||||
}
|
||||
|
||||
protected override double GetProportionalDuration(double currentValue, double newValue)
|
||||
{
|
||||
return currentValue > newValue ? currentValue - newValue : newValue - currentValue;
|
||||
}
|
||||
|
||||
protected override string FormatCount(double count)
|
||||
{
|
||||
string format = new string('0', (int)LeadingZeroes);
|
||||
if (UseCommaSeparator)
|
||||
for (int i = format.Length - 3; i > 0; i -= 3)
|
||||
format = format.Insert(i, @",");
|
||||
|
||||
return ((long)count).ToString(format);
|
||||
}
|
||||
|
||||
public override void Increment(double amount)
|
||||
{
|
||||
Current.Value = Current + amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
public class ScoreCounter : RollingCounter<double>
|
||||
{
|
||||
protected override double RollingDuration => 1000;
|
||||
protected override Easing RollingEasing => Easing.Out;
|
||||
|
||||
public bool UseCommaSeparator;
|
||||
|
||||
/// <summary>
|
||||
/// How many leading zeroes the counter has.
|
||||
/// </summary>
|
||||
public uint LeadingZeroes
|
||||
{
|
||||
get;
|
||||
protected set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Displays score.
|
||||
/// </summary>
|
||||
/// <param name="leading">How many leading zeroes the counter will have.</param>
|
||||
public ScoreCounter(uint leading = 0)
|
||||
{
|
||||
DisplayedCountSpriteText.FixedWidth = true;
|
||||
LeadingZeroes = leading;
|
||||
}
|
||||
|
||||
protected override double GetProportionalDuration(double currentValue, double newValue)
|
||||
{
|
||||
return currentValue > newValue ? currentValue - newValue : newValue - currentValue;
|
||||
}
|
||||
|
||||
protected override string FormatCount(double count)
|
||||
{
|
||||
string format = new string('0', (int)LeadingZeroes);
|
||||
if (UseCommaSeparator)
|
||||
for (int i = format.Length - 3; i > 0; i -= 3)
|
||||
format = format.Insert(i, @",");
|
||||
|
||||
return ((long)count).ToString(format);
|
||||
}
|
||||
|
||||
public override void Increment(double amount)
|
||||
{
|
||||
Current.Value = Current + amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user