From 42892acc1adaf8be01897de0c4e5fef7b6319a4d Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Wed, 17 Apr 2024 02:42:24 +0300 Subject: [PATCH] Fix multiple selection filter tab items no longer playing sounds These tab items are not managed by a `TabControl`, activation events are manually served by the class itself toggling `Active` when clicked. --- .../BeatmapSearchMultipleSelectionFilterRow.cs | 1 + osu.Game/Overlays/BeatmapListing/FilterTabItem.cs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/BeatmapListing/BeatmapSearchMultipleSelectionFilterRow.cs b/osu.Game/Overlays/BeatmapListing/BeatmapSearchMultipleSelectionFilterRow.cs index e59beb43ff..0a4c2b1e21 100644 --- a/osu.Game/Overlays/BeatmapListing/BeatmapSearchMultipleSelectionFilterRow.cs +++ b/osu.Game/Overlays/BeatmapListing/BeatmapSearchMultipleSelectionFilterRow.cs @@ -129,6 +129,7 @@ namespace osu.Game.Overlays.BeatmapListing { base.OnClick(e); Active.Toggle(); + SelectSample.Play(); return true; } } diff --git a/osu.Game/Overlays/BeatmapListing/FilterTabItem.cs b/osu.Game/Overlays/BeatmapListing/FilterTabItem.cs index 89bf61dd18..ee188d34ce 100644 --- a/osu.Game/Overlays/BeatmapListing/FilterTabItem.cs +++ b/osu.Game/Overlays/BeatmapListing/FilterTabItem.cs @@ -26,7 +26,7 @@ namespace osu.Game.Overlays.BeatmapListing private OsuSpriteText text; - private Sample selectSample = null!; + protected Sample SelectSample { get; private set; } = null!; public FilterTabItem(T value) : base(value) @@ -49,7 +49,7 @@ namespace osu.Game.Overlays.BeatmapListing Enabled.Value = true; - selectSample = audio.Samples.Get(@"UI/tabselect-select"); + SelectSample = audio.Samples.Get(@"UI/tabselect-select"); } protected override void LoadComplete() @@ -77,7 +77,7 @@ namespace osu.Game.Overlays.BeatmapListing protected override void OnDeactivated() => UpdateState(); - protected override void OnActivatedByUser() => selectSample.Play(); + protected override void OnActivatedByUser() => SelectSample.Play(); /// /// Returns the label text to be used for the supplied .