1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 13:03:21 +08:00

Merge pull request #23178 from Joehuu/fix-count-not-updating-when-deleting

Fix song select beatmap difficulty count not updating when deleting
This commit is contained in:
Dean Herbert 2023-04-11 09:46:41 +09:00 committed by GitHub
commit e58e1151f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 1 deletions

View File

@ -1068,6 +1068,21 @@ namespace osu.Game.Tests.Visual.SongSelect
AddAssert("options disabled", () => !songSelect.ChildrenOfType<FooterButtonOptions>().Single().Enabled.Value);
}
[Test]
public void TestTextBoxBeatmapDifficultyCount()
{
createSongSelect();
AddAssert("0 matching shown", () => songSelect.ChildrenOfType<FilterControl>().Single().InformationalText == "0 matching beatmaps");
addRulesetImportStep(0);
AddAssert("3 matching shown", () => songSelect.ChildrenOfType<FilterControl>().Single().InformationalText == "3 matching beatmaps");
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");
}
private void waitForInitialSelection()
{
AddUntilStep("wait for initial selection", () => !Beatmap.IsDefault);

View File

@ -45,7 +45,7 @@ namespace osu.Game.Screens.Select
public float BleedBottom { get; set; }
/// <summary>
/// Triggered when the <see cref="BeatmapSets"/> loaded change and are completely loaded.
/// Triggered when <see cref="BeatmapSets"/> finish loading, or are subsequently changed.
/// </summary>
public Action? BeatmapSetsChanged;
@ -353,6 +353,8 @@ namespace osu.Game.Screens.Select
if (!Scroll.UserScrolling)
ScrollToSelected(true);
BeatmapSetsChanged?.Invoke();
});
public void UpdateBeatmapSet(BeatmapSetInfo beatmapSet) => Schedule(() =>