Properly fix dialog overlay playing double samples on show/hide

This commit is contained in:
Joehu
2019-09-11 15:35:47 -07:00
parent f9c6a8c5b7
commit e0bf579b18
3 changed files with 17 additions and 25 deletions

View File

@ -21,8 +21,6 @@ namespace osu.Game.Graphics.Containers
private SampleChannel samplePopIn;
private SampleChannel samplePopOut;
protected virtual bool PlaySamplesOnStateChange => true;
protected override bool BlockNonPositionalInput => true;
/// <summary>
@ -126,12 +124,12 @@ namespace osu.Game.Graphics.Containers
return;
}
if (PlaySamplesOnStateChange) samplePopIn?.Play();
samplePopIn?.Play();
if (BlockScreenWideMouse && DimMainContent) game?.AddBlockingOverlay(this);
break;
case Visibility.Hidden:
if (PlaySamplesOnStateChange) samplePopOut?.Play();
samplePopOut?.Play();
if (BlockScreenWideMouse) game?.RemoveBlockingOverlay(this);
break;
}