1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-07 13:07:25 +08:00

Fix importing beatmaps not changing count of visible beatmaps

Reproduction steps:

1. Go to song select
2. Open beatmap listing
3. Import a beatmap that would fit the current filter criteria
4. The count of visible beatmaps does not change

Fixed by updating the count on `BeatmapSetsChanged` too.
This commit is contained in:
Bartłomiej Dach 2023-03-20 20:49:47 +01:00
parent 695ee39b87
commit ea8da69263
No known key found for this signature in database

View File

@ -162,15 +162,7 @@ namespace osu.Game.Screens.Select
BleedBottom = Footer.HEIGHT, BleedBottom = Footer.HEIGHT,
SelectionChanged = updateSelectedBeatmap, SelectionChanged = updateSelectedBeatmap,
BeatmapSetsChanged = carouselBeatmapsLoaded, BeatmapSetsChanged = carouselBeatmapsLoaded,
FilterApplied = () => FilterApplied = updateVisibleBeatmapCount,
{
FilterControl.InformationalText =
Carousel.CountDisplayed == 1
// Intentionally not localised until we have proper support for this (see https://github.com/ppy/osu-framework/pull/4918
// but also in this case we want support for formatting a number within a string).
? $"{Carousel.CountDisplayed:#,0} matching beatmap"
: $"{Carousel.CountDisplayed:#,0} matching beatmaps";
},
GetRecommendedBeatmap = s => recommender?.GetRecommendedBeatmap(s), GetRecommendedBeatmap = s => recommender?.GetRecommendedBeatmap(s),
}, c => carouselContainer.Child = c); }, c => carouselContainer.Child = c);
@ -837,6 +829,7 @@ namespace osu.Game.Screens.Select
private void carouselBeatmapsLoaded() private void carouselBeatmapsLoaded()
{ {
bindBindables(); bindBindables();
updateVisibleBeatmapCount();
Carousel.AllowSelection = true; Carousel.AllowSelection = true;
@ -866,6 +859,15 @@ namespace osu.Game.Screens.Select
} }
} }
private void updateVisibleBeatmapCount()
{
FilterControl.InformationalText = Carousel.CountDisplayed == 1
// Intentionally not localised until we have proper support for this (see https://github.com/ppy/osu-framework/pull/4918
// but also in this case we want support for formatting a number within a string).
? $"{Carousel.CountDisplayed:#,0} matching beatmap"
: $"{Carousel.CountDisplayed:#,0} matching beatmaps";
}
private bool boundLocalBindables; private bool boundLocalBindables;
private void bindBindables() private void bindBindables()