Add screen to perform bundled beatmap downloads

This commit is contained in:
Dean Herbert 2022-04-27 18:57:20 +09:00
parent 99d2d7b805
commit b042f1cad5
2 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,47 @@
// 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 System.ComponentModel;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Beatmaps.Drawables;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.FirstRunSetup
{
[Description("Bundled Beatmaps")]
public class ScreenBundledBeatmaps : FirstRunSetupScreen
{
private TriangleButton downloadButton;
[BackgroundDependencyLoader]
private void load()
{
Content.Children = new Drawable[]
{
new OsuTextFlowContainer(cp => cp.Font = OsuFont.Default.With(size: 20))
{
Text = "osu! doesn't come with any beatmaps pre-loaded. To get started, we have some recommended beatmaps.",
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y
},
downloadButton = new TriangleButton
{
Width = 300,
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Text = "Download beatmap selection",
Action = download
}
};
}
private void download()
{
AddInternal(new BundledBeatmapDownloader());
downloadButton.Enabled.Value = false;
}
}
}

View File

@ -60,6 +60,7 @@ public class FirstRunSetupOverlay : ShearedOverlayContainer
private readonly Type[] steps =
{
typeof(ScreenWelcome),
typeof(ScreenBundledBeatmaps),
typeof(ScreenUIScale)
};