diff --git a/stepmania/src/DifficultyMeter.cpp b/stepmania/src/DifficultyMeter.cpp index ff1a3e2158..671db03ef1 100644 --- a/stepmania/src/DifficultyMeter.cpp +++ b/stepmania/src/DifficultyMeter.cpp @@ -110,6 +110,40 @@ void DifficultyMeter::SetFromSteps( const Steps* pSteps ) SetDifficulty( DifficultyToString( pSteps->GetDifficulty() ) ); } +void DifficultyMeter::SetFromTrail( const Trail* pTrail ) +{ + if( pTrail == NULL ) + { + Unset(); + return; + } + + Difficulty FakeDifficulty; + switch( pTrail->m_CourseDifficulty ) + { + case COURSE_DIFFICULTY_EASY: FakeDifficulty = DIFFICULTY_EASY; break; + case COURSE_DIFFICULTY_REGULAR: FakeDifficulty = DIFFICULTY_MEDIUM; break; + case COURSE_DIFFICULTY_DIFFICULT: FakeDifficulty = DIFFICULTY_HARD; break; + default: ASSERT(0); + } + + +/* + if( pTrail->m_iMeter <= 1 ) + FakeDifficulty = DIFFICULTY_BEGINNER; + else if( pTrail->m_iMeter <= 3 ) + FakeDifficulty = DIFFICULTY_EASY; + else if( pTrail->m_iMeter <= 6 ) + FakeDifficulty = DIFFICULTY_MEDIUM; + else if( pTrail->m_iMeter <= 9 ) + FakeDifficulty = DIFFICULTY_HARD; + else + FakeDifficulty = DIFFICULTY_CHALLENGE; +*/ + SetFromMeterAndDifficulty( pTrail->m_iMeter, FakeDifficulty ); + SetDifficulty( DifficultyToString(FakeDifficulty) + "Course" ); +} + void DifficultyMeter::SetFromCourse( const Course* pCourse, PlayerNumber pn ) { if( pCourse == NULL ) diff --git a/stepmania/src/DifficultyMeter.h b/stepmania/src/DifficultyMeter.h index 4cb522b329..93f0a1708c 100644 --- a/stepmania/src/DifficultyMeter.h +++ b/stepmania/src/DifficultyMeter.h @@ -19,6 +19,7 @@ class Steps; class Course; +class Trail; class DifficultyMeter: public ActorFrame @@ -30,7 +31,8 @@ public: void SetFromGameState( PlayerNumber pn ); void SetFromMeterAndDifficulty( int iMeter, Difficulty dc ); void SetFromSteps( const Steps* pSteps ); - void SetFromCourse( const Course* pCourse, PlayerNumber pn ); + void SetFromCourse( const Course* pCourse, PlayerNumber pn ); /* deprecated */ + void SetFromTrail( const Trail* pTrail ); void Unset(); private: