From 5495a0a70fd1c2320c801a0e9ba6c72e6f64f7a0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 29 Mar 2019 14:34:58 +0900 Subject: [PATCH] Add content to ScreenTestCase as protection against overwriting --- osu.Game/Tests/Visual/ScreenTestCase.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/osu.Game/Tests/Visual/ScreenTestCase.cs b/osu.Game/Tests/Visual/ScreenTestCase.cs index d10779349b..4fd4c7c207 100644 --- a/osu.Game/Tests/Visual/ScreenTestCase.cs +++ b/osu.Game/Tests/Visual/ScreenTestCase.cs @@ -1,8 +1,8 @@ // 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.Graphics.Containers; using osu.Game.Screens; namespace osu.Game.Tests.Visual @@ -12,12 +12,19 @@ namespace osu.Game.Tests.Visual /// public abstract class ScreenTestCase : ManualInputManagerTestCase { - private OsuScreenStack stack; + private readonly OsuScreenStack stack; - [BackgroundDependencyLoader] - private void load() + private readonly Container content; + + protected override Container Content => content; + + protected ScreenTestCase() { - Add(stack = new OsuScreenStack { RelativeSizeAxes = Axes.Both }); + base.Content.AddRange(new Drawable[] + { + stack = new OsuScreenStack { RelativeSizeAxes = Axes.Both }, + content = new Container { RelativeSizeAxes = Axes.Both } + }); } protected void LoadScreen(OsuScreen screen)