Add lua docs for GetPreferredSortSongsBySectionName, update comment, remove duplicate code

This commit is contained in:
Crash Cringle
2024-02-25 09:52:23 -05:00
committed by teejusb
parent a7a8f51c33
commit 6cd43782d5
4 changed files with 7 additions and 10 deletions
+1
View File
@@ -1871,6 +1871,7 @@
<Function name='SetPreferredSongs'/>
<Function name='ShortenGroupName'/>
<Function name='SongToPreferredSortSectionName'/>
<Function name='GetPreferredSortSongsBySectionName'/>
<Function name='WasLoadedFromAdditionalCourses'/>
<Function name='WasLoadedFromAdditionalSongs'/>
</Class>
+3
View File
@@ -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
View File
@@ -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
View File
@@ -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;
}