mirror of
https://github.com/ppy/osu.git
synced 2025-01-07 23:23:12 +08:00
Consider SubScreenStack
s when allowing for exit confirmation sequence in PerformFromMenuRunner
This commit is contained in:
parent
f9d9e6aa61
commit
2bc4bb9e20
@ -125,6 +125,18 @@ namespace osu.Game
|
|||||||
/// <returns>Whether a dialog blocked interaction.</returns>
|
/// <returns>Whether a dialog blocked interaction.</returns>
|
||||||
private bool checkForDialog(IScreen current)
|
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;
|
var currentDialog = dialogOverlay.CurrentDialog;
|
||||||
|
|
||||||
if (lastEncounteredDialog != null)
|
if (lastEncounteredDialog != null)
|
||||||
|
Loading…
Reference in New Issue
Block a user