Maelstrom: Allow showing any panel from any other panel, if the panel delegate doesn't handle it directly.

https://github.com/libsdl-org/Maelstrom/commit/761bbb3caa9bd0b1fb85ab004dc39ec9d7950906

From 761bbb3caa9bd0b1fb85ab004dc39ec9d7950906 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sat, 3 Nov 2012 12:51:43 -0700
Subject: [PATCH] Allow showing any panel from any other panel, if the panel
 delegate doesn't handle it directly.

---
 game/game.cpp         | 2 ++
 game/main.cpp         | 6 +++---
 screenlib/UIPanel.cpp | 4 ++++
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/game/game.cpp b/game/game.cpp
index d56cab8b..a061818b 100644
--- a/game/game.cpp
+++ b/game/game.cpp
@@ -488,6 +488,8 @@ GamePanelDelegate::OnAction(UIBaseElement *sender, const char *action)
 				player->SetControl(control, down);
 			}
 		}
+	} else {
+		return false;
 	}
 	return true;
 }
diff --git a/game/main.cpp b/game/main.cpp
index a6eed282..189224e4 100644
--- a/game/main.cpp
+++ b/game/main.cpp
@@ -405,9 +405,7 @@ MainPanelDelegate::HandleEvent(const SDL_Event &event)
 bool
 MainPanelDelegate::OnAction(UIBaseElement *sender, const char *action)
 {
-	if (SDL_strncmp(action, "show_", 5) == 0) {
-		ui->ShowPanel(action+5);
-	} else if (SDL_strcmp(action, "play") == 0) {
+	if (SDL_strcmp(action, "play") == 0) {
 		OnActionPlay();
 	} else if (SDL_strcmp(action, "multiplayer") == 0) {
 		OnActionMultiplayer();
@@ -433,6 +431,8 @@ MainPanelDelegate::OnAction(UIBaseElement *sender, const char *action)
 		OnActionRunReplay(SDL_atoi(action+5));
 	} else if (SDL_strcmp(action, "zap") == 0) {
 		OnActionZapHighScores();
+	} else {
+		return false;
 	}
 	return true;
 }
diff --git a/screenlib/UIPanel.cpp b/screenlib/UIPanel.cpp
index b1965c08..cf840069 100644
--- a/screenlib/UIPanel.cpp
+++ b/screenlib/UIPanel.cpp
@@ -201,5 +201,9 @@ UIPanel::Action(UIBaseElement *sender, const char *action)
 	UIPanel *panel = m_ui->GetFullscreenPanel();
 	if (panel && panel != this) {
 		panel->Action(sender, action);
+	} else {
+		if (SDL_strncmp(action, "show_", 5) == 0) {
+			GetUI()->ShowPanel(action+5);
+		}
 	}
 }