Split out IPerformFromScreenRunner to allow for easier testing

This commit is contained in:
Dean Herbert
2022-04-18 17:49:28 +09:00
parent 587f1e2c4f
commit 2202863e1a
7 changed files with 43 additions and 19 deletions

View File

@ -7,6 +7,7 @@ using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Framework.Screens;
using osu.Game.Localisation;
using osu.Game.Screens;
using osu.Game.Screens.Import;
namespace osu.Game.Overlays.Settings.Sections.DebugSettings
@ -16,7 +17,7 @@ namespace osu.Game.Overlays.Settings.Sections.DebugSettings
protected override LocalisableString Header => DebugSettingsStrings.GeneralHeader;
[BackgroundDependencyLoader(true)]
private void load(FrameworkDebugConfigManager config, FrameworkConfigManager frameworkConfig, OsuGame game)
private void load(FrameworkDebugConfigManager config, FrameworkConfigManager frameworkConfig, IPerformFromScreenRunner performer)
{
Children = new Drawable[]
{
@ -34,7 +35,7 @@ namespace osu.Game.Overlays.Settings.Sections.DebugSettings
Add(new SettingsButton
{
Text = DebugSettingsStrings.ImportFiles,
Action = () => game?.PerformFromScreen(menu => menu.Push(new FileImportScreen()))
Action = () => performer?.PerformFromScreen(menu => menu.Push(new FileImportScreen()))
});
}
}