[MusicWheel] Added ShowSectionsInBPMSort and ShowSectionsInLengthSort metrics.
This commit is contained in:
@@ -8,6 +8,10 @@ ________________________________________________________________________________
|
|||||||
StepMania 5.0 $NEXT | 20110xyy
|
StepMania 5.0 $NEXT | 20110xyy
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
2011/05/14
|
||||||
|
----------
|
||||||
|
* [MusicWheel] Added ShowSectionsInBPMSort and ShowSectionsInLengthSort metrics. [AJ]
|
||||||
|
|
||||||
2011/05/11
|
2011/05/11
|
||||||
----------
|
----------
|
||||||
* [GameSoundManager] Added PlayAnnouncer Lua binding. [AJ]
|
* [GameSoundManager] Added PlayAnnouncer Lua binding. [AJ]
|
||||||
|
|||||||
@@ -857,7 +857,9 @@ ShowRoulette=true
|
|||||||
ShowRandom=false
|
ShowRandom=false
|
||||||
ShowPortal=false
|
ShowPortal=false
|
||||||
|
|
||||||
|
ShowSectionsInBPMSort=true
|
||||||
SortBPMDivision=20
|
SortBPMDivision=20
|
||||||
|
ShowSectionsInLengthSort=true
|
||||||
SortLengthDivision=5
|
SortLengthDivision=5
|
||||||
|
|
||||||
MostPlayedSongsToShow=30
|
MostPlayedSongsToShow=30
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
ThemeMetric<int> SORT_BPM_DIVISION ( "MusicWheel", "SortBPMDivision" );
|
ThemeMetric<int> SORT_BPM_DIVISION ( "MusicWheel", "SortBPMDivision" );
|
||||||
ThemeMetric<int> SORT_LENGTH_DIVISION ( "MusicWheel", "SortLengthDivision" );
|
ThemeMetric<int> SORT_LENGTH_DIVISION ( "MusicWheel", "SortLengthDivision" );
|
||||||
|
ThemeMetric<bool> SHOW_SECTIONS_IN_BPM_SORT ( "MusicWheel", "ShowSectionsInBPMSort" );
|
||||||
|
ThemeMetric<bool> SHOW_SECTIONS_IN_LENGTH_SORT ( "MusicWheel", "ShowSectionsInLengthSort" );
|
||||||
|
|
||||||
bool SongCriteria::Matches( const Song *pSong ) const
|
bool SongCriteria::Matches( const Song *pSong ) const
|
||||||
{
|
{
|
||||||
@@ -597,6 +599,8 @@ RString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so
|
|||||||
return pSong->m_sGenre;
|
return pSong->m_sGenre;
|
||||||
return SORT_NOT_AVAILABLE.GetValue();
|
return SORT_NOT_AVAILABLE.GetValue();
|
||||||
case SORT_BPM:
|
case SORT_BPM:
|
||||||
|
{
|
||||||
|
if( SHOW_SECTIONS_IN_BPM_SORT )
|
||||||
{
|
{
|
||||||
const int iBPMGroupSize = SORT_BPM_DIVISION;
|
const int iBPMGroupSize = SORT_BPM_DIVISION;
|
||||||
DisplayBpms bpms;
|
DisplayBpms bpms;
|
||||||
@@ -605,7 +609,12 @@ RString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so
|
|||||||
iMaxBPM += iBPMGroupSize - (iMaxBPM%iBPMGroupSize) - 1;
|
iMaxBPM += iBPMGroupSize - (iMaxBPM%iBPMGroupSize) - 1;
|
||||||
return ssprintf("%03d-%03d",iMaxBPM-(iBPMGroupSize-1), iMaxBPM);
|
return ssprintf("%03d-%03d",iMaxBPM-(iBPMGroupSize-1), iMaxBPM);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
return RString();
|
||||||
|
}
|
||||||
case SORT_LENGTH:
|
case SORT_LENGTH:
|
||||||
|
{
|
||||||
|
if( SHOW_SECTIONS_IN_LENGTH_SORT )
|
||||||
{
|
{
|
||||||
const int iSortLengthSize = SORT_LENGTH_DIVISION;
|
const int iSortLengthSize = SORT_LENGTH_DIVISION;
|
||||||
int iMaxLength = (int)pSong->m_fMusicLengthSeconds;
|
int iMaxLength = (int)pSong->m_fMusicLengthSeconds;
|
||||||
@@ -613,6 +622,9 @@ RString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so
|
|||||||
int iMinLength = iMaxLength - (iSortLengthSize-1);
|
int iMinLength = iMaxLength - (iSortLengthSize-1);
|
||||||
return ssprintf( "%s-%s", SecondsToMMSS(iMinLength).c_str(), SecondsToMMSS(iMaxLength).c_str() );
|
return ssprintf( "%s-%s", SecondsToMMSS(iMinLength).c_str(), SecondsToMMSS(iMaxLength).c_str() );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
return RString();
|
||||||
|
}
|
||||||
case SORT_POPULARITY:
|
case SORT_POPULARITY:
|
||||||
case SORT_RECENT:
|
case SORT_RECENT:
|
||||||
return RString();
|
return RString();
|
||||||
|
|||||||
Reference in New Issue
Block a user