Consistent user warnings.

This commit is contained in:
Steve Checkoway
2006-09-04 08:09:27 +00:00
parent dae47979ea
commit faf32603f1
14 changed files with 106 additions and 118 deletions
+15 -19
View File
@@ -69,7 +69,7 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s
MsdFile msd;
if( !msd.ReadFile( sPath ) )
{
LOG->UserLog( "Error opening file '%s'.", sPath.c_str() );
LOG->UserLog( RageLog::LogType_SongFile, sPath, "couldn't be opened: %s", msd.GetError().c_str() );
return false;
}
@@ -87,7 +87,7 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s
m_iTickCount = atoi( sParams[1] );
if( m_iTickCount <= 0 )
{
LOG->UserLog( "KSF file \"%s\" has an invalid tick count: %d", sPath.c_str(), m_iTickCount );
LOG->UserLog( RageLog::LogType_SongFile, sPath, "has an invalid tick count: %d.", m_iTickCount );
return false;
}
}
@@ -106,7 +106,7 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s
if( m_iTickCount == -1 )
{
m_iTickCount = 2;
LOG->UserLog( "\"%s\": TICKCOUNT not found; defaulting to %i", sPath.c_str(), m_iTickCount );
LOG->UserLog( RageLog::LogType_SongFile, sPath, "doesn't have a TICKCOUNT. Defaulting to %i.", m_iTickCount );
}
NoteData notedata; // read it into here
@@ -200,8 +200,8 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s
{
if( m_bKIUCompliant )
{
LOG->UserLog( "File \"%s\" had illegal syntax (\"%s\") which can't be in KIU complient files.",
sPath.c_str(), sRowString.c_str() );
LOG->UserLog( RageLog::LogType_SongFile, sPath, "has illegal syntax \"%s\" which can't be in KIU complient files.",
sRowString.c_str() );
return false;
}
if( BeginsWith(sRowString, "|B") || BeginsWith(sRowString, "|D") )
@@ -218,8 +218,8 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s
}
else
{
LOG->UserLog( "File %s had a RowString with an improper length (\"%s\"); corrupt notes ignored",
sPath.c_str(), sRowString.c_str() );
LOG->UserLog( RageLog::LogType_SongFile, sPath, "has a RowString with an improper length \"%s\"; corrupt notes ignored.",
sRowString.c_str() );
return false;
}
}
@@ -264,8 +264,8 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s
case '0': tap = TAP_EMPTY; break;
case '1': tap = TAP_ORIGINAL_TAP; break;
default:
LOG->UserLog( "File %s had an invalid row (\"%s\"); corrupt notes ignored",
sPath.c_str(), sRowString.c_str() );
LOG->UserLog( RageLog::LogType_SongFile, sPath, "has an invalid row \"%s\"; corrupt notes ignored.",
sRowString.c_str() );
return false;
}
@@ -338,7 +338,7 @@ bool KSFLoader::LoadGlobalData( const RString &sPath, Song &out )
MsdFile msd;
if( !msd.ReadFile( sPath ) )
{
LOG->UserLog( "Error opening file \"%s\": %s", sPath.c_str(), msd.GetError().c_str() );
LOG->UserLog( RageLog::LogType_SongFile, sPath, "couldn't be opened: %s", msd.GetError().c_str() );
return false;
}
@@ -419,8 +419,8 @@ bool KSFLoader::LoadGlobalData( const RString &sPath, Song &out )
}
else
{
LOG->UserLog( "In KSF file \"%s\", there was an unexpected value named '%s'",
sPath.c_str(), sValueName.c_str() );
LOG->UserLog( RageLog::LogType_SongFile, sPath, "has an unexpected value named \"%s\".",
sValueName.c_str() );
}
}
@@ -503,8 +503,8 @@ bool KSFLoader::LoadGlobalData( const RString &sPath, Song &out )
else
{
/* Quit while we're ahead if any bad syntax is spotted. */
LOG->UserLog( "File %s has a RowString which matches no known syntax rules (\"%s\"); bad file",
sPath.c_str(), NoteRowString.c_str() );
LOG->UserLog( RageLog::LogType_SongFile, sPath, "has an invalid RowString \"%s\".",
NoteRowString.c_str() );
return false;
}
}
@@ -559,11 +559,7 @@ bool KSFLoader::LoadFromDir( const RString &sDir, Song &out )
GetDirListing( sDir + RString("*.ksf"), arrayKSFFileNames );
/* We shouldn't have been called to begin with if there were no KSFs. */
if( arrayKSFFileNames.empty() )
{
LOG->UserLog( "Couldn't find any KSF files in '%s'", sDir.c_str() );
return false;
}
ASSERT( arrayKSFFileNames.size() );
/* If only the first file is read, it will cause problems for other simfiles with
* different BPM changes and tickcounts. This command will probably have to be