clean up missing metric logic

This commit is contained in:
Chris Danford
2003-11-05 05:17:56 +00:00
parent a4dc0a96b5
commit 90958fe2e9
+14 -6
View File
@@ -413,21 +413,29 @@ void ThemeManager::ReloadMetricsIfNecessary()
CString ThemeManager::GetMetricRaw( CString sClassName, CString sValueName ) CString ThemeManager::GetMetricRaw( CString sClassName, CString sValueName )
{ {
#if defined(DEBUG) && defined(WIN32)
try_metric_again: try_metric_again:
#endif
CString sCurMetricPath = GetMetricsIniPath(m_sCurThemeName); CString sCurMetricPath = GetMetricsIniPath(m_sCurThemeName);
CString sDefaultMetricPath = GetMetricsIniPath(BASE_THEME_NAME); CString sDefaultMetricPath = GetMetricsIniPath(BASE_THEME_NAME);
CString sValue; CString sValue;
if( m_pIniMetrics->GetValue(sClassName,sValueName,sValue) ) if( m_pIniMetrics->GetValue(sClassName,sValueName,sValue) )
return sValue; return sValue;
#if defined(DEBUG) && defined(WIN32) if( DISPLAY->IsWindowed() )
if( IDRETRY == MessageBox(NULL,ssprintf("The theme metric '%s-%s' is missing. Correct this and click Retry, or Cancel to break.",sClassName.c_str(),sValueName.c_str()),"ThemeManager",MB_RETRYCANCEL ) ) {
CString sMessage = ssprintf( "The theme metric '%s-%s' is missing. Correct this and click Retry, or Cancel to break.",sClassName.c_str(),sValueName.c_str() );
switch( HOOKS->MessageBoxRetryCancel(sMessage) )
{
case ArchHooks::retry:
ReloadMetricsIfNecessary();
goto try_metric_again; goto try_metric_again;
#endif case ArchHooks::cancel:
break; // fall through
default:
ASSERT(0);
}
}
RageException::Throw( "Theme metric '%s : %s' could not be found in '%s' or '%s'.", RageException::Throw( "Theme metric '%s : %s' could not be found in '%s' or '%s'.",
sClassName.c_str(), sClassName.c_str(),