Revert back to one number with "matching beatmap difficulties" label

This commit is contained in:
Joseph Madamba 2023-04-10 23:37:29 -07:00
parent f0c8a3202b
commit d0cbe206a9
No known key found for this signature in database
GPG Key ID: 8B746C7BDDF0BD76
3 changed files with 5 additions and 10 deletions

View File

@ -1073,14 +1073,14 @@ public void TestTextBoxBeatmapDifficultyCount()
{
createSongSelect();
AddAssert("0 matching shown", () => songSelect.ChildrenOfType<FilterControl>().Single().InformationalText == "0 matching beatmaps");
AddAssert("0 matching shown", () => songSelect.ChildrenOfType<FilterControl>().Single().InformationalText == "0 matching beatmap difficulties");
addRulesetImportStep(0);
AddAssert("3 matching shown", () => songSelect.ChildrenOfType<FilterControl>().Single().InformationalText == "3 matching beatmaps");
AddAssert("3 matching shown", () => songSelect.ChildrenOfType<FilterControl>().Single().InformationalText == "3 matching beatmap difficulties");
AddStep("delete all beatmaps", () => manager.Delete());
AddUntilStep("wait for no beatmap", () => Beatmap.IsDefault);
AddAssert("0 matching shown", () => songSelect.ChildrenOfType<FilterControl>().Single().InformationalText == "0 matching beatmaps");
AddAssert("0 matching shown", () => songSelect.ChildrenOfType<FilterControl>().Single().InformationalText == "0 matching beatmap difficulties");
}
private void waitForInitialSelection()

View File

@ -64,12 +64,7 @@ public partial class BeatmapCarousel : CompositeDrawable, IKeyBindingHandler<Glo
/// <summary>
/// The total count of non-filtered beatmaps displayed.
/// </summary>
public int CountDisplayedBeatmaps => beatmapSets.Where(s => !s.Filtered.Value).Sum(s => s.Beatmaps.Count(b => !b.Filtered.Value));
/// <summary>
/// The total count of non-filtered beatmap sets displayed.
/// </summary>
public int CountDisplayedSets => beatmapSets.Count(s => !s.Filtered.Value);
public int CountDisplayed => beatmapSets.Where(s => !s.Filtered.Value).Sum(s => s.Beatmaps.Count(b => !b.Filtered.Value));
/// <summary>
/// The currently selected beatmap set.

View File

@ -864,7 +864,7 @@ private void updateVisibleBeatmapCount()
{
// 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 = $"{"matching beatmap".ToQuantity(Carousel.CountDisplayedSets, "#,0")} ({"difficulty".ToQuantity(Carousel.CountDisplayedBeatmaps, "#,0")})";
FilterControl.InformationalText = $"{"matching beatmap difficulty".ToQuantity(Carousel.CountDisplayed, "#,0")}";
}
private bool boundLocalBindables;