Rewrite BG/FG changes parsing (#1916)
* Handle commas and equals in BG/FG change tags Rewrote parsing of BGCHANGES and FGCHANGES tags to be able to handle people putting commas and equals in the filenames. For the value positions which can be filenames, check to see if we can recognize any filename from the song directory followed by a comma, equal, or end of string. If we can, use that. If not, just treat it the same as before, looking for the next comma or equal.
This commit is contained in:
@@ -344,14 +344,14 @@ bool SMALoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach
|
||||
|
||||
else if( sValueName=="FGCHANGES" )
|
||||
{
|
||||
vector<RString> aFGChangeExpressions;
|
||||
split( sParams[1], ",", aFGChangeExpressions );
|
||||
std::vector<std::vector<RString> > aFGChanges;
|
||||
ParseBGChangesString(sParams[1], aFGChanges, out.GetSongDir());
|
||||
|
||||
for( unsigned b=0; b<aFGChangeExpressions.size(); b++ )
|
||||
for (const auto &b : aFGChanges)
|
||||
{
|
||||
BackgroundChange change;
|
||||
if( LoadFromBGChangesString( change, aFGChangeExpressions[b] ) )
|
||||
out.AddForegroundChange( change );
|
||||
if (LoadFromBGChangesVector(change, b))
|
||||
out.AddForegroundChange(change);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user