mirror of
https://github.com/ppy/osu.git
synced 2026-06-04 02:13:39 +08:00
Merge pull request #36796 from Joehuu/standardise-play-favourite-order
Standardise display order of playcount / favourites
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user