1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 07:43:00 +08:00

Consider SubScreenStacks when allowing for exit confirmation sequence in PerformFromMenuRunner

This commit is contained in:
Dean Herbert 2022-04-14 16:03:34 +09:00
parent f9d9e6aa61
commit 2bc4bb9e20

View File

@ -125,6 +125,18 @@ namespace osu.Game
/// <returns>Whether a dialog blocked interaction.</returns>
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)