mirror of
https://github.com/ppy/osu.git
synced 2026-05-14 07:24:04 +08:00
Fix random selection potentially selecting a filtered-away beatmap
This commit is contained in:
@@ -219,13 +219,7 @@ namespace osu.Game.Screens.SelectV2
|
||||
return;
|
||||
|
||||
case BeatmapSetInfo setInfo:
|
||||
// Selecting a set isn't valid – let's re-select the first visible difficulty.
|
||||
if (grouping.SetItems.TryGetValue(setInfo, out var items))
|
||||
{
|
||||
var beatmaps = items.Select(i => i.Model).OfType<BeatmapInfo>();
|
||||
RequestRecommendedSelection(beatmaps);
|
||||
}
|
||||
|
||||
selectRecommendedDifficultyForBeatmapSet(setInfo);
|
||||
return;
|
||||
|
||||
case BeatmapInfo beatmapInfo:
|
||||
@@ -284,6 +278,16 @@ namespace osu.Game.Screens.SelectV2
|
||||
setExpandedGroup(groupForReselection);
|
||||
}
|
||||
|
||||
private void selectRecommendedDifficultyForBeatmapSet(BeatmapSetInfo beatmapSet)
|
||||
{
|
||||
// Selecting a set isn't valid – let's re-select the first visible difficulty.
|
||||
if (grouping.SetItems.TryGetValue(beatmapSet, out var items))
|
||||
{
|
||||
var beatmaps = items.Select(i => i.Model).OfType<BeatmapInfo>();
|
||||
RequestRecommendedSelection(beatmaps);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If we don't have a selection and there's a single beatmap set returned, select it for the user.
|
||||
/// </summary>
|
||||
@@ -644,7 +648,7 @@ namespace osu.Game.Screens.SelectV2
|
||||
if (CurrentSelectionItem != null)
|
||||
playSpinSample(distanceBetween(carouselItems.First(i => !ReferenceEquals(i.Model, set)), CurrentSelectionItem), visibleSets.Count);
|
||||
|
||||
RequestRecommendedSelection(set.Beatmaps.Where(b => !b.Hidden));
|
||||
selectRecommendedDifficultyForBeatmapSet(set);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -76,15 +76,18 @@ namespace osu.Game.Screens.SelectV2
|
||||
{
|
||||
var beatmap = (BeatmapInfo)item.Model;
|
||||
|
||||
bool newBeatmapSet = lastBeatmap?.BeatmapSet!.ID != beatmap.BeatmapSet!.ID;
|
||||
|
||||
if (newBeatmapSet)
|
||||
{
|
||||
if (!setMap.TryGetValue(beatmap.BeatmapSet!, out currentSetItems))
|
||||
setMap[beatmap.BeatmapSet!] = currentSetItems = new HashSet<CarouselItem>();
|
||||
}
|
||||
|
||||
if (BeatmapSetsGroupedTogether)
|
||||
{
|
||||
bool newBeatmapSet = lastBeatmap?.BeatmapSet!.ID != beatmap.BeatmapSet!.ID;
|
||||
|
||||
if (newBeatmapSet)
|
||||
{
|
||||
if (!setMap.TryGetValue(beatmap.BeatmapSet!, out currentSetItems))
|
||||
setMap[beatmap.BeatmapSet!] = currentSetItems = new HashSet<CarouselItem>();
|
||||
|
||||
if (groupItem != null)
|
||||
groupItem.NestedItemCount++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user