Skip to content

Commit

Permalink
Fix music wheel goal display per profile
Browse files Browse the repository at this point in the history
  • Loading branch information
nico-abram committed Feb 10, 2018
1 parent a623eb3 commit 4cb2031
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/DBProfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,6 @@ void DBProfile::LoadScoreGoals(SQLite::Database* db)
//Add it to the GoalsForAChart goalmap[chart]
loadingProfile->goalmap[ck].Add(sg);
}

SONGMAN->SetHasGoal(loadingProfile->goalmap);
}

ProfileLoadResult DBProfile::SaveDBToDir(string dir, const Profile* profile, DBProfileMode mode) const
Expand Down
5 changes: 5 additions & 0 deletions src/ScreenNetSelectMusic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,11 @@ void ScreenNetSelectMusic::UpdateDifficulties( PlayerNumber pn )
m_StepsDisplays[pn].SetFromStepsTypeAndMeterAndDifficultyAndCourseType( StepsType_Invalid, 0, Difficulty_Beginner );
}

void ScreenNetSelectMusic::BeginScreen()
{
ScreenNetSelectBase::BeginScreen();
SONGMAN->SetFlagsForProfile(PROFILEMAN->GetProfile(PLAYER_1));
}
void ScreenNetSelectMusic::MusicChanged()
{
if( GAMESTATE->m_pCurSong == NULL )
Expand Down
1 change: 1 addition & 0 deletions src/ScreenNetSelectMusic.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class ScreenNetSelectMusic : public ScreenNetSelectBase
{
public:
void Init() override;
void BeginScreen() override;

bool Input( const InputEventPlus &input ) override;
void HandleScreenMessage( const ScreenMessage SM ) override;
Expand Down
1 change: 1 addition & 0 deletions src/ScreenSelectMusic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ void ScreenSelectMusic::BeginScreen()

SONGMAN->MakeSongGroupsFromPlaylists();
SONGMAN->SetFavoritedStatus(PROFILEMAN->GetProfile(PLAYER_1)->FavoritedCharts);
SONGMAN->SetHasGoal(PROFILEMAN->GetProfile(PLAYER_1)->goalmap);
if (CommonMetrics::AUTO_SET_STYLE)
{
GAMESTATE->SetCompatibleStylesForPlayers();
Expand Down
9 changes: 6 additions & 3 deletions src/SongManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,10 +730,13 @@ void SongManager::SetPermaMirroredStatus(set<string>& pmir) {

// hurr should probably redo both (all three) of these -mina
void SongManager::SetHasGoal(unordered_map<string, GoalsForChart>& goalmap) {
FOREACH(Song*, m_pSongs, song)
FOREACH(Song*, m_pSongs, song) {
bool hasGoal = false;
FOREACH_CONST(Steps*, (*song)->GetAllSteps(), steps)
if(goalmap.count((*steps)->GetChartKey()))
(*song)->SetHasGoal(true);
if (goalmap.count((*steps)->GetChartKey()))
hasGoal = true;
(*song)->SetHasGoal(hasGoal);
}
}

RString SongManager::GetSongGroupBannerPath( const RString &sSongGroup ) const
Expand Down
1 change: 0 additions & 1 deletion src/XMLProfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,6 @@ void XMLProfile::LoadScoreGoalsFromNode(const XNode *pNode) {
ck = SONGMAN->ReconcileBustedKeys(ck);
loadingProfile->goalmap[ck].LoadFromNode(chgoals);
}
SONGMAN->SetHasGoal(loadingProfile->goalmap);
}

void XMLProfile::LoadPlaylistsFromNode(const XNode *pNode) {
Expand Down

0 comments on commit 4cb2031

Please sign in to comment.