1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

Move retry sample playback to PlayerLoader

This commit is contained in:
Dean Herbert 2023-07-07 15:36:17 +09:00
parent 170bc5bfce
commit 67746e1369
2 changed files with 8 additions and 5 deletions

View File

@ -112,8 +112,6 @@ namespace osu.Game.Screens.Play
private Ruleset ruleset;
private SkinnableSound sampleRestart;
public BreakOverlay BreakOverlay;
/// <summary>
@ -303,7 +301,6 @@ namespace osu.Game.Screens.Play
Restart(true);
},
},
sampleRestart = new SkinnableSound(new SampleInfo(@"Gameplay/restart", @"pause-retry-click"))
});
}
@ -673,7 +670,6 @@ namespace osu.Game.Screens.Play
// stopping here is to ensure music doesn't become audible after exiting back to PlayerLoader.
musicController.Stop();
sampleRestart?.Play();
RestartRequested?.Invoke(quickRestart);
PerformExit(false);

View File

@ -15,6 +15,7 @@ using osu.Framework.Graphics.Transforms;
using osu.Framework.Input;
using osu.Framework.Screens;
using osu.Framework.Threading;
using osu.Game.Audio;
using osu.Game.Audio.Effects;
using osu.Game.Configuration;
using osu.Game.Graphics;
@ -25,6 +26,7 @@ using osu.Game.Overlays;
using osu.Game.Overlays.Notifications;
using osu.Game.Screens.Menu;
using osu.Game.Screens.Play.PlayerSettings;
using osu.Game.Skinning;
using osu.Game.Users;
using osu.Game.Utils;
using osuTK;
@ -76,6 +78,8 @@ namespace osu.Game.Screens.Play
private AudioFilter lowPassFilter = null!;
private AudioFilter highPassFilter = null!;
private SkinnableSound sampleRestart = null!;
[Cached]
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple);
@ -199,7 +203,8 @@ namespace osu.Game.Screens.Play
},
idleTracker = new IdleTracker(750),
lowPassFilter = new AudioFilter(audio.TrackMixer),
highPassFilter = new AudioFilter(audio.TrackMixer, BQFType.HighPass)
highPassFilter = new AudioFilter(audio.TrackMixer, BQFType.HighPass),
sampleRestart = new SkinnableSound(new SampleInfo(@"Gameplay/restart", @"pause-retry-click"))
};
if (Beatmap.Value.BeatmapInfo.EpilepsyWarning)
@ -265,6 +270,8 @@ namespace osu.Game.Screens.Play
playerConsumed = false;
cancelLoad();
sampleRestart.Play();
contentIn();
}