1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 06:52:56 +08:00

Debounce count updates for good measure

This commit is contained in:
Dean Herbert 2023-12-18 20:30:56 +09:00
parent 6fa1f5ef9b
commit 034c5cd654
No known key found for this signature in database

View File

@ -162,7 +162,7 @@ namespace osu.Game.Screens.Select
BleedBottom = Footer.HEIGHT, BleedBottom = Footer.HEIGHT,
SelectionChanged = updateSelectedBeatmap, SelectionChanged = updateSelectedBeatmap,
BeatmapSetsChanged = carouselBeatmapsLoaded, BeatmapSetsChanged = carouselBeatmapsLoaded,
FilterApplied = updateVisibleBeatmapCount, FilterApplied = () => Scheduler.Add(updateVisibleBeatmapCount),
GetRecommendedBeatmap = s => recommender?.GetRecommendedBeatmap(s), GetRecommendedBeatmap = s => recommender?.GetRecommendedBeatmap(s),
}, c => carouselContainer.Child = c); }, c => carouselContainer.Child = c);
@ -843,7 +843,7 @@ namespace osu.Game.Screens.Select
private void carouselBeatmapsLoaded() private void carouselBeatmapsLoaded()
{ {
bindBindables(); bindBindables();
updateVisibleBeatmapCount(); Scheduler.AddOnce(updateVisibleBeatmapCount);
Carousel.AllowSelection = true; Carousel.AllowSelection = true;
@ -877,7 +877,8 @@ namespace osu.Game.Screens.Select
{ {
// Intentionally not localised until we have proper support for this (see https://github.com/ppy/osu-framework/pull/4918 // 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). // but also in this case we want support for formatting a number within a string).
FilterControl.InformationalText = Carousel.CountDisplayed != 1 ? $"{Carousel.CountDisplayed:#,0} matches" : $"{Carousel.CountDisplayed:#,0} match"; int carouselCountDisplayed = Carousel.CountDisplayed;
FilterControl.InformationalText = carouselCountDisplayed != 1 ? $"{carouselCountDisplayed:#,0} matches" : $"{carouselCountDisplayed:#,0} match";
} }
private bool boundLocalBindables; private bool boundLocalBindables;