Skip to content

Commit

Permalink
Merge pull request #29762 from peppy/fix-beatmap-difficulty-splitting
Browse files Browse the repository at this point in the history
Fix beatmap difficulties not being split out on first load
  • Loading branch information
peppy authored Sep 7, 2024
2 parents 7f687d5 + 4c6eb89 commit e88083a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 12 additions & 0 deletions osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapCarousel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,18 @@ public void TestAddRemove()
waitForSelection(set_count);
}

[Solo]
[Test]
public void TestDifficultiesSplitOutOnLoad()
{
loadBeatmaps(new List<BeatmapSetInfo> { TestResources.CreateTestBeatmapSetInfo(diff_count) }, () => new FilterCriteria
{
Sort = SortMode.Difficulty,
});

checkVisibleItemCount(false, 3);
}

[Test]
public void TestAddRemoveDifficultySort()
{
Expand Down
3 changes: 2 additions & 1 deletion osu.Game/Screens/Select/BeatmapCarousel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ internal IEnumerable<BeatmapSetInfo> BeatmapSets

private void loadNewRoot()
{
beatmapsSplitOut = activeCriteria.SplitOutDifficulties;

// Ensure no changes are made to the list while we are initialising items.
// We'll catch up on changes via subscriptions anyway.
BeatmapSetInfo[] loadableSets = detachedBeatmapSets!.ToArray();
Expand Down Expand Up @@ -726,7 +728,6 @@ void perform()

if (activeCriteria.SplitOutDifficulties != beatmapsSplitOut)
{
beatmapsSplitOut = activeCriteria.SplitOutDifficulties;
loadNewRoot();
return;
}
Expand Down

0 comments on commit e88083a

Please sign in to comment.