mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 04:13:11 +08:00
Merge pull request #24141 from peppy/fix-exit-crash
Fix potential crash when mashing exit key
This commit is contained in:
commit
1b390cc1da
@ -225,7 +225,12 @@ namespace osu.Game.Overlays.Dialog
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Programmatically clicks the first button of the provided type.
|
/// Programmatically clicks the first button of the provided type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void PerformAction<T>() where T : PopupDialogButton => Buttons.OfType<T>().First().TriggerClick();
|
public void PerformAction<T>() where T : PopupDialogButton
|
||||||
|
{
|
||||||
|
// Buttons are regularly added in BDL or LoadComplete, so let's schedule to ensure
|
||||||
|
// they are ready to be pressed.
|
||||||
|
Schedule(() => Buttons.OfType<T>().First().TriggerClick());
|
||||||
|
}
|
||||||
|
|
||||||
protected override bool OnKeyDown(KeyDownEvent e)
|
protected override bool OnKeyDown(KeyDownEvent e)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user