mirror of
https://github.com/ppy/osu
synced 2025-03-19 09:34:49 +00:00
Merge pull request #7820 from EVAST9919/italic-rankings-stuff
Update design of username and country name in RankingsOverlay
This commit is contained in:
commit
5c3280f5ff
@ -8,6 +8,7 @@ using osu.Game.Users;
|
|||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Rankings.Tables
|
namespace osu.Game.Overlays.Rankings.Tables
|
||||||
{
|
{
|
||||||
@ -30,11 +31,7 @@ namespace osu.Game.Overlays.Rankings.Tables
|
|||||||
|
|
||||||
protected override Country GetCountry(CountryStatistics item) => item.Country;
|
protected override Country GetCountry(CountryStatistics item) => item.Country;
|
||||||
|
|
||||||
protected override Drawable CreateFlagContent(CountryStatistics item) => new OsuSpriteText
|
protected override Drawable CreateFlagContent(CountryStatistics item) => new CountryName(item.Country);
|
||||||
{
|
|
||||||
Font = OsuFont.GetFont(size: TEXT_SIZE),
|
|
||||||
Text = $@"{item.Country.FullName}",
|
|
||||||
};
|
|
||||||
|
|
||||||
protected override Drawable[] CreateAdditionalContent(CountryStatistics item) => new Drawable[]
|
protected override Drawable[] CreateAdditionalContent(CountryStatistics item) => new Drawable[]
|
||||||
{
|
{
|
||||||
@ -63,5 +60,20 @@ namespace osu.Game.Overlays.Rankings.Tables
|
|||||||
Text = $@"{item.Performance / Math.Max(item.ActiveUsers, 1):N0}",
|
Text = $@"{item.Performance / Math.Max(item.ActiveUsers, 1):N0}",
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private class CountryName : OsuSpriteText
|
||||||
|
{
|
||||||
|
public CountryName(Country country)
|
||||||
|
{
|
||||||
|
Font = OsuFont.GetFont(size: 12);
|
||||||
|
Text = country.FullName ?? string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OverlayColourProvider colourProvider)
|
||||||
|
{
|
||||||
|
Colour = colourProvider.Light2;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ namespace osu.Game.Overlays.Rankings.Tables
|
|||||||
|
|
||||||
protected sealed override Drawable CreateFlagContent(UserStatistics item)
|
protected sealed override Drawable CreateFlagContent(UserStatistics item)
|
||||||
{
|
{
|
||||||
var username = new LinkFlowContainer(t => t.Font = OsuFont.GetFont(size: TEXT_SIZE)) { AutoSizeAxes = Axes.Both };
|
var username = new LinkFlowContainer(t => t.Font = OsuFont.GetFont(size: TEXT_SIZE, italics: true)) { AutoSizeAxes = Axes.Both };
|
||||||
username.AddUserLink(item.User);
|
username.AddUserLink(item.User);
|
||||||
return username;
|
return username;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user