mirror of
https://github.com/ppy/osu.git
synced 2026-06-07 00:04:29 +08:00
Move duck code to run before looping is setup
This commit is contained in:
@@ -404,9 +404,6 @@ namespace osu.Game.Screens.SelectV2
|
||||
|
||||
private void beginLooping()
|
||||
{
|
||||
if (!ControlGlobalMusic)
|
||||
return;
|
||||
|
||||
Debug.Assert(!isHandlingLooping);
|
||||
|
||||
isHandlingLooping = true;
|
||||
@@ -598,18 +595,6 @@ 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();
|
||||
@@ -646,7 +631,23 @@ namespace osu.Game.Screens.SelectV2
|
||||
|
||||
updateWedgeVisibility();
|
||||
|
||||
beginLooping();
|
||||
if (ControlGlobalMusic)
|
||||
{
|
||||
// Avoid abruptly starting playback at preview point.
|
||||
// Importantly, this should be done before looping is setup to ensure we get the correct imminent `IsPlaying` state.
|
||||
if (!music.IsPlaying)
|
||||
{
|
||||
music.DuckMomentarily(0, new DuckParameters
|
||||
{
|
||||
DuckDuration = 0,
|
||||
DuckVolumeTo = 0,
|
||||
RestoreDuration = 800,
|
||||
RestoreEasing = Easing.OutQuint
|
||||
});
|
||||
}
|
||||
|
||||
beginLooping();
|
||||
}
|
||||
|
||||
ensureGlobalBeatmapValid();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user