1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-18 06:27:18 +08:00

Merge pull request #7820 from EVAST9919/italic-rankings-stuff

Update design of username and country name in RankingsOverlay
This commit is contained in:
Dan Balasescu 2020-02-18 16:30:38 +09:00 committed by GitHub
commit 5c3280f5ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 6 deletions

View File

@ -8,6 +8,7 @@ using osu.Game.Users;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics;
using System.Collections.Generic;
using osu.Framework.Allocation;
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 Drawable CreateFlagContent(CountryStatistics item) => new OsuSpriteText
{
Font = OsuFont.GetFont(size: TEXT_SIZE),
Text = $@"{item.Country.FullName}",
};
protected override Drawable CreateFlagContent(CountryStatistics item) => new CountryName(item.Country);
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}",
}
};
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;
}
}
}
}

View File

@ -34,7 +34,7 @@ namespace osu.Game.Overlays.Rankings.Tables
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);
return username;
}