Add lua docs for GetPreferredSortSongsBySectionName, update comment, remove duplicate code
This commit is contained in:
@@ -1871,6 +1871,7 @@
|
||||
<Function name='SetPreferredSongs'/>
|
||||
<Function name='ShortenGroupName'/>
|
||||
<Function name='SongToPreferredSortSectionName'/>
|
||||
<Function name='GetPreferredSortSongsBySectionName'/>
|
||||
<Function name='WasLoadedFromAdditionalCourses'/>
|
||||
<Function name='WasLoadedFromAdditionalSongs'/>
|
||||
</Class>
|
||||
|
||||
@@ -5908,6 +5908,9 @@ local args = {
|
||||
<Function name='SongToPreferredSortSectionName' return='string' arguments='Song s'>
|
||||
Returns the preferred sort section name for the specified Song.
|
||||
</Function>
|
||||
<Function name='GetPreferredSortSongsBySectionName' return='{Song}' arguments='string sSectionName'>
|
||||
Returns a table containing all songs in the specified preferred sort section.
|
||||
</Function>
|
||||
<Function name='WasLoadedFromAdditionalCourses' return='bool' arguments='Course c'>
|
||||
[Deprecated] Always returns <code>false</code>.
|
||||
</Function>
|
||||
|
||||
+2
-2
@@ -1245,8 +1245,8 @@ void MusicWheel::ChangeMusic( int iDist )
|
||||
bool MusicWheel::ChangeSort( SortOrder new_so, bool allowSameSort ) // return true if change successful
|
||||
{
|
||||
ASSERT( new_so < NUM_SortOrder );
|
||||
// Ignore allowSameSort if we're using SORT_PREFERRED
|
||||
// Each player has their own preferred songs which sorts the songs differently -crashcringle
|
||||
// NOTE(crashcringle): Ignore allowSameSort if we're using SORT_PREFERRED.
|
||||
// Each player has their own preferred songs which sorts the songs differently
|
||||
if( GAMESTATE->m_SortOrder == new_so && (!allowSameSort && new_so != SORT_PREFERRED ))
|
||||
{
|
||||
return false;
|
||||
|
||||
+1
-8
@@ -861,14 +861,7 @@ void SongManager::GetPreferredSortSongsBySectionName( const RString &sSectionNam
|
||||
std::vector<Song*> SongManager::GetPreferredSortSongsBySectionName( const RString &sSectionName ) const
|
||||
{
|
||||
std::vector<Song*> AddTo;
|
||||
for (PreferredSortSection const &v : m_vPreferredSongSort)
|
||||
{
|
||||
if (v.sName == sSectionName)
|
||||
{
|
||||
AddTo.insert( AddTo.end(), v.vpSongs.begin(), v.vpSongs.end() );
|
||||
return AddTo;
|
||||
}
|
||||
}
|
||||
GetPreferredSortSongsBySectionName(sSectionName, AddTo);
|
||||
return AddTo;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user