From 963117f07d20508e4c6d8ecb49957b4126c583c4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 2 Mar 2017 17:41:33 +0900 Subject: [PATCH] Fix incorrect event order. --- osu.Game/Overlays/DialogOverlay.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game/Overlays/DialogOverlay.cs b/osu.Game/Overlays/DialogOverlay.cs index 31dbd4390f..95f08e9e24 100644 --- a/osu.Game/Overlays/DialogOverlay.cs +++ b/osu.Game/Overlays/DialogOverlay.cs @@ -20,15 +20,14 @@ public void Push(PopupDialog dialog) { if (dialog == currentDialog) return; - State = Visibility.Visible; - - dialogContainer.Add(dialog); - - dialog.Show(); - dialog.StateChanged += onDialogOnStateChanged; - currentDialog?.Hide(); currentDialog = dialog; + + dialogContainer.Add(currentDialog); + + currentDialog.Show(); + currentDialog.StateChanged += onDialogOnStateChanged; + State = Visibility.Visible; } private void onDialogOnStateChanged(OverlayContainer dialog, Visibility v) @@ -38,6 +37,7 @@ private void onDialogOnStateChanged(OverlayContainer dialog, Visibility v) //handle the dialog being dismissed. dialog.Delay(PopupDialog.EXIT_DURATION); dialog.Expire(); + if (dialog == currentDialog) State = Visibility.Hidden; }