1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-13 19:54:15 +08:00

Fix storyboard / beatmap backgrounds being rendered in background of multiplayer (#37073)

Closes https://github.com/ppy/osu/issues/37006 visually.

Note that this adds a brief fade in on entering `PlayerLoader` from
`OnlinePlayScreen`s due to actually loading the background at this
point. I think this is fine.
This commit is contained in:
Dean Herbert
2026-03-24 15:55:21 +09:00
committed by GitHub
Unverified
parent 95648a3d27
commit 18747e1bdb
2 changed files with 18 additions and 3 deletions
@@ -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());
}
}
}
@@ -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;