add ignore option for invalid redirects

This commit is contained in:
Chris Danford
2003-11-17 03:37:51 +00:00
parent 8244c73c01
commit 1697c25278
+24 -22
View File
@@ -234,6 +234,11 @@ try_element_again:
} }
if( asElementPaths.size() == 0 )
{
return ""; // This isn't fatal.
}
if( asElementPaths.size() > 1 ) if( asElementPaths.size() > 1 )
{ {
FlushDirCache(); FlushDirCache();
@@ -244,18 +249,18 @@ try_element_again:
"'%s/%s/%s'. Please remove all but one of these matches.", "'%s/%s/%s'. Please remove all but one of these matches.",
sThemeName.c_str(), sCategory.c_str(), sFileName.c_str() ); sThemeName.c_str(), sCategory.c_str(), sFileName.c_str() );
if( ArchHooks::retry == HOOKS->MessageBoxRetryCancel(message) ) switch( HOOKS->MessageBoxAbortRetryIgnore(message) )
goto try_element_again; {
case ArchHooks::abort:
RageException::Throw( message ); RageException::Throw( message );
break;
case ArchHooks::retry:
goto try_element_again;
case ArchHooks::ignore:
break;
} }
else if( asElementPaths.size() == 0 )
{
return ""; // This isn't fatal.
} }
else // asElementPaths.size() == 1
{
ASSERT( asElementPaths.size() == 1 );
CString sPath = asElementPaths[0]; CString sPath = asElementPaths[0];
bool bIsARedirect = GetExtension(sPath).CompareNoCase("redir")==0; bool bIsARedirect = GetExtension(sPath).CompareNoCase("redir")==0;
@@ -297,7 +302,6 @@ try_element_again:
RageException::Throw( "%s", message.c_str() ); RageException::Throw( "%s", message.c_str() );
} }
} }
}
} }
CString ThemeManager::GetPathTo( ElementCategory category, CString sFileName, bool bOptional ) CString ThemeManager::GetPathTo( ElementCategory category, CString sFileName, bool bOptional )
@@ -342,19 +346,7 @@ try_element_again:
FlushDirCache(); FlushDirCache();
g_ThemePathCache[category].clear(); g_ThemePathCache[category].clear();
goto try_element_again; goto try_element_again;
case ArchHooks::cancel:
RageException::Throw( "Theme element '%s" SLASH "%s' could not be found in '%s' or '%s'.",
sCategory.c_str(),
sFileName.c_str(),
GetThemeDirFromName(m_sCurThemeName).c_str(),
GetThemeDirFromName(BASE_THEME_NAME).c_str() );
break;
case ArchHooks::ignore: case ArchHooks::ignore:
break;
default:
ASSERT(0);
}
LOG->Warn( LOG->Warn(
"Theme element '%s" SLASH "%s' could not be found in '%s' or '%s'.", "Theme element '%s" SLASH "%s' could not be found in '%s' or '%s'.",
sCategory.c_str(), sCategory.c_str(),
@@ -368,6 +360,16 @@ try_element_again:
Cache[sFileName] = GetPathTo( category, "_missing" ); Cache[sFileName] = GetPathTo( category, "_missing" );
return Cache[sFileName]; return Cache[sFileName];
case ArchHooks::abort:
RageException::Throw( "Theme element '%s" SLASH "%s' could not be found in '%s' or '%s'.",
sCategory.c_str(),
sFileName.c_str(),
GetThemeDirFromName(m_sCurThemeName).c_str(),
GetThemeDirFromName(BASE_THEME_NAME).c_str() );
default:
ASSERT(0);
return "";
}
} }