Skip to content

Commit 4cb2031

Browse files
committed
Fix music wheel goal display per profile
1 parent a623eb3 commit 4cb2031

File tree

6 files changed

+13
-6
lines changed

6 files changed

+13
-6
lines changed

src/DBProfile.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,6 @@ void DBProfile::LoadScoreGoals(SQLite::Database* db)
400400
//Add it to the GoalsForAChart goalmap[chart]
401401
loadingProfile->goalmap[ck].Add(sg);
402402
}
403-
404-
SONGMAN->SetHasGoal(loadingProfile->goalmap);
405403
}
406404

407405
ProfileLoadResult DBProfile::SaveDBToDir(string dir, const Profile* profile, DBProfileMode mode) const

src/ScreenNetSelectMusic.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,11 @@ void ScreenNetSelectMusic::UpdateDifficulties( PlayerNumber pn )
687687
m_StepsDisplays[pn].SetFromStepsTypeAndMeterAndDifficultyAndCourseType( StepsType_Invalid, 0, Difficulty_Beginner );
688688
}
689689

690+
void ScreenNetSelectMusic::BeginScreen()
691+
{
692+
ScreenNetSelectBase::BeginScreen();
693+
SONGMAN->SetFlagsForProfile(PROFILEMAN->GetProfile(PLAYER_1));
694+
}
690695
void ScreenNetSelectMusic::MusicChanged()
691696
{
692697
if( GAMESTATE->m_pCurSong == NULL )

src/ScreenNetSelectMusic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class ScreenNetSelectMusic : public ScreenNetSelectBase
1717
{
1818
public:
1919
void Init() override;
20+
void BeginScreen() override;
2021

2122
bool Input( const InputEventPlus &input ) override;
2223
void HandleScreenMessage( const ScreenMessage SM ) override;

src/ScreenSelectMusic.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ void ScreenSelectMusic::BeginScreen()
232232

233233
SONGMAN->MakeSongGroupsFromPlaylists();
234234
SONGMAN->SetFavoritedStatus(PROFILEMAN->GetProfile(PLAYER_1)->FavoritedCharts);
235+
SONGMAN->SetHasGoal(PROFILEMAN->GetProfile(PLAYER_1)->goalmap);
235236
if (CommonMetrics::AUTO_SET_STYLE)
236237
{
237238
GAMESTATE->SetCompatibleStylesForPlayers();

src/SongManager.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -730,10 +730,13 @@ void SongManager::SetPermaMirroredStatus(set<string>& pmir) {
730730

731731
// hurr should probably redo both (all three) of these -mina
732732
void SongManager::SetHasGoal(unordered_map<string, GoalsForChart>& goalmap) {
733-
FOREACH(Song*, m_pSongs, song)
733+
FOREACH(Song*, m_pSongs, song) {
734+
bool hasGoal = false;
734735
FOREACH_CONST(Steps*, (*song)->GetAllSteps(), steps)
735-
if(goalmap.count((*steps)->GetChartKey()))
736-
(*song)->SetHasGoal(true);
736+
if (goalmap.count((*steps)->GetChartKey()))
737+
hasGoal = true;
738+
(*song)->SetHasGoal(hasGoal);
739+
}
737740
}
738741

739742
RString SongManager::GetSongGroupBannerPath( const RString &sSongGroup ) const

src/XMLProfile.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,6 @@ void XMLProfile::LoadScoreGoalsFromNode(const XNode *pNode) {
487487
ck = SONGMAN->ReconcileBustedKeys(ck);
488488
loadingProfile->goalmap[ck].LoadFromNode(chgoals);
489489
}
490-
SONGMAN->SetHasGoal(loadingProfile->goalmap);
491490
}
492491

493492
void XMLProfile::LoadPlaylistsFromNode(const XNode *pNode) {

0 commit comments

Comments
 (0)