1
0
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:
Jamie Taylor 2021-06-11 20:14:35 +09:00
parent 15d3b4444d
commit 4f80a3b66d
No known key found for this signature in database
GPG Key ID: 2ACFA8B6370B8C8C
3 changed files with 4 additions and 4 deletions

View File

@ -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");
} }
} }
} }

View File

@ -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,

View File

@ -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;