1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 05:42:56 +08:00

Merge pull request #10388 from peppy/editor-setup-placeholder-text

Add placeholder text/colour when no beatmap background is specified yet
This commit is contained in:
Dan Balasescu 2020-10-06 18:29:01 +09:00 committed by GitHub
commit e2d081e3cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,8 +59,11 @@ namespace osu.Game.Screens.Edit.Setup
{ {
} }
[Resolved]
private OsuColour colours { get; set; }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load()
{ {
Container audioTrackFileChooserContainer = new Container Container audioTrackFileChooserContainer = new Container
{ {
@ -187,7 +190,27 @@ namespace osu.Game.Screens.Edit.Setup
FillMode = FillMode.Fill, FillMode = FillMode.Fill,
}, background => }, background =>
{ {
backgroundSpriteContainer.Child = background; if (background.Texture != null)
backgroundSpriteContainer.Child = background;
else
{
backgroundSpriteContainer.Children = new Drawable[]
{
new Box
{
Colour = colours.GreySeafoamDarker,
RelativeSizeAxes = Axes.Both,
},
new OsuTextFlowContainer(t => t.Font = OsuFont.Default.With(size: 24))
{
Text = "Drag image here to set beatmap background!",
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
AutoSizeAxes = Axes.X,
}
};
}
background.FadeInFromZero(500); background.FadeInFromZero(500);
}); });
} }