mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 19:22:54 +08:00
Add hover sounds to mod buttons
This commit is contained in:
parent
880418fd0d
commit
c5aacb75c6
@ -17,6 +17,7 @@ using osu.Game.Rulesets.UI;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
|
||||
namespace osu.Game.Overlays.Mods
|
||||
{
|
||||
@ -31,7 +32,7 @@ namespace osu.Game.Overlays.Mods
|
||||
private readonly Container<ModIcon> iconsContainer;
|
||||
private SampleChannel sampleOn, sampleOff;
|
||||
|
||||
public Action<Mod> Action; // Passed the selected mod or null if none
|
||||
public new Action<Mod> Action; // Passed the selected mod or null if none
|
||||
|
||||
public string TooltipText => (SelectedMod?.Description ?? Mods.FirstOrDefault()?.Description) ?? string.Empty;
|
||||
|
||||
@ -148,7 +149,7 @@ namespace osu.Game.Overlays.Mods
|
||||
|
||||
// the mods from Mod, only multiple if Mod is a MultiMod
|
||||
|
||||
public override Mod SelectedMod => Mods.ElementAtOrDefault(SelectedIndex);
|
||||
public virtual Mod SelectedMod => Mods.ElementAtOrDefault(SelectedIndex);
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio)
|
||||
@ -253,6 +254,7 @@ namespace osu.Game.Overlays.Mods
|
||||
Anchor = Anchor.TopCentre,
|
||||
TextSize = 18,
|
||||
},
|
||||
new HoverClickSounds()
|
||||
};
|
||||
|
||||
Mod = mod;
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
using OpenTK;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
|
||||
namespace osu.Game.Overlays.Mods
|
||||
{
|
||||
@ -12,8 +11,6 @@ namespace osu.Game.Overlays.Mods
|
||||
/// </summary>
|
||||
public class ModButtonEmpty : Container
|
||||
{
|
||||
public virtual Mod SelectedMod => null;
|
||||
|
||||
public ModButtonEmpty()
|
||||
{
|
||||
Size = new Vector2(100f);
|
||||
|
Loading…
Reference in New Issue
Block a user