mirror of
https://github.com/osukey/osukey.git
synced 2025-06-09 13:28:03 +09:00
Show tooltip of leaderboard score rank when 1000 or higher
This commit is contained in:
parent
a135253fb0
commit
848f3bbf51
@ -82,20 +82,10 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Container
|
new RankLabel(rank)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
Width = rank_width,
|
Width = rank_width,
|
||||||
Children = new[]
|
|
||||||
{
|
|
||||||
new OsuSpriteText
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
Font = OsuFont.GetFont(size: 20, italics: true),
|
|
||||||
Text = rank == null ? "-" : rank.Value.ToMetric(decimals: rank < 100000 ? 1 : 0),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
content = new Container
|
content = new Container
|
||||||
{
|
{
|
||||||
@ -356,6 +346,24 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class RankLabel : Container, IHasTooltip
|
||||||
|
{
|
||||||
|
public RankLabel(int? rank)
|
||||||
|
{
|
||||||
|
TooltipText = rank == null || rank < 1000 ? null : $"{rank}";
|
||||||
|
|
||||||
|
Child = new OsuSpriteText
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Font = OsuFont.GetFont(size: 20, italics: true),
|
||||||
|
Text = rank == null ? "-" : rank.Value.ToMetric(decimals: rank < 100000 ? 1 : 0),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public string TooltipText { get; }
|
||||||
|
}
|
||||||
|
|
||||||
public class LeaderboardScoreStatistic
|
public class LeaderboardScoreStatistic
|
||||||
{
|
{
|
||||||
public IconUsage Icon;
|
public IconUsage Icon;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user