mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 13:22:55 +08:00
Revert "Created and implemened a BaseUpdateableFlag."
This reverts commit cd7e0bf620
.
This commit is contained in:
parent
7bc304f20e
commit
be8b59e59d
@ -12,14 +12,14 @@ namespace osu.Game.Screens.Play.HUD
|
||||
{
|
||||
public partial class PlayerFlag : CompositeDrawable, ISerialisableDrawable
|
||||
{
|
||||
private readonly BaseUpdateableFlag flag;
|
||||
private readonly ClickableUpdateableFlag flag;
|
||||
|
||||
private const float default_size = 40f;
|
||||
|
||||
public PlayerFlag()
|
||||
{
|
||||
Size = new Vector2(default_size, default_size / 1.4f);
|
||||
InternalChild = flag = new BaseUpdateableFlag
|
||||
InternalChild = flag = new ClickableUpdateableFlag
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
};
|
||||
|
@ -1,45 +0,0 @@
|
||||
// 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 partial class BaseUpdateableFlag : ModelBackedDrawable<CountryCode>
|
||||
{
|
||||
public CountryCode CountryCode
|
||||
{
|
||||
get => Model;
|
||||
set => Model = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether to show a place holder on unknown country.
|
||||
/// </summary>
|
||||
public bool ShowPlaceholderOnUnknown = true;
|
||||
|
||||
public BaseUpdateableFlag(CountryCode countryCode = CountryCode.Unknown)
|
||||
{
|
||||
CountryCode = countryCode;
|
||||
}
|
||||
|
||||
protected override Drawable? CreateDrawable(CountryCode countryCode)
|
||||
{
|
||||
if (countryCode == CountryCode.Unknown && !ShowPlaceholderOnUnknown)
|
||||
return null;
|
||||
|
||||
return new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new DrawableFlag(countryCode)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
@ -11,8 +11,19 @@ using osu.Game.Overlays;
|
||||
|
||||
namespace osu.Game.Users.Drawables
|
||||
{
|
||||
public partial class ClickableUpdateableFlag : BaseUpdateableFlag
|
||||
public partial class ClickableUpdateableFlag : ModelBackedDrawable<CountryCode>
|
||||
{
|
||||
public CountryCode CountryCode
|
||||
{
|
||||
get => Model;
|
||||
set => Model = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether to show a place holder on unknown country.
|
||||
/// </summary>
|
||||
public bool ShowPlaceholderOnUnknown = true;
|
||||
|
||||
/// <summary>
|
||||
/// Perform an action in addition to showing the country ranking.
|
||||
/// This should be used to perform auxiliary tasks and not as a primary action for clicking a flag (to maintain a consistent UX).
|
||||
|
Loading…
Reference in New Issue
Block a user