1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 16:27:26 +08:00

Add method to PopupDialog to press the first OK button

This commit is contained in:
Dean Herbert 2021-05-19 16:26:27 +09:00
parent 87833bfb61
commit 124ac689b8

View File

@ -207,6 +207,11 @@ namespace osu.Game.Overlays.Dialog
};
}
/// <summary>
/// Programmatically clicks the first <see cref="PopupDialogOkButton"/>.
/// </summary>
public void PerformOkAction() => Buttons.OfType<PopupDialogOkButton>().First().Click();
protected override bool OnKeyDown(KeyDownEvent e)
{
if (e.Repeat) return false;