mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Fix mod button sounds playing when mod overlay is not visible
Resolves #2240.
This commit is contained in:
@ -4,9 +4,6 @@
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using OpenTK.Input;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
@ -30,7 +27,6 @@ namespace osu.Game.Overlays.Mods
|
||||
private ModIcon backgroundIcon;
|
||||
private readonly SpriteText text;
|
||||
private readonly Container<ModIcon> iconsContainer;
|
||||
private SampleChannel sampleOn, sampleOff;
|
||||
|
||||
/// <summary>
|
||||
/// Fired when the selection changes.
|
||||
@ -100,7 +96,6 @@ namespace osu.Game.Overlays.Mods
|
||||
|
||||
foregroundIcon.Highlighted = Selected;
|
||||
|
||||
(selectedIndex == -1 ? sampleOff : sampleOn).Play();
|
||||
SelectionChanged?.Invoke(SelectedMod);
|
||||
return true;
|
||||
}
|
||||
@ -152,13 +147,6 @@ namespace osu.Game.Overlays.Mods
|
||||
|
||||
public virtual Mod SelectedMod => Mods.ElementAtOrDefault(selectedIndex);
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio)
|
||||
{
|
||||
sampleOn = audio.Sample.Get(@"UI/check-on");
|
||||
sampleOff = audio.Sample.Get(@"UI/check-off");
|
||||
}
|
||||
|
||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
|
||||
{
|
||||
switch (args.Button)
|
||||
|
Reference in New Issue
Block a user