1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 23:52:57 +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
commit c644e11e5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}
if (didChange)
samplePopIn?.Play();
playedPopInSound = true;
if (BlockScreenWideMouse && DimMainContent) game?.AddBlockingOverlay(this);
break;
case Visibility.Hidden:
if (playedPopInSound)
{
if (didChange)
samplePopOut?.Play();
playedPopInSound = false;
}
if (BlockScreenWideMouse) game?.RemoveBlockingOverlay(this);
break;