1
0
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:
yesseruser 2023-11-22 15:25:35 +01:00
parent 7bc304f20e
commit be8b59e59d
3 changed files with 14 additions and 48 deletions

View File

@ -12,14 +12,14 @@ namespace osu.Game.Screens.Play.HUD
{ {
public partial class PlayerFlag : CompositeDrawable, ISerialisableDrawable public partial class PlayerFlag : CompositeDrawable, ISerialisableDrawable
{ {
private readonly BaseUpdateableFlag flag; private readonly ClickableUpdateableFlag flag;
private const float default_size = 40f; private const float default_size = 40f;
public PlayerFlag() public PlayerFlag()
{ {
Size = new Vector2(default_size, default_size / 1.4f); Size = new Vector2(default_size, default_size / 1.4f);
InternalChild = flag = new BaseUpdateableFlag InternalChild = flag = new ClickableUpdateableFlag
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
}; };

View File

@ -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
},
}
};
}
}
}

View File

@ -11,8 +11,19 @@ using osu.Game.Overlays;
namespace osu.Game.Users.Drawables 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> /// <summary>
/// Perform an action in addition to showing the country ranking. /// 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). /// This should be used to perform auxiliary tasks and not as a primary action for clicking a flag (to maintain a consistent UX).