mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Ensure all OsuFocusedOverlayContainers contribute to screen fading
This commit is contained in:
@ -24,7 +24,11 @@ namespace osu.Game.Graphics.Containers
|
||||
|
||||
protected override bool BlockNonPositionalInput => true;
|
||||
|
||||
private PreviewTrackManager previewTrackManager;
|
||||
[Resolved(CanBeNull = true)]
|
||||
private OsuGame osuGame { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private PreviewTrackManager previewTrackManager { get; set; }
|
||||
|
||||
protected readonly Bindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.All);
|
||||
|
||||
@ -36,10 +40,8 @@ namespace osu.Game.Graphics.Containers
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(OsuGame osuGame, AudioManager audio, PreviewTrackManager previewTrackManager)
|
||||
private void load(AudioManager audio)
|
||||
{
|
||||
this.previewTrackManager = previewTrackManager;
|
||||
|
||||
if (osuGame != null)
|
||||
OverlayActivationMode.BindTo(osuGame.OverlayActivationMode);
|
||||
|
||||
@ -93,6 +95,7 @@ namespace osu.Game.Graphics.Containers
|
||||
if (OverlayActivationMode.Value != OverlayActivation.Disabled)
|
||||
{
|
||||
if (PlaySamplesOnStateChange) samplePopIn?.Play();
|
||||
if (BlockScreenWideMouse) osuGame?.AddBlockingOverlay(this);
|
||||
}
|
||||
else
|
||||
State = Visibility.Hidden;
|
||||
@ -100,6 +103,7 @@ namespace osu.Game.Graphics.Containers
|
||||
break;
|
||||
case Visibility.Hidden:
|
||||
if (PlaySamplesOnStateChange) samplePopOut?.Play();
|
||||
if (BlockScreenWideMouse) osuGame?.RemoveBlockingOverlay(this);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -109,5 +113,11 @@ namespace osu.Game.Graphics.Containers
|
||||
base.PopOut();
|
||||
previewTrackManager.StopAnyPlaying(this);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
base.Dispose(isDisposing);
|
||||
osuGame?.RemoveBlockingOverlay(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user