// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable disable using System; using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; using osu.Game.Resources.Localisation.Web; namespace osu.Game.Overlays.Dialog { /// /// A dialog which confirms a user action. /// public partial class ConfirmDialog : PopupDialog { /// /// Construct a new confirmation dialog. /// /// The description of the action to be displayed to the user. /// An action to perform on confirmation. /// An optional action to perform on cancel. public ConfirmDialog(LocalisableString message, Action onConfirm, Action onCancel = null) { HeaderText = message; BodyText = "Last chance to turn back"; Icon = FontAwesome.Solid.ExclamationTriangle; Buttons = new PopupDialogButton[] { new PopupDialogOkButton { Text = @"Yes", Action = onConfirm }, new PopupDialogCancelButton { Text = CommonStrings.ButtonsCancel, Action = onCancel }, }; } } }