mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 06:52:56 +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)
|
protected override void UpdateState(ValueChangedEvent<Visibility> state)
|
||||||
{
|
{
|
||||||
|
bool didChange = state.NewValue != state.OldValue;
|
||||||
|
|
||||||
switch (state.NewValue)
|
switch (state.NewValue)
|
||||||
{
|
{
|
||||||
case Visibility.Visible:
|
case Visibility.Visible:
|
||||||
@ -121,18 +121,15 @@ namespace osu.Game.Graphics.Containers
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (didChange)
|
||||||
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)
|
if (didChange)
|
||||||
{
|
|
||||||
samplePopOut?.Play();
|
samplePopOut?.Play();
|
||||||
playedPopInSound = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (BlockScreenWideMouse) game?.RemoveBlockingOverlay(this);
|
if (BlockScreenWideMouse) game?.RemoveBlockingOverlay(this);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user