From 546500a5d3d2cb6ba58c9cdf077b054cf61c1f15 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 23 Sep 2006 03:31:17 +0000 Subject: [PATCH] unwrap sensible behavior for ignore --- stepmania/src/ThemeManager.cpp | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index fcd9c0e878..05ec9df0ec 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -661,24 +661,23 @@ try_element_again: RString sNewPath = GetPath(category, sNewClassName, sNewFile, true); if( !sNewPath.empty() ) - { return sNewPath; - } - else + + RString sMessage = ssprintf( + "ThemeManager: The redirect '%s' points to the file '%s', which does not exist. " + "Verify that this redirect is correct.", + sPath.c_str(), sNewFileName.c_str()); + + switch( Dialog::AbortRetryIgnore(sMessage) ) { - RString message = ssprintf( - "ThemeManager: The redirect '%s' points to the file '%s', which does not exist. " - "Verify that this redirect is correct.", - sPath.c_str(), sNewFileName.c_str()); - - if( Dialog::AbortRetryIgnore(message) == Dialog::retry ) - { - ReloadMetrics(); - goto try_element_again; - } - - RageException::Throw( "%s", message.c_str() ); + case Dialog::retry: + ReloadMetrics(); + goto try_element_again; + case Dialog::ignore: + return GetPath( category, "", "_missing" ); } + + RageException::Throw( "%s", sMessage.c_str() ); } RString ThemeManager::GetPathToAndFallback( ElementCategory category, const RString &sClassName_, const RString &sElement )