mirror of
https://github.com/ppy/osu.git
synced 2026-05-26 17:50:34 +08:00
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.
This commit is contained in:
@@ -129,6 +129,7 @@ namespace osu.Game.Overlays.BeatmapListing
|
||||
{
|
||||
base.OnClick(e);
|
||||
Active.Toggle();
|
||||
SelectSample.Play();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the label text to be used for the supplied <paramref name="value"/>.
|
||||
|
||||
Reference in New Issue
Block a user