mirror of
https://github.com/osukey/osukey.git
synced 2025-06-09 13:28:03 +09: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)
|
protected override void UpdateState(ValueChangedEvent<Visibility> state)
|
||||||
{
|
{
|
||||||
switch (state.NewValue)
|
switch (state.NewValue)
|
||||||
@ -110,16 +112,24 @@ namespace osu.Game.Graphics.Containers
|
|||||||
case Visibility.Visible:
|
case Visibility.Visible:
|
||||||
if (OverlayActivationMode.Value == OverlayActivation.Disabled)
|
if (OverlayActivationMode.Value == OverlayActivation.Disabled)
|
||||||
{
|
{
|
||||||
|
// todo: visual/audible feedback that this operation could not complete.
|
||||||
State.Value = Visibility.Hidden;
|
State.Value = Visibility.Hidden;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
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:
|
||||||
samplePopOut?.Play();
|
if (playedPopInSound)
|
||||||
|
{
|
||||||
|
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