mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:12:54 +08:00
Add fallback-to-default logic for HoverSounds and HoverClickSounds
This commit is contained in:
parent
15d3b4444d
commit
4f80a3b66d
@ -45,7 +45,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio)
|
||||
{
|
||||
sampleClick = audio.Samples.Get($@"UI/{SampleSet.GetDescription()}-select");
|
||||
sampleClick = audio.Samples.Get($@"UI/{SampleSet.GetDescription()}-select") ?? audio.Samples.Get($@"UI/{HoverSampleSet.Default.GetDescription()}-select");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio, SessionStatics statics)
|
||||
{
|
||||
sampleHover = audio.Samples.Get($@"UI/{SampleSet.GetDescription()}-hover");
|
||||
sampleHover = audio.Samples.Get($@"UI/{SampleSet.GetDescription()}-hover") ?? audio.Samples.Get($@"UI/{HoverSampleSet.Default.GetDescription()}-hover");
|
||||
}
|
||||
|
||||
public override void PlayHoverSample()
|
||||
@ -44,7 +44,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
public enum HoverSampleSet
|
||||
{
|
||||
[Description("default")]
|
||||
Loud,
|
||||
Default,
|
||||
|
||||
[Description("soft")]
|
||||
Normal,
|
||||
|
@ -49,7 +49,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
protected Box Background;
|
||||
protected SpriteText SpriteText;
|
||||
|
||||
public OsuButton(HoverSampleSet? hoverSounds = HoverSampleSet.Loud)
|
||||
public OsuButton(HoverSampleSet? hoverSounds = HoverSampleSet.Default)
|
||||
{
|
||||
Height = 40;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user