1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 02:42:54 +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

@ -79,6 +79,8 @@ namespace osu.Game.Screens.Play
private SampleChannel sampleRestart;
private SampleChannel samplePause;
public BreakOverlay BreakOverlay;
private BreakTracker breakTracker;
@ -162,6 +164,9 @@ namespace osu.Game.Screens.Play
sampleRestart = audio.Samples.Get(@"Gameplay/restart");
samplePause = audio.Samples.Get(@"Gameplay/pause-loop");
samplePause.Looping = true;
mouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
DrawableRuleset = ruleset.CreateDrawableRulesetWith(playableBeatmap, Mods.Value);
@ -407,8 +412,12 @@ namespace osu.Game.Screens.Play
if (canPause)
Pause();
else
{
samplePause?.Stop();
Logger.LogPrint(@"_______sample stopped in performUserRequestedExit");
this.Exit();
}
}
/// <summary>
/// Restart gameplay via a parent <see cref="PlayerLoader"/>.
@ -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();
}
}