1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-20 12:42:31 +08:00
Files
osu-lazer/osu.Game/Overlays/Dialog/ConfirmDialog.cs
T
Denis Titovets 1b488949e1 Localise some more PopupDialogs (#36890)
changes can be reviewed commit by commit

---------

Co-authored-by: Dean Herbert <pe@ppy.sh>
2026-03-10 16:28:27 +09:00

48 lines
1.6 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;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
using osu.Game.Localisation;
using WebCommonStrings = osu.Game.Resources.Localisation.Web.CommonStrings;
namespace osu.Game.Overlays.Dialog
{
/// <summary>
/// A dialog which confirms a user action.
/// </summary>
public partial class ConfirmDialog : PopupDialog
{
/// <summary>
/// Construct a new confirmation dialog.
/// </summary>
/// <param name="message">The description of the action to be displayed to the user.</param>
/// <param name="onConfirm">An action to perform on confirmation.</param>
/// <param name="onCancel">An optional action to perform on cancel.</param>
public ConfirmDialog(LocalisableString message, Action onConfirm, Action onCancel = null)
{
HeaderText = message;
BodyText = DialogStrings.ConfirmDialogBodyText;
Icon = FontAwesome.Solid.ExclamationTriangle;
Buttons = new PopupDialogButton[]
{
new PopupDialogOkButton
{
Text = DialogStrings.Confirm,
Action = onConfirm
},
new PopupDialogCancelButton
{
Text = WebCommonStrings.ButtonsCancel,
Action = onCancel
},
};
}
}
}