diff --git a/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlay.cs b/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlay.cs index b164c530cb..227e15ccf7 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlay.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlay.cs @@ -72,6 +72,10 @@ namespace osu.Game.Tests.Visual.Online Preview = @"https://b.ppy.sh/preview/12345.mp3", PlayCount = 123, FavouriteCount = 456, + NominationStatus = new BeatmapSetNominationStatus + { + Current = 2, + }, Submitted = DateTime.Now, Ranked = DateTime.Now, BPM = 111, diff --git a/osu.Game/Beatmaps/Drawables/Cards/BeatmapCardExtra.cs b/osu.Game/Beatmaps/Drawables/Cards/BeatmapCardExtra.cs index 222acbc039..4c4a063708 100644 --- a/osu.Game/Beatmaps/Drawables/Cards/BeatmapCardExtra.cs +++ b/osu.Game/Beatmaps/Drawables/Cards/BeatmapCardExtra.cs @@ -296,20 +296,20 @@ namespace osu.Game.Beatmaps.Drawables.Cards return original; } - statisticsContainer.Content[0][0] = withMargin(new FavouritesStatistic(BeatmapSet) - { - Current = FavouriteState, - }); - - statisticsContainer.Content[1][0] = withMargin(new PlayCountStatistic(BeatmapSet)); - var hypesStatistic = HypesStatistic.CreateFor(BeatmapSet); if (hypesStatistic != null) - statisticsContainer.Content[0][1] = withMargin(hypesStatistic); + statisticsContainer.Content[0][0] = withMargin(hypesStatistic); var nominationsStatistic = NominationsStatistic.CreateFor(BeatmapSet); if (nominationsStatistic != null) - statisticsContainer.Content[1][1] = withMargin(nominationsStatistic); + statisticsContainer.Content[1][0] = withMargin(nominationsStatistic); + + statisticsContainer.Content[0][1] = withMargin(new PlayCountStatistic(BeatmapSet)); + + statisticsContainer.Content[1][1] = withMargin(new FavouritesStatistic(BeatmapSet) + { + Current = FavouriteState, + }); var dateStatistic = BeatmapCardDateStatistic.CreateFor(BeatmapSet); if (dateStatistic != null) diff --git a/osu.Game/Beatmaps/Drawables/Cards/BeatmapCardNormal.cs b/osu.Game/Beatmaps/Drawables/Cards/BeatmapCardNormal.cs index ac9ee94f56..6974cf81ea 100644 --- a/osu.Game/Beatmaps/Drawables/Cards/BeatmapCardNormal.cs +++ b/osu.Game/Beatmaps/Drawables/Cards/BeatmapCardNormal.cs @@ -278,8 +278,8 @@ namespace osu.Game.Beatmaps.Drawables.Cards if (nominationsStatistic != null) yield return nominationsStatistic; - yield return new FavouritesStatistic(BeatmapSet) { Current = FavouriteState }; yield return new PlayCountStatistic(BeatmapSet); + yield return new FavouritesStatistic(BeatmapSet) { Current = FavouriteState }; var dateStatistic = BeatmapCardDateStatistic.CreateFor(BeatmapSet); if (dateStatistic != null) diff --git a/osu.Game/Beatmaps/Drawables/Cards/Statistics/BeatmapCardDateStatistic.cs b/osu.Game/Beatmaps/Drawables/Cards/Statistics/BeatmapCardDateStatistic.cs index 861ec9f027..cb4c548556 100644 --- a/osu.Game/Beatmaps/Drawables/Cards/Statistics/BeatmapCardDateStatistic.cs +++ b/osu.Game/Beatmaps/Drawables/Cards/Statistics/BeatmapCardDateStatistic.cs @@ -17,7 +17,7 @@ namespace osu.Game.Beatmaps.Drawables.Cards.Statistics { this.dateTime = dateTime; - Icon = FontAwesome.Regular.CheckCircle; + Icon = FontAwesome.Solid.CheckCircle; Text = dateTime.ToLocalisedMediumDate(); } diff --git a/osu.Game/Beatmaps/Drawables/Cards/Statistics/PlayCountStatistic.cs b/osu.Game/Beatmaps/Drawables/Cards/Statistics/PlayCountStatistic.cs index 4ce37b8659..8b6e238625 100644 --- a/osu.Game/Beatmaps/Drawables/Cards/Statistics/PlayCountStatistic.cs +++ b/osu.Game/Beatmaps/Drawables/Cards/Statistics/PlayCountStatistic.cs @@ -15,7 +15,7 @@ namespace osu.Game.Beatmaps.Drawables.Cards.Statistics { public PlayCountStatistic(IBeatmapSetOnlineInfo onlineInfo) { - Icon = FontAwesome.Regular.PlayCircle; + Icon = FontAwesome.Solid.PlayCircle; Text = onlineInfo.PlayCount.ToMetric(decimals: 1); TooltipText = BeatmapsStrings.PanelPlaycount(onlineInfo.PlayCount.ToLocalisableString(@"N0")); } diff --git a/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs b/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs index f2630caa83..59b0547d4e 100644 --- a/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs +++ b/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs @@ -9,10 +9,12 @@ using osu.Framework.Bindables; using osu.Framework.Extensions.LocalisationExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Input.Events; using osu.Framework.Localisation; +using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; using osu.Game.Extensions; using osu.Game.Graphics; @@ -32,7 +34,7 @@ namespace osu.Game.Overlays.BeatmapSet private const float tile_spacing = 2; private readonly LinkFlowContainer infoContainer; - private readonly Statistic plays, favourites; + private readonly Statistic nominations, plays, favourites; public readonly DifficultiesContainer Difficulties; @@ -107,7 +109,14 @@ namespace osu.Game.Overlays.BeatmapSet Margin = new MarginPadding { Top = 5 }, Children = new[] { - plays = new Statistic(FontAwesome.Solid.PlayCircle), + nominations = new Statistic(FontAwesome.Solid.ThumbsUp) + { + TooltipText = BeatmapsetsStrings.ShowStatsNominations, + }, + plays = new Statistic(FontAwesome.Solid.PlayCircle) + { + TooltipText = BeatmapsetsStrings.ShowStatsPlaycount, + }, favourites = new Statistic(FontAwesome.Solid.Heart), }, }, @@ -176,8 +185,17 @@ namespace osu.Game.Overlays.BeatmapSet // Else just choose the first available difficulty for now. Beatmap.Value ??= Difficulties.FirstOrDefault()?.Beatmap; + if (beatmapSet?.Status == BeatmapOnlineStatus.Pending && beatmapSet.NominationStatus != null) + { + nominations.Show(); + nominations.Value = beatmapSet.NominationStatus.Current; + } + else + nominations.Hide(); + plays.Value = BeatmapSet?.PlayCount ?? 0; favourites.Value = BeatmapSet?.FavouriteCount ?? 0; + favourites.TooltipText = BeatmapSet?.FavouriteCount > 0 ? BeatmapsetsStrings.ShowStatsFavourites : BeatmapsetsStrings.ShowStatsNoFavourites; updateDifficultyButtons(); } @@ -367,7 +385,7 @@ namespace osu.Game.Overlays.BeatmapSet } } - private partial class Statistic : FillFlowContainer + private partial class Statistic : FillFlowContainer, IHasTooltip { private readonly OsuSpriteText text; @@ -407,6 +425,8 @@ namespace osu.Game.Overlays.BeatmapSet }, }; } + + public LocalisableString TooltipText { get; set; } } public enum DifficultySelectorState