2021-05-10 01:50:43 +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.
|
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2021-05-10 01:50:43 +08:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
|
using osu.Framework.Screens;
|
2022-09-16 17:31:02 +08:00
|
|
|
|
using osu.Game.Localisation;
|
2021-05-10 01:50:43 +08:00
|
|
|
|
using osu.Game.Overlays.Dialog;
|
2022-04-18 16:49:28 +08:00
|
|
|
|
using osu.Game.Screens;
|
2021-05-10 01:50:43 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
|
|
|
|
{
|
|
|
|
|
public class StableDirectoryLocationDialog : PopupDialog
|
|
|
|
|
{
|
2022-04-18 20:48:46 +08:00
|
|
|
|
[Resolved]
|
2022-04-18 16:49:28 +08:00
|
|
|
|
private IPerformFromScreenRunner performer { get; set; }
|
2021-05-10 01:50:43 +08:00
|
|
|
|
|
|
|
|
|
public StableDirectoryLocationDialog(TaskCompletionSource<string> taskCompletionSource)
|
|
|
|
|
{
|
2022-09-16 17:31:02 +08:00
|
|
|
|
HeaderText = MaintenanceSettingsStrings.StableDirectoryLocationHeader;
|
|
|
|
|
BodyText = MaintenanceSettingsStrings.StableDirectoryLocationBody;
|
2021-05-10 01:50:43 +08:00
|
|
|
|
Icon = FontAwesome.Solid.QuestionCircle;
|
|
|
|
|
|
|
|
|
|
Buttons = new PopupDialogButton[]
|
|
|
|
|
{
|
|
|
|
|
new PopupDialogOkButton
|
|
|
|
|
{
|
2022-09-16 20:08:25 +08:00
|
|
|
|
Text = MaintenanceSettingsStrings.StableDirectoryLocationOk,
|
2022-04-18 16:49:28 +08:00
|
|
|
|
Action = () => Schedule(() => performer.PerformFromScreen(screen => screen.Push(new StableDirectorySelectScreen(taskCompletionSource))))
|
2021-05-10 01:50:43 +08:00
|
|
|
|
},
|
|
|
|
|
new PopupDialogCancelButton
|
|
|
|
|
{
|
2022-09-16 20:08:25 +08:00
|
|
|
|
Text = MaintenanceSettingsStrings.StableDirectoryLocationCancel,
|
2021-05-10 01:50:43 +08:00
|
|
|
|
Action = () => taskCompletionSource.TrySetCanceled()
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|