Removed now un-used CourseLoaderCRS::ParseCourseSongSort
Replaced '..' with '-' for ranged parameter delimiter
This commit is contained in:
+8
-53
@@ -554,7 +554,9 @@ bool CourseLoaderCRS::ParseCourseSongSelect(const MsdFile::value_t &sParams, Cou
|
|||||||
RString sParamName = sParamParts[0];
|
RString sParamName = sParamParts[0];
|
||||||
RString sParamValue = sParamParts[1];
|
RString sParamValue = sParamParts[1];
|
||||||
|
|
||||||
// For params that accept multiple items, if someone were to define it twice in one #SONGSELECT, should we overwrite the first, or append?
|
// For params that accept multiple items, if someone were to define it twice in one #SONGSELECT,
|
||||||
|
// should we overwrite the first, or append? Currently, it just appends it all together.
|
||||||
|
|
||||||
if( sParamName.EqualsNoCase("TITLE") )
|
if( sParamName.EqualsNoCase("TITLE") )
|
||||||
{
|
{
|
||||||
std::vector<RString> songTitles;
|
std::vector<RString> songTitles;
|
||||||
@@ -630,21 +632,21 @@ bool CourseLoaderCRS::ParseCourseSongSelect(const MsdFile::value_t &sParams, Cou
|
|||||||
else if( sParamName.EqualsNoCase("DURATION") )
|
else if( sParamName.EqualsNoCase("DURATION") )
|
||||||
{
|
{
|
||||||
std::vector<RString> durations;
|
std::vector<RString> durations;
|
||||||
split(sParamValue, "..", durations);
|
split(sParamValue, "-", durations);
|
||||||
new_entry.songCriteria.m_fMinDurationSeconds = StringToFloat(durations[0]);
|
new_entry.songCriteria.m_fMinDurationSeconds = StringToFloat(durations[0]);
|
||||||
new_entry.songCriteria.m_fMaxDurationSeconds = StringToFloat(durations[1]);
|
new_entry.songCriteria.m_fMaxDurationSeconds = StringToFloat(durations[1]);
|
||||||
}
|
}
|
||||||
else if( sParamName.EqualsNoCase("BPMRANGE") )
|
else if( sParamName.EqualsNoCase("BPMRANGE") )
|
||||||
{
|
{
|
||||||
std::vector<RString> bpms;
|
std::vector<RString> bpms;
|
||||||
split(sParamValue, "..", bpms);
|
split(sParamValue, "-", bpms);
|
||||||
new_entry.songCriteria.m_fMinBPM = StringToFloat(bpms[0]);
|
new_entry.songCriteria.m_fMinBPM = StringToFloat(bpms[0]);
|
||||||
new_entry.songCriteria.m_fMaxBPM = StringToFloat(bpms[1]);
|
new_entry.songCriteria.m_fMaxBPM = StringToFloat(bpms[1]);
|
||||||
}
|
}
|
||||||
else if( sParamName.EqualsNoCase("METER") )
|
else if( sParamName.EqualsNoCase("METER") )
|
||||||
{
|
{
|
||||||
std::vector<RString> meters;
|
std::vector<RString> meters;
|
||||||
split(sParamValue, "..", meters);
|
split(sParamValue, "-", meters);
|
||||||
new_entry.stepsCriteria.m_iLowMeter = StringToInt(meters[0]);
|
new_entry.stepsCriteria.m_iLowMeter = StringToInt(meters[0]);
|
||||||
new_entry.stepsCriteria.m_iHighMeter = StringToInt(meters[1]);
|
new_entry.stepsCriteria.m_iHighMeter = StringToInt(meters[1]);
|
||||||
}
|
}
|
||||||
@@ -677,57 +679,10 @@ bool CourseLoaderCRS::ParseCourseSongSelect(const MsdFile::value_t &sParams, Cou
|
|||||||
}
|
}
|
||||||
new_entry.sModifiers = join( ",", mods );
|
new_entry.sModifiers = join( ",", mods );
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CourseLoaderCRS::ParseCourseSongSort(RString sParam, CourseEntry &new_entry, const RString &sPath)
|
|
||||||
{
|
|
||||||
int iNumSongs = SONGMAN->GetNumSongs();
|
|
||||||
if( sParam.Left(strlen("BEST")) == "BEST" )
|
|
||||||
{
|
|
||||||
int iChooseIndex = StringToInt( sParam.Right(sParam.size()-strlen("BEST")) ) - 1;
|
|
||||||
if( iChooseIndex > iNumSongs )
|
|
||||||
{
|
{
|
||||||
// looking up a song that doesn't exist.
|
LOG->UserLog( "Course file", sPath, "has an unexpected parameter named '%s', ignoring.", sParamName.c_str() );
|
||||||
LOG->UserLog( "Course file", sPath, "is trying to load BEST%i with only %i songs installed. "
|
|
||||||
"This entry will be ignored.", iChooseIndex, iNumSongs);
|
|
||||||
return false; // skip this #SONG
|
|
||||||
}
|
}
|
||||||
|
|
||||||
new_entry.iChooseIndex = iChooseIndex;
|
|
||||||
CLAMP( new_entry.iChooseIndex, 0, 500 );
|
|
||||||
new_entry.songSort = SongSort_MostPlays;
|
|
||||||
}
|
|
||||||
// least played
|
|
||||||
else if( sParam.Left(strlen("WORST")) == "WORST" )
|
|
||||||
{
|
|
||||||
int iChooseIndex = StringToInt( sParam.Right(sParam.size()-strlen("WORST")) ) - 1;
|
|
||||||
if( iChooseIndex > iNumSongs )
|
|
||||||
{
|
|
||||||
// looking up a song that doesn't exist.
|
|
||||||
LOG->UserLog( "Course file", sPath, "is trying to load WORST%i with only %i songs installed. "
|
|
||||||
"This entry will be ignored.", iChooseIndex, iNumSongs);
|
|
||||||
return false; // skip this #SONG
|
|
||||||
}
|
|
||||||
|
|
||||||
new_entry.iChooseIndex = iChooseIndex;
|
|
||||||
CLAMP( new_entry.iChooseIndex, 0, 500 );
|
|
||||||
new_entry.songSort = SongSort_FewestPlays;
|
|
||||||
}
|
|
||||||
// best grades
|
|
||||||
else if( sParam.Left(strlen("GRADEBEST")) == "GRADEBEST" )
|
|
||||||
{
|
|
||||||
new_entry.iChooseIndex = StringToInt( sParam.Right(sParam.size()-strlen("GRADEBEST")) ) - 1;
|
|
||||||
CLAMP( new_entry.iChooseIndex, 0, 500 );
|
|
||||||
new_entry.songSort = SongSort_TopGrades;
|
|
||||||
}
|
|
||||||
// worst grades
|
|
||||||
else if( sParam.Left(strlen("GRADEWORST")) == "GRADEWORST" )
|
|
||||||
{
|
|
||||||
new_entry.iChooseIndex = StringToInt( sParam.Right(sParam.size()-strlen("GRADEWORST")) ) - 1;
|
|
||||||
CLAMP( new_entry.iChooseIndex, 0, 500 );
|
|
||||||
new_entry.songSort = SongSort_LowestGrades;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ namespace CourseLoaderCRS
|
|||||||
bool ParseCourseMods( const MsdFile::value_t &sParams, AttackArray &attacks, const RString &sPath );
|
bool ParseCourseMods( const MsdFile::value_t &sParams, AttackArray &attacks, const RString &sPath );
|
||||||
bool ParseCourseSong( const MsdFile::value_t &sParams, CourseEntry &new_entry, const RString &sPath );
|
bool ParseCourseSong( const MsdFile::value_t &sParams, CourseEntry &new_entry, const RString &sPath );
|
||||||
bool ParseCourseSongSelect(const MsdFile::value_t &sParams, CourseEntry &new_entry, const RString &sPath);
|
bool ParseCourseSongSelect(const MsdFile::value_t &sParams, CourseEntry &new_entry, const RString &sPath);
|
||||||
bool ParseCourseSongSort(RString sParam, CourseEntry &new_entry, const RString &sPath);
|
|
||||||
bool SetCourseSongSort(CourseEntry &new_entry, SongSort sort, int index, const RString &sPath);
|
bool SetCourseSongSort(CourseEntry &new_entry, SongSort sort, int index, const RString &sPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -268,15 +268,15 @@ bool CourseWriterCRS::WriteSongSelectCourseEntry( const CourseEntry &entry, Rage
|
|||||||
if(entry.songCriteria.m_fMinDurationSeconds > 0
|
if(entry.songCriteria.m_fMinDurationSeconds > 0
|
||||||
&& entry.songCriteria.m_fMaxDurationSeconds > 0 )
|
&& entry.songCriteria.m_fMaxDurationSeconds > 0 )
|
||||||
{
|
{
|
||||||
songSelectParams.push_back(ssprintf("DURATION=%d..%d", (int)entry.songCriteria.m_fMinDurationSeconds, (int)entry.songCriteria.m_fMaxDurationSeconds));
|
songSelectParams.push_back(ssprintf("DURATION=%d-%d", (int)entry.songCriteria.m_fMinDurationSeconds, (int)entry.songCriteria.m_fMaxDurationSeconds));
|
||||||
}
|
}
|
||||||
if(entry.songCriteria.m_fMinBPM > 0 && entry.songCriteria.m_fMaxBPM > 0 )
|
if(entry.songCriteria.m_fMinBPM > 0 && entry.songCriteria.m_fMaxBPM > 0 )
|
||||||
{
|
{
|
||||||
songSelectParams.push_back(ssprintf("BPMRANGE=%f..%f", entry.songCriteria.m_fMinBPM, entry.songCriteria.m_fMaxBPM));
|
songSelectParams.push_back(ssprintf("BPMRANGE=%f-%f", entry.songCriteria.m_fMinBPM, entry.songCriteria.m_fMaxBPM));
|
||||||
}
|
}
|
||||||
if(entry.stepsCriteria.m_iLowMeter > 0 && entry.stepsCriteria.m_iHighMeter > 0 )
|
if(entry.stepsCriteria.m_iLowMeter > 0 && entry.stepsCriteria.m_iHighMeter > 0 )
|
||||||
{
|
{
|
||||||
songSelectParams.push_back(ssprintf("METER=%d..%d", entry.stepsCriteria.m_iLowMeter, entry.stepsCriteria.m_iHighMeter));
|
songSelectParams.push_back(ssprintf("METER=%d-%d", entry.stepsCriteria.m_iLowMeter, entry.stepsCriteria.m_iHighMeter));
|
||||||
}
|
}
|
||||||
if( entry.iGainLives > 0 )
|
if( entry.iGainLives > 0 )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user