diff --git a/osu.Game/Screens/Select/Filter/GroupMode.cs b/osu.Game/Screens/Select/Filter/GroupMode.cs index b3a4f36c91..04aef2fe18 100644 --- a/osu.Game/Screens/Select/Filter/GroupMode.cs +++ b/osu.Game/Screens/Select/Filter/GroupMode.cs @@ -34,6 +34,9 @@ namespace osu.Game.Screens.Select.Filter // [Description("Favourites")] // Favourites, + [Description("Last Played")] + LastPlayed, + [Description("Length")] Length, @@ -46,8 +49,8 @@ namespace osu.Game.Screens.Select.Filter [Description("Ranked Status")] RankedStatus, - [Description("Last Played")] - LastPlayed, + [Description("Source")] + Source, [Description("Title")] Title, diff --git a/osu.Game/Screens/SelectV2/BeatmapCarouselFilterGrouping.cs b/osu.Game/Screens/SelectV2/BeatmapCarouselFilterGrouping.cs index c68f377fbb..59737baab2 100644 --- a/osu.Game/Screens/SelectV2/BeatmapCarouselFilterGrouping.cs +++ b/osu.Game/Screens/SelectV2/BeatmapCarouselFilterGrouping.cs @@ -202,6 +202,9 @@ namespace osu.Game.Screens.SelectV2 return defineGroupByLength(length); }, items); + case GroupMode.Source: + return getGroupsBy(b => defineGroupBySource(b.BeatmapSet!.Metadata.Source), items); + // TODO: need implementation // // case GroupMode.Collections: @@ -225,6 +228,7 @@ namespace osu.Game.Screens.SelectV2 { return items.GroupBy(i => getGroup((BeatmapInfo)i.Model)) .OrderBy(s => s.Key.Order) + .ThenBy(s => s.Key.Title) .Select(g => new GroupMapping(g.Key, g.ToList())) .ToList(); } @@ -354,6 +358,14 @@ namespace osu.Game.Screens.SelectV2 return new GroupDefinition(11, "Over 10 minutes"); } + private GroupDefinition defineGroupBySource(string source) + { + if (string.IsNullOrEmpty(source)) + return new GroupDefinition(1, "Unsourced"); + + return new GroupDefinition(0, source); + } + private static T? aggregateMax(BeatmapInfo b, Func func) { var beatmaps = b.BeatmapSet!.Beatmaps.Where(bb => !bb.Hidden);