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

Add safeties to ensure the current track doesn't loop or change

This commit is contained in:
Dean Herbert 2020-09-03 13:15:16 +09:00
parent 547c8090e5
commit 2f42c57f4b

View File

@ -126,6 +126,12 @@ namespace osu.Game.Screens.Menu
double fadeOutTime = exit_delay; double fadeOutTime = exit_delay;
var track = musicController.CurrentTrack;
// ensure the track doesn't change or loop as we are exiting.
track.Looping = false;
Beatmap.Disabled = true;
// we also handle the exit transition. // we also handle the exit transition.
if (MenuVoice.Value) if (MenuVoice.Value)
{ {
@ -134,7 +140,7 @@ namespace osu.Game.Screens.Menu
// if playing the outro voice, we have more time to have fun with the background track. // if playing the outro voice, we have more time to have fun with the background track.
// initially fade to almost silent then ramp out over the remaining time. // initially fade to almost silent then ramp out over the remaining time.
const double initial_fade = 200; const double initial_fade = 200;
musicController.CurrentTrack track
.VolumeTo(0.03f, initial_fade).Then() .VolumeTo(0.03f, initial_fade).Then()
.VolumeTo(0, fadeOutTime - initial_fade, Easing.In); .VolumeTo(0, fadeOutTime - initial_fade, Easing.In);
} }
@ -143,7 +149,7 @@ namespace osu.Game.Screens.Menu
fadeOutTime = 500; fadeOutTime = 500;
// if outro voice is turned off, just do a simple fade out. // if outro voice is turned off, just do a simple fade out.
musicController.CurrentTrack.VolumeTo(0, fadeOutTime, Easing.Out); track.VolumeTo(0, fadeOutTime, Easing.Out);
} }
//don't want to fade out completely else we will stop running updates. //don't want to fade out completely else we will stop running updates.