specify metric or string in error messages for easier tracing

This commit is contained in:
Chris Danford
2008-06-02 00:29:46 +00:00
parent fc73f81240
commit 4348415e0b
2 changed files with 29 additions and 9 deletions
+1 -1
View File
@@ -212,7 +212,7 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 "$(intdir)\verstub.obj"" AdditionalOptions="/MACHINE:I386 "$(intdir)\verstub.obj""
AdditionalDependencies="libjpeg/jpeg.lib libpng/lib/libpng.lib" AdditionalDependencies="libjpeg/jpeg.lib libpng/lib/libpng.lib"
OutputFile="..\Program\StepMania-fastdebug.exe" OutputFile="C:\cvs\piu\Program\StepMania-fastdebug.exe"
LinkIncremental="2" LinkIncremental="2"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="" AdditionalLibraryDirectories=""
+28 -8
View File
@@ -859,21 +859,41 @@ RString ThemeManager::GetMetricRaw( const IniFile &ini, const RString &sMetricsG
RString sCurMetricPath = GetMetricsIniPath( m_sCurThemeName ); RString sCurMetricPath = GetMetricsIniPath( m_sCurThemeName );
RString sDefaultMetricPath = GetMetricsIniPath( SpecialFiles::BASE_THEME_NAME ); RString sDefaultMetricPath = GetMetricsIniPath( SpecialFiles::BASE_THEME_NAME );
RString sMessage = ssprintf( "The theme metric \"%s::%s\" is missing. Correct this and click Retry, or Cancel to break.",
sMetricsGroup.c_str(), sValueName.c_str() ); RString sType;
if( &ini == &g_pLoadedThemeData->iniStrings )
sType = "String";
else if( &ini == &g_pLoadedThemeData->iniMetrics )
sType = "Metric";
else
FAIL_M("");
RString sMessage = ssprintf( "%s \"%s::%s\" is missing. Correct this and click Retry, or Cancel to break.",
sType.c_str(),
sMetricsGroup.c_str(),
sValueName.c_str() );
switch( Dialog::AbortRetryIgnore(sMessage) ) switch( Dialog::AbortRetryIgnore(sMessage) )
{ {
case Dialog::abort: case Dialog::abort:
RageException::Throw( "Theme metric \"%s::%s\" could not be found in \"%s\"' or \"%s\".", {
sMetricsGroup.c_str(), sValueName.c_str(), sCurMetricPath.c_str(), RageException::Throw( "%s \"%s::%s\" could not be found in \"%s\"' or \"%s\".",
sDefaultMetricPath.c_str() ); sType.c_str(),
sMetricsGroup.c_str(),
sValueName.c_str(),
sCurMetricPath.c_str(),
sDefaultMetricPath.c_str() );
}
case Dialog::retry: case Dialog::retry:
ReloadMetrics(); ReloadMetrics();
continue; continue;
case Dialog::ignore: case Dialog::ignore:
LOG->UserLog( "Theme metric", sMetricsGroup + "::" + sValueName, LOG->UserLog(
"could not be found in \"%s\" or \"%s\".", sType,
sCurMetricPath.c_str(), sDefaultMetricPath.c_str() ); sMetricsGroup + "::" + sValueName,
"could not be found in \"%s\" or \"%s\".",
sCurMetricPath.c_str(),
sDefaultMetricPath.c_str() );
return RString(); return RString();
default: default:
ASSERT(0); ASSERT(0);