mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Extract interface for overlay management
This commit is contained in:
@ -34,7 +34,7 @@ namespace osu.Game.Graphics.Containers
|
||||
protected virtual bool DimMainContent => true;
|
||||
|
||||
[Resolved(CanBeNull = true)]
|
||||
private OsuGame game { get; set; }
|
||||
private IOverlayManager overlayManager { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private PreviewTrackManager previewTrackManager { get; set; }
|
||||
@ -50,8 +50,8 @@ namespace osu.Game.Graphics.Containers
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
if (game != null)
|
||||
OverlayActivationMode.BindTo(game.OverlayActivationMode);
|
||||
if (overlayManager != null)
|
||||
OverlayActivationMode.BindTo(overlayManager.OverlayActivationMode);
|
||||
|
||||
OverlayActivationMode.BindValueChanged(mode =>
|
||||
{
|
||||
@ -127,14 +127,14 @@ namespace osu.Game.Graphics.Containers
|
||||
if (didChange)
|
||||
samplePopIn?.Play();
|
||||
|
||||
if (BlockScreenWideMouse && DimMainContent) game?.ShowBlockingOverlay(this);
|
||||
if (BlockScreenWideMouse && DimMainContent) overlayManager?.ShowBlockingOverlay(this);
|
||||
break;
|
||||
|
||||
case Visibility.Hidden:
|
||||
if (didChange)
|
||||
samplePopOut?.Play();
|
||||
|
||||
if (BlockScreenWideMouse) game?.HideBlockingOverlay(this);
|
||||
if (BlockScreenWideMouse) overlayManager?.HideBlockingOverlay(this);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -150,7 +150,7 @@ namespace osu.Game.Graphics.Containers
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
base.Dispose(isDisposing);
|
||||
game?.HideBlockingOverlay(this);
|
||||
overlayManager?.HideBlockingOverlay(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user