diff --git a/osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs b/osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs index f05b876d8f..22674f0879 100644 --- a/osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs @@ -4,6 +4,8 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; +using osu.Framework.Screens; +using osu.Game.Screens.Import; namespace osu.Game.Overlays.Settings.Sections.Debug { @@ -12,7 +14,7 @@ namespace osu.Game.Overlays.Settings.Sections.Debug protected override string Header => "General"; [BackgroundDependencyLoader] - private void load(FrameworkDebugConfigManager config, FrameworkConfigManager frameworkConfig) + private void load(FrameworkDebugConfigManager config, FrameworkConfigManager frameworkConfig, OsuGame game) { Children = new Drawable[] { @@ -27,6 +29,11 @@ namespace osu.Game.Overlays.Settings.Sections.Debug Current = config.GetBindable(DebugSetting.BypassFrontToBackPass) } }; + Add(new SettingsButton + { + Text = "Import files", + Action = () => game?.PerformFromScreen(menu => menu.Push(new FileImportScreen())) + }); } } } diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 1722329c21..4becdd58cd 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -41,7 +41,6 @@ namespace osu.Game.Screens.Menu public Action OnExit; public Action OnBeatmapListing; public Action OnSolo; - public Action OnImportButton; public Action OnSettings; public Action OnMulti; public Action OnChart; @@ -132,10 +131,6 @@ namespace osu.Game.Screens.Menu buttonsTopLevel.Add(new Button(@"play", @"button-play-select", OsuIcon.Logo, new Color4(102, 68, 204, 255), () => State = ButtonSystemState.Play, WEDGE_WIDTH, Key.P)); buttonsTopLevel.Add(new Button(@"osu!editor", @"button-generic-select", OsuIcon.EditCircle, new Color4(238, 170, 0, 255), () => OnEdit?.Invoke(), 0, Key.E)); buttonsTopLevel.Add(new Button(@"osu!direct", @"button-direct-select", OsuIcon.ChevronDownCircle, new Color4(165, 204, 0, 255), () => OnBeatmapListing?.Invoke(), 0, Key.D)); - if(RuntimeInfo.OS == RuntimeInfo.Platform.Android) - { - buttonsTopLevel.Add(new Button(@"Import File", @"button-generic-select", FontAwesome.Solid.File, new Color4(0, 86, 73, 255), () => OnImportButton?.Invoke())); - } if (host.CanExit) buttonsTopLevel.Add(new Button(@"exit", string.Empty, OsuIcon.CrossCircle, new Color4(238, 51, 153, 255), () => OnExit?.Invoke(), 0, Key.Q)); diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 69e4ea487e..c3ecd75963 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -19,7 +19,6 @@ using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Edit; using osu.Game.Screens.Multi; using osu.Game.Screens.Select; -using osu.Game.Screens.Import; namespace osu.Game.Screens.Menu { @@ -106,7 +105,6 @@ namespace osu.Game.Screens.Menu }, OnSolo = onSolo, OnMulti = delegate { this.Push(new Multiplayer()); }, - OnImportButton = onImport, OnExit = confirmAndExit, } } @@ -146,7 +144,7 @@ namespace osu.Game.Screens.Menu [Resolved(canBeNull: true)] private OsuGame game { get; set; } - private void onImport() => this.Push(new FileImportScreen()); + private void confirmAndExit() { if (exitConfirmed) return;