1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-18 03:12:54 +08:00
osu-lazer/osu.Game/Overlays/Settings/Sections/Maintenance/StableDirectoryLocationDialog.cs
2022-09-16 21:08:25 +09:00

43 lines
1.5 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.
#nullable disable
using System.Threading.Tasks;
using osu.Framework.Allocation;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Screens;
using osu.Game.Localisation;
using osu.Game.Overlays.Dialog;
using osu.Game.Screens;
namespace osu.Game.Overlays.Settings.Sections.Maintenance
{
public class StableDirectoryLocationDialog : PopupDialog
{
[Resolved]
private IPerformFromScreenRunner performer { get; set; }
public StableDirectoryLocationDialog(TaskCompletionSource<string> taskCompletionSource)
{
HeaderText = MaintenanceSettingsStrings.StableDirectoryLocationHeader;
BodyText = MaintenanceSettingsStrings.StableDirectoryLocationBody;
Icon = FontAwesome.Solid.QuestionCircle;
Buttons = new PopupDialogButton[]
{
new PopupDialogOkButton
{
Text = MaintenanceSettingsStrings.StableDirectoryLocationOk,
Action = () => Schedule(() => performer.PerformFromScreen(screen => screen.Push(new StableDirectorySelectScreen(taskCompletionSource))))
},
new PopupDialogCancelButton
{
Text = MaintenanceSettingsStrings.StableDirectoryLocationCancel,
Action = () => taskCompletionSource.TrySetCanceled()
}
};
}
}
}