simplify
This commit is contained in:
@@ -49,7 +49,7 @@ CourseContentsList::CourseContentsList()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CourseContentsList::SetFromCourse( Course* pCourse )
|
void CourseContentsList::SetFromCourse( const Course* pCourse )
|
||||||
{
|
{
|
||||||
if( pCourse == NULL )
|
if( pCourse == NULL )
|
||||||
{
|
{
|
||||||
@@ -66,23 +66,9 @@ void CourseContentsList::SetFromCourse( Course* pCourse )
|
|||||||
{
|
{
|
||||||
CourseEntryDisplay& display = m_CourseContentDisplays[m_iNumContents];
|
CourseEntryDisplay& display = m_CourseContentDisplays[m_iNumContents];
|
||||||
|
|
||||||
if( ci[i].Mystery )
|
display.LoadFromCourseInfo( m_iNumContents+1, pCourse, ci[i] );
|
||||||
{
|
|
||||||
Difficulty dc = pCourse->GetDifficulty( ci[i] );
|
|
||||||
int iMeterLow, iMeterHigh;
|
|
||||||
pCourse->GetMeterRange(ci[i], iMeterLow, iMeterHigh);
|
|
||||||
|
|
||||||
if( dc == DIFFICULTY_INVALID )
|
m_iNumContents++;
|
||||||
display.LoadFromMeterRange( m_iNumContents+1, iMeterLow, iMeterHigh, ci[i].Modifiers );
|
|
||||||
else
|
|
||||||
display.LoadFromDifficulty( m_iNumContents+1, dc, ci[i].Modifiers );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
display.LoadFromSongAndNotes( m_iNumContents+1, ci[i].pSong, ci[i].pNotes, ci[i].Modifiers );
|
|
||||||
}
|
|
||||||
|
|
||||||
m_iNumContents ++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public:
|
|||||||
virtual void Update( float fDeltaTime );
|
virtual void Update( float fDeltaTime );
|
||||||
virtual void DrawPrimitives();
|
virtual void DrawPrimitives();
|
||||||
|
|
||||||
void SetFromCourse( Course* pCourse );
|
void SetFromCourse( const Course* pCourse );
|
||||||
void TweenInAfterChangedCourse();
|
void TweenInAfterChangedCourse();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -61,61 +61,45 @@ void CourseEntryDisplay::Load()
|
|||||||
this->AddChild( &m_textModifiers );
|
this->AddChild( &m_textModifiers );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CourseEntryDisplay::LoadFromCourseInfo( int iNum, const Course *pCourse, const Course::Info &ci )
|
||||||
void CourseEntryDisplay::LoadFromSongAndNotes( int iNum, Song* pSong, Steps* pNotes, CString sModifiers )
|
|
||||||
{
|
{
|
||||||
|
RageColor colorNotes;
|
||||||
|
if( ci.Mystery )
|
||||||
|
{
|
||||||
|
Difficulty dc = pCourse->GetDifficulty( ci );
|
||||||
|
|
||||||
|
if( dc == DIFFICULTY_INVALID )
|
||||||
|
{
|
||||||
|
int iLow, iHigh;
|
||||||
|
pCourse->GetMeterRange(ci, iLow, iHigh);
|
||||||
|
|
||||||
|
colorNotes = RageColor(1,1,1,1);
|
||||||
|
m_textDifficultyNumber.SetText( ssprintf(iLow==iHigh?"%d":"%d-%d", iLow, iHigh) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
colorNotes = SONGMAN->GetDifficultyColor( dc );
|
||||||
|
m_textDifficultyNumber.SetText( "?" );
|
||||||
|
}
|
||||||
|
|
||||||
|
m_TextBanner.LoadFromString( "??????????", "??????????", "", "", "", "" );
|
||||||
|
m_TextBanner.SetDiffuse( RageColor(1,1,1,1) ); // TODO: What should this be?
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
colorNotes = SONGMAN->GetDifficultyColor( ci.pNotes->GetDifficulty() );
|
||||||
|
m_textDifficultyNumber.SetText( ssprintf("%d", ci.pNotes->GetMeter()) );
|
||||||
|
|
||||||
|
m_TextBanner.LoadFromSong( ci.pSong );
|
||||||
|
m_TextBanner.SetDiffuse( SONGMAN->GetSongColor( ci.pSong ) );
|
||||||
|
}
|
||||||
|
|
||||||
m_textNumber.SetText( ssprintf("%d", iNum) );
|
m_textNumber.SetText( ssprintf("%d", iNum) );
|
||||||
|
|
||||||
RageColor colorGroup = SONGMAN->GetSongColor( pSong );
|
|
||||||
RageColor colorNotes = SONGMAN->GetDifficultyColor( pNotes->GetDifficulty() );
|
|
||||||
|
|
||||||
m_TextBanner.LoadFromSong( pSong );
|
|
||||||
m_TextBanner.SetDiffuse( colorGroup );
|
|
||||||
|
|
||||||
m_textFoot.SetText( "1" );
|
m_textFoot.SetText( "1" );
|
||||||
m_textFoot.SetDiffuse( colorNotes );
|
m_textFoot.SetDiffuse( colorNotes );
|
||||||
|
|
||||||
m_textDifficultyNumber.SetText( ssprintf("%d", pNotes->GetMeter()) );
|
m_textModifiers.SetText( ci.Modifiers );
|
||||||
|
|
||||||
m_textDifficultyNumber.SetDiffuse( colorNotes );
|
m_textDifficultyNumber.SetDiffuse( colorNotes );
|
||||||
|
|
||||||
m_textModifiers.SetText( sModifiers );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CourseEntryDisplay::LoadFromDifficulty( int iNum, Difficulty dc, CString sModifiers )
|
|
||||||
{
|
|
||||||
m_textNumber.SetText( ssprintf("%d", iNum) );
|
|
||||||
|
|
||||||
RageColor colorGroup = RageColor(1,1,1,1); // TODO: What should this be?
|
|
||||||
RageColor colorNotes = SONGMAN->GetDifficultyColor( dc );
|
|
||||||
|
|
||||||
m_TextBanner.LoadFromString( "??????????", "??????????", "", "", "", "" );
|
|
||||||
m_TextBanner.SetDiffuse( colorGroup );
|
|
||||||
|
|
||||||
m_textFoot.SetText( "1" );
|
|
||||||
m_textFoot.SetDiffuse( colorNotes );
|
|
||||||
|
|
||||||
m_textDifficultyNumber.SetText( "?" );
|
|
||||||
m_textDifficultyNumber.SetDiffuse( colorNotes );
|
|
||||||
|
|
||||||
m_textModifiers.SetText( sModifiers );
|
|
||||||
}
|
|
||||||
|
|
||||||
void CourseEntryDisplay::LoadFromMeterRange( int iNum, int iLow, int iHigh, CString sModifiers )
|
|
||||||
{
|
|
||||||
m_textNumber.SetText( ssprintf("%d", iNum) );
|
|
||||||
|
|
||||||
RageColor colorGroup = RageColor(1,1,1,1); // TODO: What should this be?
|
|
||||||
RageColor colorNotes = RageColor(1,1,1,1);
|
|
||||||
|
|
||||||
m_TextBanner.LoadFromString( "??????????", "??????????", "", "", "", "" );
|
|
||||||
m_TextBanner.SetDiffuse( colorGroup );
|
|
||||||
|
|
||||||
m_textFoot.SetText( "1" );
|
|
||||||
m_textFoot.SetDiffuse( colorNotes );
|
|
||||||
|
|
||||||
m_textDifficultyNumber.SetText( ssprintf(iLow==iHigh?"%d":"%d-%d", iLow, iHigh) );
|
|
||||||
m_textDifficultyNumber.SetDiffuse( colorNotes );
|
|
||||||
|
|
||||||
m_textModifiers.SetText( sModifiers );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#include "Sprite.h"
|
#include "Sprite.h"
|
||||||
#include "Quad.h"
|
#include "Quad.h"
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
|
#include "Course.h"
|
||||||
class Course;
|
class Course;
|
||||||
class Song;
|
class Song;
|
||||||
class Steps;
|
class Steps;
|
||||||
@@ -27,9 +28,7 @@ class CourseEntryDisplay : public ActorFrame
|
|||||||
public:
|
public:
|
||||||
void Load();
|
void Load();
|
||||||
|
|
||||||
void LoadFromSongAndNotes( int iNum, Song* pSong, Steps* pNotes, CString sModifiers );
|
void LoadFromCourseInfo( int iNum, const Course *pCourse, const Course::Info &ci );
|
||||||
void LoadFromDifficulty( int iNum, Difficulty dc, CString sModifiers );
|
|
||||||
void LoadFromMeterRange( int iNum, int iLow, int iHigh, CString sModifiers );
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Sprite m_sprFrame;
|
Sprite m_sprFrame;
|
||||||
|
|||||||
Reference in New Issue
Block a user