mirror of
https://github.com/ppy/osu.git
synced 2025-02-22 00:43:25 +08: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),
|
Spacing = new Vector2(5, 0),
|
||||||
Children = new Drawable[]
|
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
|
username
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -67,6 +67,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
Offset = new Vector2(0, 2),
|
Offset = new Vector2(0, 2),
|
||||||
Radius = 1,
|
Radius = 1,
|
||||||
},
|
},
|
||||||
|
ShowGuestOnNull = false,
|
||||||
},
|
},
|
||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
@ -94,6 +95,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
Size = new Vector2(20, 13),
|
Size = new Vector2(20, 13),
|
||||||
|
ShowPlaceholderOnNull = false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,6 +60,7 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
Masking = true,
|
Masking = true,
|
||||||
CornerRadius = avatar_size * 0.25f,
|
CornerRadius = avatar_size * 0.25f,
|
||||||
OpenOnClick = { Value = false },
|
OpenOnClick = { Value = false },
|
||||||
|
ShowGuestOnNull = false,
|
||||||
},
|
},
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
@ -118,7 +119,8 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
{
|
{
|
||||||
userFlag = new UpdateableFlag
|
userFlag = new UpdateableFlag
|
||||||
{
|
{
|
||||||
Size = new Vector2(30, 20)
|
Size = new Vector2(30, 20),
|
||||||
|
ShowPlaceholderOnNull = false,
|
||||||
},
|
},
|
||||||
userCountryText = new OsuSpriteText
|
userCountryText = new OsuSpriteText
|
||||||
{
|
{
|
||||||
|
@ -14,14 +14,25 @@ namespace osu.Game.Users.Drawables
|
|||||||
set => Model = value;
|
set => Model = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether to show a place holder on null country.
|
||||||
|
/// </summary>
|
||||||
|
public bool ShowPlaceholderOnNull = true;
|
||||||
|
|
||||||
public UpdateableFlag(Country country = null)
|
public UpdateableFlag(Country country = null)
|
||||||
{
|
{
|
||||||
Country = country;
|
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