add ignore option for invalid redirects
This commit is contained in:
@@ -234,6 +234,11 @@ try_element_again:
|
||||
}
|
||||
|
||||
|
||||
if( asElementPaths.size() == 0 )
|
||||
{
|
||||
return ""; // This isn't fatal.
|
||||
}
|
||||
|
||||
if( asElementPaths.size() > 1 )
|
||||
{
|
||||
FlushDirCache();
|
||||
@@ -244,18 +249,18 @@ try_element_again:
|
||||
"'%s/%s/%s'. Please remove all but one of these matches.",
|
||||
sThemeName.c_str(), sCategory.c_str(), sFileName.c_str() );
|
||||
|
||||
if( ArchHooks::retry == HOOKS->MessageBoxRetryCancel(message) )
|
||||
goto try_element_again;
|
||||
|
||||
switch( HOOKS->MessageBoxAbortRetryIgnore(message) )
|
||||
{
|
||||
case ArchHooks::abort:
|
||||
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];
|
||||
bool bIsARedirect = GetExtension(sPath).CompareNoCase("redir")==0;
|
||||
@@ -297,7 +302,6 @@ try_element_again:
|
||||
RageException::Throw( "%s", message.c_str() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CString ThemeManager::GetPathTo( ElementCategory category, CString sFileName, bool bOptional )
|
||||
@@ -342,19 +346,7 @@ try_element_again:
|
||||
FlushDirCache();
|
||||
g_ThemePathCache[category].clear();
|
||||
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:
|
||||
break;
|
||||
default:
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
LOG->Warn(
|
||||
"Theme element '%s" SLASH "%s' could not be found in '%s' or '%s'.",
|
||||
sCategory.c_str(),
|
||||
@@ -368,6 +360,16 @@ try_element_again:
|
||||
|
||||
Cache[sFileName] = GetPathTo( category, "_missing" );
|
||||
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 "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user