Change series map value from a vector to an unordered set, remove series prefixing, ensure always defaulting to group disk name for sorting
This commit is contained in:
+1
-1
@@ -77,7 +77,7 @@ Group::Group(const RString& sDir, const RString& sGroupDirName) {
|
|||||||
ini.GetValue("Group", "SortTitle", sSortTitle);
|
ini.GetValue("Group", "SortTitle", sSortTitle);
|
||||||
Trim(sSortTitle);
|
Trim(sSortTitle);
|
||||||
if (sSortTitle.empty()) {
|
if (sSortTitle.empty()) {
|
||||||
sSortTitle = sDisplayTitle;
|
sSortTitle = Basename(sGroupDirName);
|
||||||
}
|
}
|
||||||
|
|
||||||
ini.GetValue("Group", "TranslitTitle", sTranslitTitle);
|
ini.GetValue("Group", "TranslitTitle", sTranslitTitle);
|
||||||
|
|||||||
@@ -231,10 +231,10 @@ void MusicWheelItem::LoadFromWheelItemData( const WheelItemBaseData *pData, int
|
|||||||
sTranslitName = SONGMAN->ShortenGroupName(pWID->m_pGroup->GetTranslitTitle());
|
sTranslitName = SONGMAN->ShortenGroupName(pWID->m_pGroup->GetTranslitTitle());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
// This will eventually do something different when we eventually implement nested folders
|
||||||
|
// for now, use the same behavior.
|
||||||
sDisplayName = SONGMAN->ShortenGroupName(pWID->m_sText);
|
sDisplayName = SONGMAN->ShortenGroupName(pWID->m_sText);
|
||||||
sTranslitName = SONGMAN->ShortenGroupName(pWID->m_pGroup->GetTranslitTitle());
|
sTranslitName = SONGMAN->ShortenGroupName(pWID->m_pGroup->GetTranslitTitle());
|
||||||
// sDisplayName = SONGMAN->ShortenGroupName("[" + pWID->m_pGroup->GetSeries() +"] " + pWID->m_pGroup->GetDisplayTitle());
|
|
||||||
// sTranslitName = SONGMAN->ShortenGroupName("[" + pWID->m_pGroup->GetSeries() +"] " + pWID->m_pGroup->GetTranslitTitle());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( GAMESTATE->sExpandedSectionName == pWID->m_sText )
|
if( GAMESTATE->sExpandedSectionName == pWID->m_sText )
|
||||||
|
|||||||
+2
-3
@@ -349,9 +349,8 @@ void SongManager::AddGroup( RString sDir, RString sGroupDirName, Group* group )
|
|||||||
// Add the group to its series if the group has one and if the series exists
|
// Add the group to its series if the group has one and if the series exists
|
||||||
if( group->GetSeries() != "" )
|
if( group->GetSeries() != "" )
|
||||||
{
|
{
|
||||||
std::vector<Group*>& series = m_mapSeriesToGroup[group->GetSeries()];
|
std::unordered_set<Group*>& series = m_mapSeriesToGroup[group->GetSeries()];
|
||||||
if( std::find(series.begin(), series.end(), group) == series.end() )
|
series.insert(group);
|
||||||
series.push_back(group);
|
|
||||||
}
|
}
|
||||||
//m_sSongGroupBackgroundPaths.push_back( sBackgroundPath );
|
//m_sSongGroupBackgroundPaths.push_back( sBackgroundPath );
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -148,7 +148,7 @@ public:
|
|||||||
std::map<RString, std::vector<Song*>> GetPreferredSortSongsMap() const { return m_mapPreferredSectionToSongs;};
|
std::map<RString, std::vector<Song*>> GetPreferredSortSongsMap() const { return m_mapPreferredSectionToSongs;};
|
||||||
RString SongToPreferredSortSectionName( const Song *pSong ) const;
|
RString SongToPreferredSortSectionName( const Song *pSong ) const;
|
||||||
std::map<RString, Group*> GetGroupGroupMap() const { return m_mapNameToGroup;};
|
std::map<RString, Group*> GetGroupGroupMap() const { return m_mapNameToGroup;};
|
||||||
std::map<RString, std::vector<Group*>> GetSeriesGroupMap() const { return m_mapSeriesToGroup;};
|
std::map<RString, std::unordered_set<Group*>> GetSeriesGroupMap() const { return m_mapSeriesToGroup;};
|
||||||
Group* GetGroupFromName( const RString &sGroupName ) const;
|
Group* GetGroupFromName( const RString &sGroupName ) const;
|
||||||
Group* GetGroup( const Song *pSong ) const;
|
Group* GetGroup( const Song *pSong ) const;
|
||||||
std::vector<RString> GetPreferredSortSectionNames() const;
|
std::vector<RString> GetPreferredSortSectionNames() const;
|
||||||
@@ -251,7 +251,7 @@ protected:
|
|||||||
//vector<RString> m_sSongGroupBackgroundPaths; // each song group may have a background associated with it (very rarely)
|
//vector<RString> m_sSongGroupBackgroundPaths; // each song group may have a background associated with it (very rarely)
|
||||||
|
|
||||||
std::map<RString, Group*> m_mapNameToGroup;
|
std::map<RString, Group*> m_mapNameToGroup;
|
||||||
std::map<RString, std::vector<Group*>> m_mapSeriesToGroup;
|
std::map<RString, std::unordered_set<Group*>> m_mapSeriesToGroup;
|
||||||
|
|
||||||
struct Comp { bool operator()(const RString& s, const RString &t) const { return CompareRStringsAsc(s,t); } };
|
struct Comp { bool operator()(const RString& s, const RString &t) const { return CompareRStringsAsc(s,t); } };
|
||||||
typedef std::vector<Song*> SongPointerVector;
|
typedef std::vector<Song*> SongPointerVector;
|
||||||
|
|||||||
Reference in New Issue
Block a user