mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Remove humanized number dependency
This commit is contained in:
@ -50,22 +50,33 @@ namespace osu.Game.Overlays.Rankings.Tables
|
||||
Size = new Vector2(20, 13),
|
||||
ShowPlaceholderOnNull = false,
|
||||
},
|
||||
new OsuSpriteText
|
||||
new RowText
|
||||
{
|
||||
Text = $@"{item.Country.FullName}",
|
||||
Font = OsuFont.GetFont(size: TEXT_SIZE),
|
||||
}
|
||||
}
|
||||
},
|
||||
new ColoredText
|
||||
new ColoredRowText
|
||||
{
|
||||
Text = $@"{item.ActiveUsers:N0}",
|
||||
},
|
||||
new ColoredMetricNumber(item.PlayCount),
|
||||
new ColoredMetricNumber(item.RankedScore),
|
||||
new ColoredMetricNumber(item.RankedScore / Math.Max(item.ActiveUsers, 1)),
|
||||
new MetricNumber(item.Performance),
|
||||
new ColoredText
|
||||
new ColoredRowText
|
||||
{
|
||||
Text = $@"{item.PlayCount:N0}",
|
||||
},
|
||||
new ColoredRowText
|
||||
{
|
||||
Text = $@"{item.RankedScore:N0}",
|
||||
},
|
||||
new ColoredRowText
|
||||
{
|
||||
Text = $@"{item.RankedScore / Math.Max(item.ActiveUsers, 1):N0}",
|
||||
},
|
||||
new RowText
|
||||
{
|
||||
Text = $@"{item.Performance:N0}",
|
||||
},
|
||||
new ColoredRowText
|
||||
{
|
||||
Text = $@"{item.Performance / Math.Max(item.ActiveUsers, 1):N0}",
|
||||
}
|
||||
|
@ -63,28 +63,27 @@ namespace osu.Game.Overlays.Rankings.Tables
|
||||
username
|
||||
}
|
||||
},
|
||||
new ColoredText
|
||||
new ColoredRowText
|
||||
{
|
||||
Text = $@"{item.Accuracy:F2}%",
|
||||
},
|
||||
new ColoredText
|
||||
new ColoredRowText
|
||||
{
|
||||
Text = $@"{item.PlayCount:N0}",
|
||||
},
|
||||
new OsuSpriteText
|
||||
new RowText
|
||||
{
|
||||
Text = $@"{item.PP:N0}",
|
||||
Font = OsuFont.GetFont(size: TEXT_SIZE),
|
||||
},
|
||||
new ColoredText
|
||||
new ColoredRowText
|
||||
{
|
||||
Text = $@"{item.GradesCount.SS + item.GradesCount.SSPlus:N0}",
|
||||
},
|
||||
new ColoredText
|
||||
new ColoredRowText
|
||||
{
|
||||
Text = $@"{item.GradesCount.S + item.GradesCount.SPlus:N0}",
|
||||
},
|
||||
new ColoredText
|
||||
new ColoredRowText
|
||||
{
|
||||
Text = $@"{item.GradesCount.A:N0}",
|
||||
},
|
||||
|
@ -10,8 +10,6 @@ using osu.Framework.Extensions;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
using osu.Game.Utils;
|
||||
|
||||
namespace osu.Game.Overlays.Rankings.Tables
|
||||
{
|
||||
@ -88,42 +86,16 @@ namespace osu.Game.Overlays.Rankings.Tables
|
||||
}
|
||||
}
|
||||
|
||||
protected class MetricNumber : OsuSpriteText, IHasTooltip
|
||||
protected class RowText : OsuSpriteText
|
||||
{
|
||||
public string TooltipText => $"{value:N0}";
|
||||
|
||||
private readonly long value;
|
||||
|
||||
public MetricNumber(long value)
|
||||
public RowText()
|
||||
{
|
||||
this.value = value;
|
||||
|
||||
Text = HumanizerUtils.ToReadableString(value);
|
||||
Font = OsuFont.GetFont(size: TEXT_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
protected class ColoredMetricNumber : MetricNumber
|
||||
protected class ColoredRowText : RowText
|
||||
{
|
||||
public ColoredMetricNumber(long value)
|
||||
: base(value)
|
||||
{
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
Colour = colours.GreySeafoamLighter;
|
||||
}
|
||||
}
|
||||
|
||||
protected class ColoredText : OsuSpriteText
|
||||
{
|
||||
public ColoredText()
|
||||
{
|
||||
Font = OsuFont.GetFont(size: TEXT_SIZE);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
|
@ -64,25 +64,31 @@ namespace osu.Game.Overlays.Rankings.Tables
|
||||
username
|
||||
}
|
||||
},
|
||||
new ColoredText
|
||||
new ColoredRowText
|
||||
{
|
||||
Text = $@"{item.Accuracy:F2}%",
|
||||
},
|
||||
new ColoredText
|
||||
new ColoredRowText
|
||||
{
|
||||
Text = $@"{item.PlayCount:N0}",
|
||||
},
|
||||
new ColoredMetricNumber(item.TotalScore),
|
||||
new MetricNumber(item.RankedScore),
|
||||
new ColoredText
|
||||
new ColoredRowText
|
||||
{
|
||||
Text = $@"{item.TotalScore:N0}",
|
||||
},
|
||||
new RowText
|
||||
{
|
||||
Text = $@"{item.RankedScore:N0}",
|
||||
},
|
||||
new ColoredRowText
|
||||
{
|
||||
Text = $@"{item.GradesCount.SS + item.GradesCount.SSPlus:N0}",
|
||||
},
|
||||
new ColoredText
|
||||
new ColoredRowText
|
||||
{
|
||||
Text = $@"{item.GradesCount.S + item.GradesCount.SPlus:N0}",
|
||||
},
|
||||
new ColoredText
|
||||
new ColoredRowText
|
||||
{
|
||||
Text = $@"{item.GradesCount.A:N0}",
|
||||
},
|
||||
|
Reference in New Issue
Block a user