2024-12-05 15:41:00 +08:00
|
|
|
// 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 osu.Framework.Allocation;
|
2024-12-09 14:59:16 +08:00
|
|
|
using osu.Framework.Graphics;
|
2024-12-05 15:41:00 +08:00
|
|
|
using osu.Framework.Localisation;
|
2024-12-09 14:59:16 +08:00
|
|
|
using osu.Framework.Platform;
|
2024-12-05 15:41:00 +08:00
|
|
|
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;
|
|
|
|
|
2024-12-09 14:59:16 +08:00
|
|
|
private SystemFileImportComponent systemFileImport = null!;
|
|
|
|
|
2024-12-05 15:41:00 +08:00
|
|
|
[BackgroundDependencyLoader]
|
2025-01-21 14:14:18 +08:00
|
|
|
private void load(OsuGameBase game, GameHost host, IPerformFromScreenRunner? performer)
|
2024-12-05 15:41:00 +08:00
|
|
|
{
|
2024-12-09 14:59:16 +08:00
|
|
|
Add(systemFileImport = new SystemFileImportComponent(game, host));
|
|
|
|
|
|
|
|
AddRange(new Drawable[]
|
2024-12-05 15:41:00 +08:00
|
|
|
{
|
|
|
|
new SettingsButton
|
|
|
|
{
|
|
|
|
Text = DebugSettingsStrings.ImportFiles,
|
2024-12-09 14:59:16 +08:00
|
|
|
Action = () =>
|
|
|
|
{
|
|
|
|
if (systemFileImport.PresentIfAvailable())
|
|
|
|
return;
|
|
|
|
|
|
|
|
performer?.PerformFromScreen(menu => menu.Push(new FileImportScreen()));
|
|
|
|
},
|
2024-12-05 15:41:00 +08:00
|
|
|
},
|
|
|
|
new SettingsButton
|
|
|
|
{
|
|
|
|
Text = DebugSettingsStrings.RunLatencyCertifier,
|
|
|
|
Action = () => performer?.PerformFromScreen(menu => menu.Push(new LatencyCertifierScreen()))
|
|
|
|
}
|
2024-12-09 14:59:16 +08:00
|
|
|
});
|
2024-12-05 15:41:00 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|