From 2bc4bb9e206dd4c7ec337ddd44c8690ffe8ad787 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 14 Apr 2022 16:03:34 +0900 Subject: [PATCH] Consider `SubScreenStack`s when allowing for exit confirmation sequence in `PerformFromMenuRunner` --- osu.Game/PerformFromMenuRunner.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/osu.Game/PerformFromMenuRunner.cs b/osu.Game/PerformFromMenuRunner.cs index 6f979b8dc8..7f0db96e6d 100644 --- a/osu.Game/PerformFromMenuRunner.cs +++ b/osu.Game/PerformFromMenuRunner.cs @@ -125,6 +125,18 @@ namespace osu.Game /// Whether a dialog blocked interaction. private bool checkForDialog(IScreen current) { + // An exit process may traverse multiple levels. + // When checking for dismissing dialogs, let's also consider sub screens. + while (current is IHasSubScreenStack currentWithSubScreenStack) + { + var nestedCurrent = currentWithSubScreenStack.SubScreenStack.CurrentScreen; + + if (nestedCurrent == null) + break; + + current = nestedCurrent; + } + var currentDialog = dialogOverlay.CurrentDialog; if (lastEncounteredDialog != null)