diff --git a/stepmania/src/ScreenUnlock.cpp b/stepmania/src/ScreenUnlock.cpp index 5e68f15b9d..32f15816b7 100644 --- a/stepmania/src/ScreenUnlock.cpp +++ b/stepmania/src/ScreenUnlock.cpp @@ -56,14 +56,17 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock") ssprintf("Unlock%dSong", i)).c_str() ); if( pSong == NULL) + { + LOG->Trace("Can't find song"); continue; + } entry->Command(IconCommand); Unlocks.push_back(entry); if ( !pSong->isLocked ) - this->AddChild(Unlocks[i-1]); + this->AddChild(Unlocks[Unlocks.size() - 1]); } // scrolling text @@ -96,15 +99,24 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock") if (pSong != NULL && pSong->ActualSong != NULL) SongText = pSong->ActualSong->GetFullDisplayTitle(); else // song is missing - text->Command("Diffuse,1,0,0,1"); + { + if (SONGMAN->FindCourse(SongText) != NULL) + text->Command("Diffuse,0,1,0,1"); + else + text->Command("Diffuse,0.5,0,0,1"); + } BreakLine(SongText); text->SetZoom(ScrollingTextZoom); text->SetTextMaxWidth(MaxWidth, SongText ); - if (pSong->isLocked) { - text->SetText("????????"); - text->SetZoom(ScrollingTextZoom * 1.99); } + if (pSong != NULL && pSong->isLocked) { + text->SetText("???"); + // text->SetZoom(ScrollingTextZoom * 1.99); + } else if (pSong != NULL) { + RageColor color = SONGMAN->GetGroupColor(pSong->ActualSong->m_sGroupName); + text->SetGlobalDiffuseColor(color); + } text->SetXY(ScrollingTextX, ScrollingTextStartY); text->Command( ssprintf("diffusealpha,0;sleep,%f;linear,0.5;diffusealpha,1;linear,%f;y,%f;linear,0.5;diffusealpha,0", SECS_PER_CYCLE * (i - 1), SECS_PER_CYCLE * (ScrollingTextRows), ScrollingTextEndY) ); @@ -133,6 +145,7 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock") ItemIcons.push_back(IconCount); this->AddChild(ItemIcons[i-1]); + LOG->Trace("Added unlock text %d", i); } } diff --git a/stepmania/src/ScreenUnlock.h b/stepmania/src/ScreenUnlock.h index 151e5c8157..8c3e7a5c0c 100644 --- a/stepmania/src/ScreenUnlock.h +++ b/stepmania/src/ScreenUnlock.h @@ -14,8 +14,6 @@ #include "Sprite.h" #include "BitmapText.h" -#define NUM_UNLOCKS 30 - class Course; class ScreenUnlock : public ScreenAttract diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index f0acb740de..e402312426 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -1078,3 +1078,13 @@ Song *SongManager::FindSong( CString sGroup, CString sSong ) return NULL; } +Course *SongManager::FindCourse( CString sName ) +{ + for( unsigned i = 0; i < m_pCourses.size(); i++ ) + { + if( sName.CompareNoCase(m_pCourses[i]->m_sName) ) + return m_pCourses[i]; + } + + return NULL; +} \ No newline at end of file diff --git a/stepmania/src/SongManager.h b/stepmania/src/SongManager.h index 6ce4ed0408..a265821e0b 100644 --- a/stepmania/src/SongManager.h +++ b/stepmania/src/SongManager.h @@ -61,6 +61,7 @@ public: void GetSongs( vector &AddTo, int iMaxStages ) const { GetSongs(AddTo,"",iMaxStages); } void GetSongs( vector &AddTo ) const { GetSongs(AddTo,"",100000 /*inf*/ ); } Song *FindSong( CString sGroup, CString sSong ); + Course *FindCourse( CString sName ); int GetNumSongs() const; int GetNumGroups() const; int GetNumCourses() const;