1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 20:27:52 +08:00
osu-lazer/osu.Game/Users/Drawables/UpdateableFlag.cs

39 lines
1010 B
C#
Raw Normal View History

2019-06-19 08:50:16 +08:00
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Users.Drawables
{
public class UpdateableFlag : ModelBackedDrawable<Country>
{
public Country Country
{
get => Model;
set => Model = value;
}
/// <summary>
/// Whether to show a place holder on null country.
/// </summary>
public bool ShowPlaceholderOnNull = true;
public UpdateableFlag(Country country = null)
2019-06-19 08:50:16 +08:00
{
Country = country;
}
protected override Drawable CreateDrawable(Country country)
2019-06-19 08:50:16 +08:00
{
if (country == null && !ShowPlaceholderOnNull)
return null;
return new DrawableFlag(country)
{
RelativeSizeAxes = Axes.Both,
};
}
2019-06-19 08:50:16 +08:00
}
}