diff --git a/osu.Game/Screens/Multi/Multiplayer.cs b/osu.Game/Screens/Multi/Multiplayer.cs index 123ef7b1f7..db5372a027 100644 --- a/osu.Game/Screens/Multi/Multiplayer.cs +++ b/osu.Game/Screens/Multi/Multiplayer.cs @@ -50,9 +50,6 @@ public class Multiplayer : OsuScreen, IOnlineComponent [Cached(Type = typeof(IRoomManager))] private RoomManager roomManager; - [Cached] - private BackgroundScreenStack backgroundScreenStack; - [Resolved] private OsuGameBase game { get; set; } @@ -100,12 +97,7 @@ public Multiplayer() Padding = new MarginPadding { Top = Header.HEIGHT }, Children = new CompositeDrawable[] { - new ParallaxContainer - { - RelativeSizeAxes = Axes.Both, - Child = backgroundScreenStack = new BackgroundScreenStack { RelativeSizeAxes = Axes.Both }, - }, - screenStack = new ScreenStack(loungeSubScreen = new LoungeSubScreen()) { RelativeSizeAxes = Axes.Both }, + screenStack = new OsuScreenStack(loungeSubScreen = new LoungeSubScreen()) { RelativeSizeAxes = Axes.Both }, } }, new Header(screenStack), diff --git a/osu.Game/Screens/OsuScreenStack.cs b/osu.Game/Screens/OsuScreenStack.cs new file mode 100644 index 0000000000..4d92a41dc7 --- /dev/null +++ b/osu.Game/Screens/OsuScreenStack.cs @@ -0,0 +1,28 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Screens; +using osu.Game.Graphics.Containers; +using osu.Game.Screens.Multi.Lounge; + +namespace osu.Game.Screens +{ + public class OsuScreenStack : ScreenStack + { + [Cached] + private BackgroundScreenStack backgroundScreenStack; + + public OsuScreenStack(IScreen baseScreen) + : base(baseScreen) + { + backgroundScreenStack = new BackgroundScreenStack { RelativeSizeAxes = Axes.Both }; + InternalChild = new ParallaxContainer + { + RelativeSizeAxes = Axes.Both, + Child = backgroundScreenStack, + }; + } + } +}