1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 15:33:05 +08:00

Fix overlay sound effects playing when open requested while disabled

This commit is contained in:
Dean Herbert 2020-09-09 18:05:44 +09:00
parent 4dd6594547
commit b1daca6cd3

View File

@ -103,6 +103,8 @@ namespace osu.Game.Graphics.Containers
{
}
private bool playedPopInSound;
protected override void UpdateState(ValueChangedEvent<Visibility> state)
{
switch (state.NewValue)
@ -115,11 +117,18 @@ namespace osu.Game.Graphics.Containers
}
samplePopIn?.Play();
playedPopInSound = true;
if (BlockScreenWideMouse && DimMainContent) game?.AddBlockingOverlay(this);
break;
case Visibility.Hidden:
samplePopOut?.Play();
if (playedPopInSound)
{
samplePopOut?.Play();
playedPopInSound = false;
}
if (BlockScreenWideMouse) game?.RemoveBlockingOverlay(this);
break;
}