mirror of
https://github.com/ppy/osu.git
synced 2026-06-03 08:49:57 +08:00
Fade music back in when returning from song select from gameplay
Addresses abrupt playback pointed out in https://github.com/ppy/osu/discussions/34472. In cases where the music is already playing, this isn't required (ie when returning from the player loading screen before gameplay starts).
This commit is contained in:
@@ -598,6 +598,18 @@ namespace osu.Game.Screens.SelectV2
|
||||
|
||||
if (ControlGlobalMusic)
|
||||
{
|
||||
// Avoid abruptly starting playback at preview point.
|
||||
if (!music.IsPlaying)
|
||||
{
|
||||
music.DuckMomentarily(0, new DuckParameters
|
||||
{
|
||||
DuckDuration = 0,
|
||||
DuckVolumeTo = 0,
|
||||
RestoreDuration = 800,
|
||||
RestoreEasing = Easing.OutQuint
|
||||
});
|
||||
}
|
||||
|
||||
// restart playback on returning to song select, regardless.
|
||||
// not sure this should be a permanent thing (we may want to leave a user pause paused even on returning)
|
||||
music.ResetTrackAdjustments();
|
||||
|
||||
Reference in New Issue
Block a user