1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 16:12:57 +08:00

Add support for skinnable "retry" sound

This commit is contained in:
Dean Herbert 2023-07-06 12:25:15 +09:00
parent f3576b88a4
commit 170bc5bfce

View File

@ -11,8 +11,6 @@ using System.Threading;
using System.Threading.Tasks;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Bindables;
using osu.Framework.Extensions;
using osu.Framework.Graphics;
@ -114,7 +112,7 @@ namespace osu.Game.Screens.Play
private Ruleset ruleset;
private Sample sampleRestart;
private SkinnableSound sampleRestart;
public BreakOverlay BreakOverlay;
@ -195,7 +193,7 @@ namespace osu.Game.Screens.Play
}
[BackgroundDependencyLoader(true)]
private void load(AudioManager audio, OsuConfigManager config, OsuGameBase game, CancellationToken cancellationToken)
private void load(OsuConfigManager config, OsuGameBase game, CancellationToken cancellationToken)
{
var gameplayMods = Mods.Value.Select(m => m.DeepClone()).ToArray();
@ -213,8 +211,6 @@ namespace osu.Game.Screens.Play
if (playableBeatmap == null)
return;
sampleRestart = audio.Samples.Get(@"Gameplay/restart");
mouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
if (game != null)
@ -295,7 +291,9 @@ namespace osu.Game.Screens.Play
if (Configuration.AllowRestart)
{
rulesetSkinProvider.Add(new HotkeyRetryOverlay
rulesetSkinProvider.AddRange(new Drawable[]
{
new HotkeyRetryOverlay
{
Action = () =>
{
@ -304,6 +302,8 @@ namespace osu.Game.Screens.Play
fadeOut(true);
Restart(true);
},
},
sampleRestart = new SkinnableSound(new SampleInfo(@"Gameplay/restart", @"pause-retry-click"))
});
}