Skip to content

Commit

Permalink
no longer allow optional grades-by-difficulty display in preparation …
Browse files Browse the repository at this point in the history
…for planned difficulties rework
  • Loading branch information
MinaciousGrace committed May 30, 2017
1 parent 9c151b3 commit 04dce35
Showing 1 changed file with 14 additions and 37 deletions.
51 changes: 14 additions & 37 deletions src/MusicWheelItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
#include "ScreenManager.h"
#include "ScoreManager.h"

static Preference<bool> uaintnonastypadplayerdog("ShowGradesForAnyDifficulty", true);

static const char *MusicWheelItemTypeNames[] = {
"Song",
"SectionExpanded",
Expand Down Expand Up @@ -338,36 +336,22 @@ void MusicWheelItem::RefreshGrades()
HighScoreList *BestpHSL = NULL;
Grade gradeBest = Grade_Invalid;
Difficulty dcBest = Difficulty_Invalid;
if (uaintnonastypadplayerdog) {
if (PROFILEMAN->IsPersistentProfile(ps) && dc != Difficulty_Invalid)
if (PROFILEMAN->IsPersistentProfile(ps) && dc != Difficulty_Invalid)
{
if (pWID->m_pSong)
{
if (pWID->m_pSong)
{
FOREACH_ENUM_N(Difficulty, 6, i) {
Steps* pSteps = SongUtil::GetStepsByDifficulty(pWID->m_pSong, st, i);
if (pSteps != NULL) {
Grade dcg = SCOREMAN->GetBestGradeFor(pSteps->GetChartKey());
if (gradeBest >= dcg) {
dcBest = i;
gradeBest = dcg;
}
FOREACH_ENUM_N(Difficulty, 6, i) {
Steps* pSteps = SongUtil::GetStepsByDifficulty(pWID->m_pSong, st, i);
if (pSteps != NULL) {
Grade dcg = SCOREMAN->GetBestGradeFor(pSteps->GetChartKey());
if (gradeBest >= dcg) {
dcBest = i;
gradeBest = dcg;
}
}
}
}
}
else {
dcBest = dc;
if (PROFILEMAN->IsPersistentProfile(ps) && dc != Difficulty_Invalid)
{
if (pWID->m_pSong)
{
const Steps* pSteps = SongUtil::GetStepsByDifficulty(pWID->m_pSong, st, dc);
if (pSteps != nullptr)
BestpHSL = &pProfile->GetStepsHighScoreList(pWID->m_pSong, pSteps);
}
}
}

// still needs cleaning up -mina
Message msg( "SetGrade" );
Expand All @@ -380,14 +364,10 @@ void MusicWheelItem::RefreshGrades()
msg.SetParam("PermaMirror", 1);
if (pWID->m_pSong->HasGoal())
msg.SetParam( "HasGoal", 1);
if (BestpHSL)
msg.SetParam("Grade", BestpHSL->HighGrade);
else
msg.SetParam("Grade", gradeBest);

msg.SetParam( "Difficulty", DifficultyToString(dcBest));
if (BestpHSL)
msg.SetParam( "NumTimesPlayed", BestpHSL->GetNumTimesPlayed());

msg.SetParam("Grade", gradeBest);
msg.SetParam("Difficulty", DifficultyToString(dcBest));
msg.SetParam("NumTimesPlayed", 0);
}
m_pGradeDisplay[p]->HandleMessage( msg );
}
Expand All @@ -396,9 +376,6 @@ void MusicWheelItem::RefreshGrades()
void MusicWheelItem::HandleMessage( const Message &msg )
{
static const bool iskyzagoodprogrammer = false;
if(iskyzagoodprogrammer || (!uaintnonastypadplayerdog && msg == Message_CurrentStepsP1Changed))
RefreshGrades();

WheelItemBase::HandleMessage( msg );
}

Expand Down

0 comments on commit 04dce35

Please sign in to comment.