mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Show a warning prior to opening external links
This commit is contained in:
32
osu.Game/Overlays/Chat/ExternalLinkDialog.cs
Normal file
32
osu.Game/Overlays/Chat/ExternalLinkDialog.cs
Normal file
@ -0,0 +1,32 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Overlays.Dialog;
|
||||
|
||||
namespace osu.Game.Overlays.Chat
|
||||
{
|
||||
public class ExternalLinkDialog : PopupDialog
|
||||
{
|
||||
public ExternalLinkDialog(string url, Action openExternalLinkAction)
|
||||
{
|
||||
BodyText = url;
|
||||
|
||||
Icon = FontAwesome.fa_warning;
|
||||
HeaderText = "Confirm opening external link";
|
||||
Buttons = new PopupDialogButton[]
|
||||
{
|
||||
new PopupDialogOkButton
|
||||
{
|
||||
Text = @"Yes. Go for it.",
|
||||
Action = openExternalLinkAction
|
||||
},
|
||||
new PopupDialogCancelButton
|
||||
{
|
||||
Text = @"No! Abort mission!"
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user