mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:12:54 +08:00
Merge pull request #13459 from peppy/fix-wave-overlay-sound-on-switch
This commit is contained in:
commit
c644e11e5a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user