Merge pull request #612 from nixtrix/bmsdifftag

BMS loader now supports #difficulty tag.
This commit is contained in:
Colby Klein
2015-05-15 07:07:14 -07:00
+9 -2
View File
@@ -891,6 +891,13 @@ void BMSChartReader::ReadHeaders()
{ {
out->SetMeter( StringToInt(it->second) ); out->SetMeter( StringToInt(it->second) );
} }
else if( it->first == "#difficulty")
{
// only set the difficulty if the #difficulty tag is between 1 and 6 (beginner~edit)
int diff = StringToInt(it->second)-1; // BMS uses 1 to 6, SM uses 0 to 5
if(diff>=0 && diff<NUM_Difficulty)
out->SetDifficulty( (Difficulty)diff );
}
else if (it->first == "#music") else if (it->first == "#music")
{ {
info.overrideMusicFile = it->second; info.overrideMusicFile = it->second;
@@ -1472,7 +1479,7 @@ void BMSSongLoader::AddToSong()
for( unsigned i = 0; i < loadedSteps.size(); i ++ ) for( unsigned i = 0; i < loadedSteps.size(); i ++ )
{ {
Steps *steps = loadedSteps[i].steps; Steps *steps = loadedSteps[i].steps;
steps->SetDifficulty( Difficulty_Medium ); //steps->SetDifficulty( Difficulty_Medium );
RString title = loadedSteps[i].info.title; RString title = loadedSteps[i].info.title;
@@ -1487,7 +1494,7 @@ void BMSSongLoader::AddToSong()
for( unsigned i = 0; i < loadedSteps.size(); i ++ ) for( unsigned i = 0; i < loadedSteps.size(); i ++ )
{ {
Steps *steps = loadedSteps[i].steps; Steps *steps = loadedSteps[i].steps;
steps->SetDifficulty( Difficulty_Medium ); //steps->SetDifficulty( Difficulty_Medium );
RString title = loadedSteps[i].info.title; RString title = loadedSteps[i].info.title;