mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 11:07:52 +08:00
Merge pull request #10097 from peppy/fix-overlay-sound-on-disabled
Fix overlay sound effects playing when open requested while disabled
This commit is contained in:
commit
989d44412e
@ -103,6 +103,8 @@ namespace osu.Game.Graphics.Containers
|
||||
{
|
||||
}
|
||||
|
||||
private bool playedPopInSound;
|
||||
|
||||
protected override void UpdateState(ValueChangedEvent<Visibility> state)
|
||||
{
|
||||
switch (state.NewValue)
|
||||
@ -110,16 +112,24 @@ namespace osu.Game.Graphics.Containers
|
||||
case Visibility.Visible:
|
||||
if (OverlayActivationMode.Value == OverlayActivation.Disabled)
|
||||
{
|
||||
// todo: visual/audible feedback that this operation could not complete.
|
||||
State.Value = Visibility.Hidden;
|
||||
return;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user