mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 15:33:05 +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]
|
[BackgroundDependencyLoader]
|
||||||
private void load(AudioManager audio)
|
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]
|
[BackgroundDependencyLoader]
|
||||||
private void load(AudioManager audio, SessionStatics statics)
|
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()
|
public override void PlayHoverSample()
|
||||||
@ -44,7 +44,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
public enum HoverSampleSet
|
public enum HoverSampleSet
|
||||||
{
|
{
|
||||||
[Description("default")]
|
[Description("default")]
|
||||||
Loud,
|
Default,
|
||||||
|
|
||||||
[Description("soft")]
|
[Description("soft")]
|
||||||
Normal,
|
Normal,
|
||||||
|
@ -49,7 +49,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
protected Box Background;
|
protected Box Background;
|
||||||
protected SpriteText SpriteText;
|
protected SpriteText SpriteText;
|
||||||
|
|
||||||
public OsuButton(HoverSampleSet? hoverSounds = HoverSampleSet.Loud)
|
public OsuButton(HoverSampleSet? hoverSounds = HoverSampleSet.Default)
|
||||||
{
|
{
|
||||||
Height = 40;
|
Height = 40;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user