mirror of
https://github.com/ppy/osu.git
synced 2026-05-13 20:33:35 +08:00
321e698906
https://github.com/user-attachments/assets/57d0bc9d-f081-4d04-8cb6-422a83f1a1d3 https://github.com/user-attachments/assets/208f0676-a735-4055-a422-e6a2c3847220 --- - [x] Depends on https://github.com/ppy/osu-framework/pull/6717 to work - Closes https://github.com/ppy/osu/issues/21076 - Closes https://github.com/ppy/osu/issues/22676 - Closes https://github.com/ppy/osu/issues/28666 --------- Co-authored-by: Dean Herbert <pe@ppy.sh>
59 lines
1.9 KiB
C#
59 lines
1.9 KiB
C#
// 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.Linq;
|
|
using System.Threading.Tasks;
|
|
using osu.Framework.Allocation;
|
|
using osu.Framework.Graphics;
|
|
using osu.Framework.Localisation;
|
|
using osu.Framework.Platform;
|
|
using osu.Framework.Screens;
|
|
using osu.Game.Localisation;
|
|
using osu.Game.Screens;
|
|
using osu.Game.Screens.Import;
|
|
using osu.Game.Screens.Utility;
|
|
|
|
namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
|
{
|
|
public partial class GeneralSettings : SettingsSubsection
|
|
{
|
|
protected override LocalisableString Header => CommonStrings.General;
|
|
|
|
private ISystemFileSelector? selector;
|
|
|
|
[BackgroundDependencyLoader]
|
|
private void load(OsuGameBase game, GameHost host, IPerformFromScreenRunner? performer)
|
|
{
|
|
if ((selector = host.CreateSystemFileSelector(game.HandledExtensions.ToArray())) != null)
|
|
selector.Selected += f => Task.Run(() => game.Import(f.FullName));
|
|
|
|
AddRange(new Drawable[]
|
|
{
|
|
new SettingsButtonV2
|
|
{
|
|
Text = DebugSettingsStrings.ImportFiles,
|
|
Action = () =>
|
|
{
|
|
if (selector != null)
|
|
selector.Present();
|
|
else
|
|
performer?.PerformFromScreen(menu => menu.Push(new FileImportScreen()));
|
|
},
|
|
},
|
|
new SettingsButtonV2
|
|
{
|
|
Text = DebugSettingsStrings.RunLatencyCertifier,
|
|
Action = () => performer?.PerformFromScreen(menu => menu.Push(new LatencyCertifierScreen()))
|
|
}
|
|
});
|
|
}
|
|
|
|
protected override void Dispose(bool isDisposing)
|
|
{
|
|
base.Dispose(isDisposing);
|
|
|
|
selector?.Dispose();
|
|
}
|
|
}
|
|
}
|