diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneFirstRunScreenBundledBeatmaps.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneFirstRunScreenBundledBeatmaps.cs new file mode 100644 index 0000000000..51065939f0 --- /dev/null +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneFirstRunScreenBundledBeatmaps.cs @@ -0,0 +1,24 @@ +// 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.Screens; +using osu.Game.Overlays; +using osu.Game.Overlays.FirstRunSetup; + +namespace osu.Game.Tests.Visual.UserInterface +{ + public class TestSceneFirstRunScreenBundledBeatmaps : OsuManualInputManagerTestScene + { + [Cached] + private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple); + + public TestSceneFirstRunScreenBundledBeatmaps() + { + AddStep("load screen", () => + { + Child = new ScreenStack(new ScreenBeatmaps()); + }); + } + } +} diff --git a/osu.Game/Overlays/FirstRunSetup/ScreenBundledBeatmaps.cs b/osu.Game/Overlays/FirstRunSetup/ScreenBeatmaps.cs similarity index 52% rename from osu.Game/Overlays/FirstRunSetup/ScreenBundledBeatmaps.cs rename to osu.Game/Overlays/FirstRunSetup/ScreenBeatmaps.cs index 518903e74b..aff084be73 100644 --- a/osu.Game/Overlays/FirstRunSetup/ScreenBundledBeatmaps.cs +++ b/osu.Game/Overlays/FirstRunSetup/ScreenBeatmaps.cs @@ -1,3 +1,4 @@ +#nullable enable // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. @@ -6,39 +7,51 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Beatmaps.Drawables; +using osu.Game.Database; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterfaceV2; +using osu.Game.Localisation; using osu.Game.Online; using osuTK; namespace osu.Game.Overlays.FirstRunSetup { - [Description("Bundled Beatmaps")] - public class ScreenBundledBeatmaps : FirstRunSetupScreen + [Description("Obtaining Beatmaps")] + public class ScreenBeatmaps : FirstRunSetupScreen { - private RoundedButton downloadBundledButton; + private RoundedButton downloadBundledButton = null!; + private RoundedButton importBeatmapsButton = null!; - private ProgressBar progressBarBundled; + private ProgressBar progressBarBundled = null!; - private RoundedButton downloadTutorialButton; - private ProgressBar progressBarTutorial; + private RoundedButton downloadTutorialButton = null!; + private ProgressBar progressBarTutorial = null!; - private BundledBeatmapDownloader tutorialDownloader; - private BundledBeatmapDownloader bundledDownloader; + private BundledBeatmapDownloader tutorialDownloader = null!; + private BundledBeatmapDownloader bundledDownloader = null!; - [BackgroundDependencyLoader] - private void load(OsuColour colours) + [BackgroundDependencyLoader(permitNulls: true)] + private void load(OsuColour colours, OverlayColourProvider overlayColourProvider, LegacyImportManager? legacyImportManager) { - Vector2 buttonSize = new Vector2(500, 80); + Vector2 buttonSize = new Vector2(500, 60); Content.Children = new Drawable[] { new OsuTextFlowContainer(cp => cp.Font = OsuFont.Default.With(size: 20)) { + Colour = overlayColourProvider.Content1, Text = - "osu! doesn't come with any beatmaps pre-loaded. To get started, we have some recommended beatmaps. You can obtain more beatmaps from the main menu \"browse\" button at any time.", + "\"Beatmaps\" are what we call playable levels in osu!.\n\nosu! doesn't come with any beatmaps pre-loaded. This step will help you get started on your beatmap collection.", + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y + }, + new OsuTextFlowContainer(cp => cp.Font = OsuFont.Default.With(size: 20)) + { + Colour = overlayColourProvider.Content1, + Text = + "If you are a new player, we recommend playing through the tutorial to get accustomed to the gameplay.", RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y }, @@ -51,6 +64,13 @@ namespace osu.Game.Overlays.FirstRunSetup Text = "Download tutorial", Action = downloadTutorial }, + new OsuTextFlowContainer(cp => cp.Font = OsuFont.Default.With(size: 20)) + { + Colour = overlayColourProvider.Content1, + Text = "To get you started, we have some recommended beatmaps.", + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y + }, downloadBundledButton = new RoundedButton { Size = buttonSize, @@ -60,9 +80,34 @@ namespace osu.Game.Overlays.FirstRunSetup Text = "Download beatmap selection", Action = downloadBundled }, - // TODO: add stable import button if a stable install is detected. + new OsuTextFlowContainer(cp => cp.Font = OsuFont.Default.With(size: 20)) + { + Colour = overlayColourProvider.Content1, + Text = "If you have an existing osu! install, you can also choose to import your existing beatmap collection.", + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y + }, + importBeatmapsButton = new RoundedButton + { + Size = buttonSize, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + BackgroundColour = colours.Blue3, + Text = MaintenanceSettingsStrings.ImportBeatmapsFromStable, + Action = () => + { + importBeatmapsButton.Enabled.Value = false; + legacyImportManager?.ImportFromStableAsync(StableContent.Beatmaps).ContinueWith(t => Schedule(() => importBeatmapsButton.Enabled.Value = true)); + } + }, + new OsuTextFlowContainer(cp => cp.Font = OsuFont.Default.With(size: 20)) + { + Colour = overlayColourProvider.Content1, + Text = "You can also obtain more beatmaps from the main menu \"browse\" button at any time.", + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y + }, }; - downloadTutorialButton.Add(progressBarTutorial = new ProgressBar(false) { RelativeSizeAxes = Axes.Both, @@ -84,9 +129,6 @@ namespace osu.Game.Overlays.FirstRunSetup private void downloadTutorial() { - if (tutorialDownloader != null) - return; - tutorialDownloader = new BundledBeatmapDownloader(true); AddInternal(tutorialDownloader); @@ -104,11 +146,6 @@ namespace osu.Game.Overlays.FirstRunSetup private void downloadBundled() { - if (bundledDownloader != null) - return; - - // downloadBundledButton.Enabled.Value = false; - bundledDownloader = new BundledBeatmapDownloader(false); AddInternal(bundledDownloader); diff --git a/osu.Game/Overlays/FirstRunSetupOverlay.cs b/osu.Game/Overlays/FirstRunSetupOverlay.cs index b43f14522e..c151554081 100644 --- a/osu.Game/Overlays/FirstRunSetupOverlay.cs +++ b/osu.Game/Overlays/FirstRunSetupOverlay.cs @@ -60,7 +60,7 @@ namespace osu.Game.Overlays private readonly Type[] steps = { typeof(ScreenWelcome), - typeof(ScreenBundledBeatmaps), + typeof(ScreenBeatmaps), typeof(ScreenUIScale) };