mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:52:53 +08:00
Merge branch 'country-enum' into remove-countries-json
This commit is contained in:
commit
fd8a9a5382
@ -38,11 +38,12 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
|
||||
public Country Country
|
||||
{
|
||||
get => country ??= (Enum.TryParse(userCountry.Code, out Country result) ? result : default);
|
||||
get => country ??= (Enum.TryParse(userCountry?.Code, out Country result) ? result : default);
|
||||
set => country = value;
|
||||
}
|
||||
|
||||
#pragma warning disable 649
|
||||
[CanBeNull]
|
||||
[JsonProperty(@"country")]
|
||||
private UserCountry userCountry;
|
||||
|
||||
|
@ -168,7 +168,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
new UpdateableFlag(score.User.Country)
|
||||
{
|
||||
Size = new Vector2(19, 14),
|
||||
ShowPlaceholderOnNull = false,
|
||||
ShowPlaceholderOnUnknown = false,
|
||||
},
|
||||
username,
|
||||
new OsuSpriteText
|
||||
|
@ -120,7 +120,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
Origin = Anchor.CentreLeft,
|
||||
Size = new Vector2(19, 14),
|
||||
Margin = new MarginPadding { Top = 3 }, // makes spacing look more even
|
||||
ShowPlaceholderOnNull = false,
|
||||
ShowPlaceholderOnUnknown = false,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
userFlag = new UpdateableFlag
|
||||
{
|
||||
Size = new Vector2(28, 20),
|
||||
ShowPlaceholderOnNull = false,
|
||||
ShowPlaceholderOnUnknown = false,
|
||||
},
|
||||
userCountryText = new OsuSpriteText
|
||||
{
|
||||
|
@ -100,7 +100,7 @@ namespace osu.Game.Overlays.Rankings.Tables
|
||||
new UpdateableFlag(GetCountry(item))
|
||||
{
|
||||
Size = new Vector2(28, 20),
|
||||
ShowPlaceholderOnNull = false,
|
||||
ShowPlaceholderOnUnknown = false,
|
||||
},
|
||||
CreateFlagContent(item)
|
||||
}
|
||||
|
@ -22,9 +22,9 @@ namespace osu.Game.Users.Drawables
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether to show a place holder on null country.
|
||||
/// Whether to show a place holder on unknown country.
|
||||
/// </summary>
|
||||
public bool ShowPlaceholderOnNull = true;
|
||||
public bool ShowPlaceholderOnUnknown = true;
|
||||
|
||||
/// <summary>
|
||||
/// Perform an action in addition to showing the country ranking.
|
||||
@ -39,7 +39,7 @@ namespace osu.Game.Users.Drawables
|
||||
|
||||
protected override Drawable CreateDrawable(Country country)
|
||||
{
|
||||
if (country == default && !ShowPlaceholderOnNull)
|
||||
if (country == default && !ShowPlaceholderOnUnknown)
|
||||
return null;
|
||||
|
||||
return new Container
|
||||
|
Loading…
Reference in New Issue
Block a user