mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 16:52:54 +08:00
Fix overlay sound effects playing when open requested while disabled
This commit is contained in:
parent
4dd6594547
commit
b1daca6cd3
@ -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:
|
||||
if (playedPopInSound)
|
||||
{
|
||||
samplePopOut?.Play();
|
||||
playedPopInSound = false;
|
||||
}
|
||||
|
||||
if (BlockScreenWideMouse) game?.RemoveBlockingOverlay(this);
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user