mirror of https://github.com/ppy/osu
style: a NRT pass on `UpdateableFlag`
This commit is contained in:
parent
654eacd449
commit
20a610ea6c
|
@ -1,8 +1,6 @@
|
||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
@ -30,14 +28,14 @@ public CountryCode CountryCode
|
||||||
/// 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).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Action Action;
|
public Action? Action;
|
||||||
|
|
||||||
public UpdateableFlag(CountryCode countryCode = CountryCode.Unknown)
|
public UpdateableFlag(CountryCode countryCode = CountryCode.Unknown)
|
||||||
{
|
{
|
||||||
CountryCode = countryCode;
|
CountryCode = countryCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Drawable CreateDrawable(CountryCode countryCode)
|
protected override Drawable? CreateDrawable(CountryCode countryCode)
|
||||||
{
|
{
|
||||||
if (countryCode == CountryCode.Unknown && !ShowPlaceholderOnUnknown)
|
if (countryCode == CountryCode.Unknown && !ShowPlaceholderOnUnknown)
|
||||||
return null;
|
return null;
|
||||||
|
@ -56,8 +54,8 @@ protected override Drawable CreateDrawable(CountryCode countryCode)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
[Resolved(canBeNull: true)]
|
[Resolved]
|
||||||
private RankingsOverlay rankingsOverlay { get; set; }
|
private RankingsOverlay? rankingsOverlay { get; set; }
|
||||||
|
|
||||||
protected override bool OnClick(ClickEvent e)
|
protected override bool OnClick(ClickEvent e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue