mirror of
https://github.com/osukey/osukey.git
synced 2025-06-01 02:47:31 +09: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)
|
protected override void UpdateState(ValueChangedEvent<Visibility> state)
|
||||||
{
|
{
|
||||||
switch (state.NewValue)
|
switch (state.NewValue)
|
||||||
@ -115,11 +117,18 @@ namespace osu.Game.Graphics.Containers
|
|||||||
}
|
}
|
||||||
|
|
||||||
samplePopIn?.Play();
|
samplePopIn?.Play();
|
||||||
|
playedPopInSound = true;
|
||||||
|
|
||||||
if (BlockScreenWideMouse && DimMainContent) game?.AddBlockingOverlay(this);
|
if (BlockScreenWideMouse && DimMainContent) game?.AddBlockingOverlay(this);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Visibility.Hidden:
|
case Visibility.Hidden:
|
||||||
|
if (playedPopInSound)
|
||||||
|
{
|
||||||
samplePopOut?.Play();
|
samplePopOut?.Play();
|
||||||
|
playedPopInSound = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (BlockScreenWideMouse) game?.RemoveBlockingOverlay(this);
|
if (BlockScreenWideMouse) game?.RemoveBlockingOverlay(this);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user