Create new OsuScreenStack for use in Multiplayer

This commit is contained in:
David Zhao 2019-03-11 19:48:07 +09:00
parent aeae6143c1
commit 6a1e600099
2 changed files with 29 additions and 9 deletions

View File

@ -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),

View File

@ -0,0 +1,28 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. 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,
};
}
}
}