1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 14:03:21 +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,
SelectionChanged = updateSelectedBeatmap,
BeatmapSetsChanged = carouselBeatmapsLoaded,
FilterApplied = updateVisibleBeatmapCount,
FilterApplied = () => Scheduler.Add(updateVisibleBeatmapCount),
GetRecommendedBeatmap = s => recommender?.GetRecommendedBeatmap(s),
}, c => carouselContainer.Child = c);
@ -843,7 +843,7 @@ namespace osu.Game.Screens.Select
private void carouselBeatmapsLoaded()
{
bindBindables();
updateVisibleBeatmapCount();
Scheduler.AddOnce(updateVisibleBeatmapCount);
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
// 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;