Update various usages of Country inline with new enum

This commit is contained in:
Salman Ahmed
2022-07-16 04:40:37 +03:00
parent b2b2a4adaf
commit e62049f4a9
19 changed files with 74 additions and 177 deletions

View File

@ -5,6 +5,7 @@
using System;
using osu.Framework.Allocation;
using osu.Framework.Extensions;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
@ -16,7 +17,7 @@ namespace osu.Game.Users.Drawables
{
private readonly Country country;
public LocalisableString TooltipText => country?.FullName;
public LocalisableString TooltipText => country == default ? string.Empty : country.GetDescription();
public DrawableFlag(Country country)
{
@ -29,7 +30,8 @@ namespace osu.Game.Users.Drawables
if (ts == null)
throw new ArgumentNullException(nameof(ts));
Texture = ts.Get($@"Flags/{country?.FlagName ?? @"__"}") ?? ts.Get(@"Flags/__");
string textureName = country == default ? "__" : country.ToString();
Texture = ts.Get($@"Flags/{textureName}") ?? ts.Get(@"Flags/__");
}
}
}