mirror of
https://github.com/ppy/osu
synced 2024-12-28 18:02:53 +00:00
Add ShowPlaceholderOnNull in updateable flag + do not show placeholders in some overlays
This commit is contained in:
parent
97dd34e26c
commit
5f5441c692
@ -135,7 +135,11 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
Spacing = new Vector2(5, 0),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new UpdateableFlag(score.User.Country) { Size = new Vector2(20, 13) },
|
||||
new UpdateableFlag(score.User.Country)
|
||||
{
|
||||
Size = new Vector2(20, 13),
|
||||
ShowPlaceholderOnNull = false,
|
||||
},
|
||||
username
|
||||
}
|
||||
},
|
||||
|
@ -67,6 +67,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
Offset = new Vector2(0, 2),
|
||||
Radius = 1,
|
||||
},
|
||||
ShowGuestOnNull = false,
|
||||
},
|
||||
new FillFlowContainer
|
||||
{
|
||||
@ -94,6 +95,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
Size = new Vector2(20, 13),
|
||||
ShowPlaceholderOnNull = false,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -60,6 +60,7 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
Masking = true,
|
||||
CornerRadius = avatar_size * 0.25f,
|
||||
OpenOnClick = { Value = false },
|
||||
ShowGuestOnNull = false,
|
||||
},
|
||||
new Container
|
||||
{
|
||||
@ -118,7 +119,8 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
{
|
||||
userFlag = new UpdateableFlag
|
||||
{
|
||||
Size = new Vector2(30, 20)
|
||||
Size = new Vector2(30, 20),
|
||||
ShowPlaceholderOnNull = false,
|
||||
},
|
||||
userCountryText = new OsuSpriteText
|
||||
{
|
||||
|
@ -14,14 +14,25 @@ namespace osu.Game.Users.Drawables
|
||||
set => Model = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether to show a place holder on null country.
|
||||
/// </summary>
|
||||
public bool ShowPlaceholderOnNull = true;
|
||||
|
||||
public UpdateableFlag(Country country = null)
|
||||
{
|
||||
Country = country;
|
||||
}
|
||||
|
||||
protected override Drawable CreateDrawable(Country country) => new DrawableFlag(country)
|
||||
protected override Drawable CreateDrawable(Country country)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
};
|
||||
if (country == null && !ShowPlaceholderOnNull)
|
||||
return null;
|
||||
|
||||
return new DrawableFlag(country)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user