1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 04:32:57 +08:00

Remove test scene background stack and use new ChangeBackgroundColour method

This commit is contained in:
Dean Herbert 2023-10-10 18:48:50 +09:00
parent 29eba3c58a
commit 194ad9650d
No known key found for this signature in database
2 changed files with 7 additions and 10 deletions

View File

@ -1,12 +1,8 @@
// 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.Graphics;
using osu.Framework.Platform;
using osu.Framework.Screens;
using osu.Framework.Testing;
using osu.Game.Graphics;
using osu.Game.Screens.Backgrounds;
namespace osu.Game.Tests
{
@ -16,12 +12,6 @@ namespace osu.Game.Tests
{
base.LoadComplete();
LoadComponentAsync(new ScreenStack(new BackgroundScreenDefault { Colour = OsuColour.Gray(0.5f) })
{
Depth = 10,
RelativeSizeAxes = Axes.Both,
}, Add);
// Have to construct this here, rather than in the constructor, because
// we depend on some dependencies to be loaded within OsuGameBase.load().
Add(new TestBrowser());

View File

@ -16,6 +16,7 @@ using osu.Framework.Audio;
using osu.Framework.Audio.Track;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.IO.Stores;
using osu.Framework.Platform;
@ -23,6 +24,7 @@ using osu.Framework.Testing;
using osu.Framework.Timing;
using osu.Game.Beatmaps;
using osu.Game.Database;
using osu.Game.Graphics;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Overlays;
@ -158,10 +160,15 @@ namespace osu.Game.Tests.Visual
return Dependencies;
}
[Resolved]
private OsuColour colours { get; set; }
protected override void LoadComplete()
{
base.LoadComplete();
ChangeBackgroundColour(ColourInfo.GradientVertical(colours.GreyCarmine, colours.GreyCarmineDarker));
var parentBeatmap = Parent.Dependencies.Get<Bindable<WorkingBeatmap>>();
parentBeatmap.Value = Beatmap.Value;
Beatmap.BindTo(parentBeatmap);