Maelstrom: Make sure the dialog status is set before hiding the dialog.

https://github.com/libsdl-org/Maelstrom/commit/a68be6cedca460ae1e6b07928b7918a001d1e791

From a68be6cedca460ae1e6b07928b7918a001d1e791 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sat, 13 Oct 2012 17:38:48 -0700
Subject: [PATCH] Make sure the dialog status is set before hiding the dialog.

---
 screenlib/UIDialogButton.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/screenlib/UIDialogButton.cpp b/screenlib/UIDialogButton.cpp
index 44622006..f9c8ddc1 100644
--- a/screenlib/UIDialogButton.cpp
+++ b/screenlib/UIDialogButton.cpp
@@ -59,14 +59,14 @@ UIDialogButton::OnClick()
 {
 	UIPanel *panel = GetUI()->GetCurrentPanel();
 
+	if (m_statusID && panel && panel->IsA(UIDialog::GetType())) {
+		static_cast<UIDialog*>(panel)->SetDialogStatus(m_statusID);
+	}
+
 	// Hide before doing the action (which may change the current panel)
 	if (m_closeDialog && panel) {
 		GetUI()->HidePanel(panel);
 	}
 
-	if (m_statusID && panel && panel->IsA(UIDialog::GetType())) {
-		static_cast<UIDialog*>(panel)->SetDialogStatus(m_statusID);
-	}
-
 	UIElementButton::OnClick();
 }