diff --git a/src/MusicWheelItem.cpp b/src/MusicWheelItem.cpp index d0ec3a848e..406843e728 100644 --- a/src/MusicWheelItem.cpp +++ b/src/MusicWheelItem.cpp @@ -408,6 +408,8 @@ void MusicWheelItem::RefreshGrades() { if(pWID->m_pSong->IsFavorited()) msg.SetParam( "Favorited", 1); + if (pWID->m_pSong->HasGoal()) + msg.SetParam("HasGoal", 1); msg.SetParam( "Grade", BestpHSL->HighGrade); msg.SetParam( "Difficulty", DifficultyToString(dcBest)); msg.SetParam( "NumTimesPlayed", BestpHSL->GetNumTimesPlayed() ); diff --git a/src/Song.h b/src/Song.h index 8b3419585b..40a5ff99f8 100644 --- a/src/Song.h +++ b/src/Song.h @@ -426,6 +426,10 @@ class Song bool IsFavorited() { return isfavorited; } void SetFavorited(bool b) { isfavorited = b; } + bool HasGoal () { return hasgoal; } + void SetHasGoal(bool b) { hasgoal = b; } + bool IsPermaMirror() { return permamirror; } + void SetPermaMirror(bool b) { permamirror = b; } void SetEnabled( bool b ) { m_bEnabled = b; } bool GetEnabled() const { return m_bEnabled; } @@ -473,6 +477,8 @@ class Song private: bool isfavorited = false; + bool permamirror = false; + bool hasgoal = false; bool m_loaded_from_autosave; /** @brief the Steps that belong to this Song. */ vector m_vpSteps; diff --git a/src/SongManager.cpp b/src/SongManager.cpp index d40356fba2..8da8e15efb 100644 --- a/src/SongManager.cpp +++ b/src/SongManager.cpp @@ -626,6 +626,18 @@ void SongManager::SetFavoritedStatus(vector& favs) { } } +// hurr should probably redo both of these -mina +void SongManager::SetHasGoal(map> goalmap) { + FOREACH(Song*, m_pSongs, song) { + FOREACH_CONST(Steps*, (*song)->GetAllSteps(), steps) { + RString sck = (*steps)->GetChartKey(); + auto it = goalmap.find(sck); + if(it != goalmap.end()) + (*song)->SetHasGoal(true); + } + } + } + RString SongManager::GetSongGroupBannerPath( const RString &sSongGroup ) const { for( unsigned i = 0; i < m_sSongGroupNames.size(); ++i ) diff --git a/src/SongManager.h b/src/SongManager.h index a1ff7a825c..0d62621188 100644 --- a/src/SongManager.h +++ b/src/SongManager.h @@ -18,6 +18,7 @@ struct lua_State; #include "ThemeMetric.h" #include "RageTexturePreloader.h" #include "RageUtil.h" +#include "Profile.h" RString SONG_GROUP_COLOR_NAME( size_t i ); RString COURSE_GROUP_COLOR_NAME( size_t i ); @@ -70,6 +71,7 @@ class SongManager bool IsGroupNeverCached(const RString& group) const; void SetFavoritedStatus(vector& favs); + void SetHasGoal(map> goalmap); RString GetSongGroupBannerPath( const RString &sSongGroup ) const; //RString GetSongGroupBackgroundPath( RString sSongGroup ) const;