mirror of
https://github.com/ppy/osu.git
synced 2026-05-18 23:10:50 +08:00
SongSelectV2: Fix incorrect conditional being used for "split out" check
🤦
Have inlined the v1 usage so we don't accidentally do this again.
This commit is contained in:
@@ -28,6 +28,7 @@ using osu.Game.Extensions;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Input.Bindings;
|
||||
using osu.Game.Screens.Select.Carousel;
|
||||
using osu.Game.Screens.Select.Filter;
|
||||
using osuTK;
|
||||
using osuTK.Input;
|
||||
|
||||
@@ -123,7 +124,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
private void loadNewRoot()
|
||||
{
|
||||
beatmapsSplitOut = activeCriteria.SplitOutDifficulties;
|
||||
beatmapsSplitOut = activeCriteria.Sort == SortMode.Difficulty;
|
||||
|
||||
// Ensure no changes are made to the list while we are initialising items.
|
||||
// We'll catch up on changes via subscriptions anyway.
|
||||
@@ -656,7 +657,7 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
PendingFilter = null;
|
||||
|
||||
if (activeCriteria.SplitOutDifficulties != beatmapsSplitOut)
|
||||
if ((activeCriteria.Sort == SortMode.Difficulty) != beatmapsSplitOut)
|
||||
{
|
||||
loadNewRoot();
|
||||
return;
|
||||
|
||||
@@ -20,11 +20,6 @@ namespace osu.Game.Screens.Select
|
||||
public GroupMode Group;
|
||||
public SortMode Sort;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the display of beatmap sets should be split apart per-difficulty for the current criteria.
|
||||
/// </summary>
|
||||
public bool SplitOutDifficulties => Sort == SortMode.Difficulty;
|
||||
|
||||
public BeatmapSetInfo? SelectedBeatmapSet;
|
||||
|
||||
public OptionalRange<double> StarDifficulty;
|
||||
|
||||
@@ -471,16 +471,9 @@ namespace osu.Game.Screens.SelectV2
|
||||
|
||||
private ScheduledDelegate? loadingDebounce;
|
||||
|
||||
/// <summary>
|
||||
/// We need to track this state locally since `FilterCriteria` is passed by reference and not accurate.
|
||||
/// It should really be a struct.
|
||||
/// </summary>
|
||||
private bool splitOutDifficulties;
|
||||
|
||||
public void Filter(FilterCriteria criteria)
|
||||
{
|
||||
bool resetDisplay = criteria.SplitOutDifficulties != splitOutDifficulties;
|
||||
splitOutDifficulties = criteria.SplitOutDifficulties;
|
||||
bool resetDisplay = grouping.BeatmapSetsGroupedTogether != BeatmapCarouselFilterGrouping.ShouldGroupBeatmapsTogether(criteria);
|
||||
|
||||
Criteria = criteria;
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace osu.Game.Screens.SelectV2
|
||||
var criteria = getCriteria();
|
||||
var newItems = new List<CarouselItem>();
|
||||
|
||||
BeatmapSetsGroupedTogether = criteria.Sort != SortMode.Difficulty && criteria.Group != GroupMode.Difficulty;
|
||||
BeatmapSetsGroupedTogether = ShouldGroupBeatmapsTogether(criteria);
|
||||
|
||||
var groups = getGroups((List<CarouselItem>)items, criteria);
|
||||
|
||||
@@ -122,6 +122,11 @@ namespace osu.Game.Screens.SelectV2
|
||||
}, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public static bool ShouldGroupBeatmapsTogether(FilterCriteria criteria)
|
||||
{
|
||||
return criteria.Sort != SortMode.Difficulty && criteria.Group != GroupMode.Difficulty;
|
||||
}
|
||||
|
||||
private List<GroupMapping> getGroups(List<CarouselItem> items, FilterCriteria criteria)
|
||||
{
|
||||
switch (criteria.Group)
|
||||
|
||||
Reference in New Issue
Block a user