diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenBlack.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenBlack.cs index 742d149580..0a53b0d77b 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenBlack.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenBlack.cs @@ -10,18 +10,28 @@ namespace osu.Game.Screens.Backgrounds { public partial class BackgroundScreenBlack : BackgroundScreen { - public BackgroundScreenBlack() + private readonly double delayBeforeBlack; + private readonly Box box; + + public BackgroundScreenBlack(double delayBeforeBlack = 0) { - InternalChild = new Box + this.delayBeforeBlack = delayBeforeBlack; + + InternalChild = box = new Box { Colour = Color4.Black, RelativeSizeAxes = Axes.Both, }; + + Alpha = 0; } public override void OnEntering(ScreenTransitionEvent e) { - Show(); + this + .Delay(delayBeforeBlack) + .FadeIn(200) + .OnComplete(_ => box.Hide()); } } } diff --git a/osu.Game/Screens/OnlinePlay/OnlinePlayScreen.cs b/osu.Game/Screens/OnlinePlay/OnlinePlayScreen.cs index cb14680626..9e39400c3a 100644 --- a/osu.Game/Screens/OnlinePlay/OnlinePlayScreen.cs +++ b/osu.Game/Screens/OnlinePlay/OnlinePlayScreen.cs @@ -10,6 +10,7 @@ using osu.Framework.Screens; using osu.Game.Graphics.Containers; using osu.Game.Online.API; using osu.Game.Overlays; +using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Menu; using osu.Game.Screens.OnlinePlay.Lounge; using osu.Game.Users; @@ -22,6 +23,10 @@ namespace osu.Game.Screens.OnlinePlay [Cached] protected readonly OverlayColourProvider ColourProvider = new OverlayColourProvider(OverlayColourScheme.Plum); + // Without this, the beatmap / menu background will be displayed behind the online play overlays. + // This adds needless load, and in some cases is visible when everything in front is transparent momentarily (song select). + protected override BackgroundScreen CreateBackground() => new BackgroundScreenBlack(WaveContainer.APPEAR_DURATION); + public IScreen CurrentSubScreen => screenStack.CurrentScreen; public override bool CursorVisible => (screenStack.CurrentScreen as IOnlinePlaySubScreen)?.CursorVisible ?? true;