From b042f1cad55680e61d4656522b4b4cb500a9e05a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 27 Apr 2022 18:57:20 +0900 Subject: [PATCH] Add screen to perform bundled beatmap downloads --- .../FirstRunSetup/ScreenBundledBeatmaps.cs | 47 +++++++++++++++++++ osu.Game/Overlays/FirstRunSetupOverlay.cs | 1 + 2 files changed, 48 insertions(+) create mode 100644 osu.Game/Overlays/FirstRunSetup/ScreenBundledBeatmaps.cs diff --git a/osu.Game/Overlays/FirstRunSetup/ScreenBundledBeatmaps.cs b/osu.Game/Overlays/FirstRunSetup/ScreenBundledBeatmaps.cs new file mode 100644 index 0000000000..fae852860b --- /dev/null +++ b/osu.Game/Overlays/FirstRunSetup/ScreenBundledBeatmaps.cs @@ -0,0 +1,47 @@ +// Copyright (c) ppy Pty Ltd . 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; + } + } +} diff --git a/osu.Game/Overlays/FirstRunSetupOverlay.cs b/osu.Game/Overlays/FirstRunSetupOverlay.cs index 82158793a2..b43f14522e 100644 --- a/osu.Game/Overlays/FirstRunSetupOverlay.cs +++ b/osu.Game/Overlays/FirstRunSetupOverlay.cs @@ -60,6 +60,7 @@ namespace osu.Game.Overlays private readonly Type[] steps = { typeof(ScreenWelcome), + typeof(ScreenBundledBeatmaps), typeof(ScreenUIScale) };