1
0
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:
Dean Herbert
2025-08-04 17:45:08 +09:00
Unverified
parent 1d8885131e
commit 9fa95ceabe
+17 -16
View File
@@ -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();