Maelstrom: Hooked up the AboutPanel delegate through data.

https://github.com/libsdl-org/Maelstrom/commit/5237bf1631119aa4e999f8f5fc080e1b1cea0b63

From 5237bf1631119aa4e999f8f5fc080e1b1cea0b63 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 26 Oct 2011 17:52:28 -0400
Subject: [PATCH] Hooked up the AboutPanel delegate through data.

---
 UI/about_game.xml | 2 +-
 UIPanels.cpp      | 6 +-----
 main.cpp          | 7 -------
 3 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/UI/about_game.xml b/UI/about_game.xml
index f74bd6d8..71d74682 100644
--- a/UI/about_game.xml
+++ b/UI/about_game.xml
@@ -1,4 +1,4 @@
-<UIPanel>
+<UIPanel delegate="AboutPanel">
 	<Elements>
 		<Title name="image" id="134">
 			<Anchor anchorFrom="CENTER" anchorTo="CENTER"/>
diff --git a/UIPanels.cpp b/UIPanels.cpp
index db8fe9aa..4e460054 100644
--- a/UIPanels.cpp
+++ b/UIPanels.cpp
@@ -7,10 +7,6 @@
 static UIPanelDelegate *
 CreateMaelstromUIDelegate(const char *delegate)
 {
-	if (!delegate || !*delegate) {
-		return NULL;
-	}
-
 	if (strcasecmp(delegate, "AboutPanel") == 0) {
 		return new AboutPanelDelegate();
 	} else {
@@ -30,7 +26,7 @@ CreateMaelstromUIPanel(UIManager *ui, const char *type, const char *name, const
 		panel = NULL;
 	}
 
-	if (panel && !delegate || !*delegate) {
+	if (panel && delegate && *delegate) {
 		panel->SetPanelDelegate(CreateMaelstromUIDelegate(delegate));
 	}
 
diff --git a/main.cpp b/main.cpp
index 9ce28fa7..df168f91 100644
--- a/main.cpp
+++ b/main.cpp
@@ -475,13 +475,6 @@ void SetupMainScreen()
 	}
 
 	DrawMainScreen();
-
-
-	/* Hook up functionality for other panels */
-	panel = ui->GetPanel("about_game");
-	if (panel) {
-		panel->SetPanelDelegate(new AboutPanelDelegate);
-	}
 }