Merge pull request #27898 from bdach/preview-tracks-playing-after-hide

Fix preview tracks playing after their owning overlay has hidden
This commit is contained in:
Dean Herbert 2024-04-16 23:54:54 +08:00 committed by GitHub
commit 15d286e57d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -40,10 +40,12 @@ namespace osu.Game.Overlays
protected override void PopOut()
{
base.PopOut();
Waves.Hide();
this.FadeOut(WaveContainer.DISAPPEAR_DURATION, Easing.InQuint);
this.FadeOut(WaveContainer.DISAPPEAR_DURATION, Easing.InQuint)
// base call is responsible for stopping preview tracks.
// delay it until the fade has concluded to ensure that nothing inside the overlay has triggered
// another preview track playback in the meantime, leaving an "orphaned" preview playing.
.OnComplete(_ => base.PopOut());
}
}
}