diff --git a/osu.Game.Tests/Visual/SongSelectV2/BeatmapCarouselTestScene.cs b/osu.Game.Tests/Visual/SongSelectV2/BeatmapCarouselTestScene.cs index 4ea56d3150..0f991abcfc 100644 --- a/osu.Game.Tests/Visual/SongSelectV2/BeatmapCarouselTestScene.cs +++ b/osu.Game.Tests/Visual/SongSelectV2/BeatmapCarouselTestScene.cs @@ -47,6 +47,8 @@ namespace osu.Game.Tests.Visual.SongSelectV2 [Cached] private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Aquamarine); + public Func, BeatmapInfo>? BeatmapRecommendationFunction { get; set; } + private OsuTextFlowContainer stats = null!; private int beatmapCount; @@ -69,6 +71,7 @@ namespace osu.Game.Tests.Visual.SongSelectV2 { AddStep("create components", () => { + BeatmapRecommendationFunction = null; NewItemsPresentedInvocationCount = 0; Box topBox; @@ -105,6 +108,7 @@ namespace osu.Game.Tests.Visual.SongSelectV2 Carousel = new TestBeatmapCarousel { NewItemsPresented = () => NewItemsPresentedInvocationCount++, + ChooseRecommendedBeatmap = beatmaps => BeatmapRecommendationFunction?.Invoke(beatmaps) ?? beatmaps.First(), BleedTop = 50, BleedBottom = 50, Anchor = Anchor.Centre, diff --git a/osu.Game.Tests/Visual/SongSelectV2/TestSceneBeatmapCarouselNoGrouping.cs b/osu.Game.Tests/Visual/SongSelectV2/TestSceneBeatmapCarouselNoGrouping.cs index c0228e8af7..7214cb1e16 100644 --- a/osu.Game.Tests/Visual/SongSelectV2/TestSceneBeatmapCarouselNoGrouping.cs +++ b/osu.Game.Tests/Visual/SongSelectV2/TestSceneBeatmapCarouselNoGrouping.cs @@ -267,7 +267,7 @@ namespace osu.Game.Tests.Visual.SongSelectV2 AddBeatmaps(5, 3); WaitForDrawablePanels(); - AddStep("set recommendation algorithm", () => Carousel.GetRecommendedBeatmap = beatmaps => beatmaps.Last()); + AddStep("set recommendation algorithm", () => BeatmapRecommendationFunction = beatmaps => beatmaps.Last()); SelectPrevGroup(); diff --git a/osu.Game/Screens/SelectV2/BeatmapCarousel.cs b/osu.Game/Screens/SelectV2/BeatmapCarousel.cs index 7cffecdb3b..08481547c0 100644 --- a/osu.Game/Screens/SelectV2/BeatmapCarousel.cs +++ b/osu.Game/Screens/SelectV2/BeatmapCarousel.cs @@ -27,9 +27,9 @@ namespace osu.Game.Screens.SelectV2 public Action? RequestPresentBeatmap { private get; init; } /// - /// Accepts a list of beatmaps and returns the beatmap recommended for the user. + /// From the provided beatmaps, return the most appropriate one for the user's skill. /// - public Func, BeatmapInfo>? GetRecommendedBeatmap { private get; set; } + public Func, BeatmapInfo>? ChooseRecommendedBeatmap { private get; init; } public const float SPACING = 3f; @@ -190,7 +190,7 @@ namespace osu.Game.Screens.SelectV2 if (grouping.SetItems.TryGetValue(setInfo, out var items)) { var beatmaps = items.Select(i => i.Model).OfType(); - CurrentSelection = GetRecommendedBeatmap?.Invoke(beatmaps) ?? beatmaps.First(); + CurrentSelection = ChooseRecommendedBeatmap?.Invoke(beatmaps) ?? beatmaps.First(); } return; diff --git a/osu.Game/Screens/SelectV2/SongSelect.cs b/osu.Game/Screens/SelectV2/SongSelect.cs index 88079d7c95..5a2df8bfbf 100644 --- a/osu.Game/Screens/SelectV2/SongSelect.cs +++ b/osu.Game/Screens/SelectV2/SongSelect.cs @@ -165,7 +165,7 @@ namespace osu.Game.Screens.SelectV2 BleedTop = FilterControl.HEIGHT_FROM_SCREEN_TOP + 5, BleedBottom = ScreenFooter.HEIGHT + 5, RequestPresentBeatmap = _ => OnStart(), - GetRecommendedBeatmap = getRecommendedBeatmap, + ChooseRecommendedBeatmap = getRecommendedBeatmap, NewItemsPresented = newItemsPresented, RelativeSizeAxes = Axes.Both, },