Country -> CountryCode

This commit is contained in:
Salman Ahmed
2022-07-18 08:40:34 +03:00
parent 9e945197dc
commit 100c53f9ef
30 changed files with 98 additions and 98 deletions

View File

@ -15,13 +15,13 @@ namespace osu.Game.Users.Drawables
{
public class DrawableFlag : Sprite, IHasTooltip
{
private readonly Country country;
private readonly CountryCode countryCode;
public LocalisableString TooltipText => country == default ? string.Empty : country.GetDescription();
public LocalisableString TooltipText => countryCode == default ? string.Empty : countryCode.GetDescription();
public DrawableFlag(Country country)
public DrawableFlag(CountryCode countryCode)
{
this.country = country;
this.countryCode = countryCode;
}
[BackgroundDependencyLoader]
@ -30,7 +30,7 @@ namespace osu.Game.Users.Drawables
if (ts == null)
throw new ArgumentNullException(nameof(ts));
string textureName = country == default ? "__" : country.ToString();
string textureName = countryCode == default ? "__" : countryCode.ToString();
Texture = ts.Get($@"Flags/{textureName}") ?? ts.Get(@"Flags/__");
}
}

View File

@ -13,9 +13,9 @@ using osu.Game.Overlays;
namespace osu.Game.Users.Drawables
{
public class UpdateableFlag : ModelBackedDrawable<Country>
public class UpdateableFlag : ModelBackedDrawable<CountryCode>
{
public Country Country
public CountryCode CountryCode
{
get => Model;
set => Model = value;
@ -32,14 +32,14 @@ namespace osu.Game.Users.Drawables
/// </summary>
public Action Action;
public UpdateableFlag(Country country = default)
public UpdateableFlag(CountryCode countryCode = default)
{
Country = country;
CountryCode = countryCode;
}
protected override Drawable CreateDrawable(Country country)
protected override Drawable CreateDrawable(CountryCode countryCode)
{
if (country == default && !ShowPlaceholderOnUnknown)
if (countryCode == default && !ShowPlaceholderOnUnknown)
return null;
return new Container
@ -47,7 +47,7 @@ namespace osu.Game.Users.Drawables
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
new DrawableFlag(country)
new DrawableFlag(countryCode)
{
RelativeSizeAxes = Axes.Both
},
@ -62,7 +62,7 @@ namespace osu.Game.Users.Drawables
protected override bool OnClick(ClickEvent e)
{
Action?.Invoke();
rankingsOverlay?.ShowCountry(Country);
rankingsOverlay?.ShowCountry(CountryCode);
return true;
}
}