1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 13:22:55 +08:00

added music during pause

This commit is contained in:
BananeVolante 2020-06-12 19:17:52 +02:00
parent 527577d7c3
commit 2feaf2c74a

View File

@ -78,6 +78,8 @@ namespace osu.Game.Screens.Play
private IAPIProvider api { get; set; }
private SampleChannel sampleRestart;
private SampleChannel samplePause;
public BreakOverlay BreakOverlay;
@ -161,6 +163,9 @@ namespace osu.Game.Screens.Play
return;
sampleRestart = audio.Samples.Get(@"Gameplay/restart");
samplePause = audio.Samples.Get(@"Gameplay/pause-loop");
samplePause.Looping = true;
mouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
@ -407,7 +412,11 @@ namespace osu.Game.Screens.Play
if (canPause)
Pause();
else
{
samplePause?.Stop();
Logger.LogPrint(@"_______sample stopped in performUserRequestedExit");
this.Exit();
}
}
/// <summary>
@ -416,6 +425,8 @@ namespace osu.Game.Screens.Play
/// </summary>
public void Restart()
{
Logger.LogPrint(@"_______sample stopped in Restart");
samplePause?.Stop();
sampleRestart?.Play();
RestartRequested?.Invoke();
@ -564,6 +575,8 @@ namespace osu.Game.Screens.Play
GameplayClockContainer.Stop();
PauseOverlay.Show();
lastPauseActionTime = GameplayClockContainer.GameplayClock.CurrentTime;
samplePause?.Play();
}
public void Resume()
@ -583,6 +596,8 @@ namespace osu.Game.Screens.Play
{
GameplayClockContainer.Start();
IsResuming = false;
Logger.LogPrint(@"_______sample stopped in Resume");
samplePause?.Stop();
}
}