1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-26 07:29:53 +08:00

Merge pull request #13459 from peppy/fix-wave-overlay-sound-on-switch

This commit is contained in:
Bartłomiej Dach
2021-06-11 22:41:23 +02:00
committed by GitHub
Unverified
@@ -107,10 +107,10 @@ namespace osu.Game.Graphics.Containers
{
}
private bool playedPopInSound;
protected override void UpdateState(ValueChangedEvent<Visibility> state)
{
bool didChange = state.NewValue != state.OldValue;
switch (state.NewValue)
{
case Visibility.Visible:
@@ -121,18 +121,15 @@ namespace osu.Game.Graphics.Containers
return;
}
samplePopIn?.Play();
playedPopInSound = true;
if (didChange)
samplePopIn?.Play();
if (BlockScreenWideMouse && DimMainContent) game?.AddBlockingOverlay(this);
break;
case Visibility.Hidden:
if (playedPopInSound)
{
if (didChange)
samplePopOut?.Play();
playedPopInSound = false;
}
if (BlockScreenWideMouse) game?.RemoveBlockingOverlay(this);
break;