mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Share hype/nomination statistic show logic
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
// 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.
|
||||
|
||||
#nullable enable
|
||||
|
||||
using osu.Framework.Extensions.LocalisationExtensions;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Resources.Localisation.Web;
|
||||
@ -12,11 +14,14 @@ namespace osu.Game.Beatmaps.Drawables.Cards.Statistics
|
||||
/// </summary>
|
||||
public class HypesStatistic : BeatmapCardStatistic
|
||||
{
|
||||
public HypesStatistic(BeatmapSetHypeStatus hypeStatus)
|
||||
private HypesStatistic(BeatmapSetHypeStatus hypeStatus)
|
||||
{
|
||||
Icon = FontAwesome.Solid.Bullhorn;
|
||||
Text = hypeStatus.Current.ToLocalisableString();
|
||||
TooltipText = BeatmapsStrings.HypeRequiredText(hypeStatus.Current.ToLocalisableString(), hypeStatus.Required.ToLocalisableString());
|
||||
}
|
||||
|
||||
public static HypesStatistic? CreateFor(IBeatmapSetOnlineInfo beatmapSetOnlineInfo)
|
||||
=> beatmapSetOnlineInfo.HypeStatus == null ? null : new HypesStatistic(beatmapSetOnlineInfo.HypeStatus);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user