mirror of
https://github.com/ppy/osu.git
synced 2026-05-26 20:50:41 +08:00
Provide BeatmapItemsCount in all filters to ensure we always use correct value
This commit is contained in:
@@ -19,5 +19,10 @@ namespace osu.Game.Graphics.Carousel
|
||||
/// <param name="cancellationToken">A cancellation token.</param>
|
||||
/// <returns>The post-filtered items.</returns>
|
||||
Task<List<CarouselItem>> Run(IEnumerable<CarouselItem> items, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// The total number of beatmap difficulties displayed post filter.
|
||||
/// </summary>
|
||||
int BeatmapItemsCount { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace osu.Game.Screens.SelectV2
|
||||
/// <summary>
|
||||
/// Total number of beatmap difficulties displayed with the filter.
|
||||
/// </summary>
|
||||
public int MatchedBeatmapsCount => grouping.BeatmapItemsCount;
|
||||
public int MatchedBeatmapsCount => Filters.Last().BeatmapItemsCount;
|
||||
|
||||
protected override float GetSpacingBetweenPanels(CarouselItem top, CarouselItem bottom)
|
||||
{
|
||||
|
||||
@@ -17,9 +17,6 @@ namespace osu.Game.Screens.SelectV2
|
||||
{
|
||||
private readonly Func<FilterCriteria> getCriteria;
|
||||
|
||||
/// <summary>
|
||||
/// The total number of beatmap difficulties displayed post filter.
|
||||
/// </summary>
|
||||
public int BeatmapItemsCount { get; private set; }
|
||||
|
||||
public BeatmapCarouselFilterMatching(Func<FilterCriteria> getCriteria)
|
||||
|
||||
@@ -16,6 +16,8 @@ namespace osu.Game.Screens.SelectV2
|
||||
{
|
||||
public class BeatmapCarouselFilterSorting : ICarouselFilter
|
||||
{
|
||||
public int BeatmapItemsCount { get; private set; }
|
||||
|
||||
private readonly Func<FilterCriteria> getCriteria;
|
||||
|
||||
public BeatmapCarouselFilterSorting(Func<FilterCriteria> getCriteria)
|
||||
@@ -29,6 +31,8 @@ namespace osu.Game.Screens.SelectV2
|
||||
|
||||
bool groupedSets = BeatmapCarouselFilterGrouping.ShouldGroupBeatmapsTogether(criteria);
|
||||
|
||||
BeatmapItemsCount = items.Count();
|
||||
|
||||
return items.Order(Comparer<CarouselItem>.Create((a, b) =>
|
||||
{
|
||||
var ab = (BeatmapInfo)a.Model;
|
||||
|
||||
Reference in New Issue
Block a user