add special coloring for unlock songs/courses

This commit is contained in:
Chris Danford
2006-03-19 05:59:24 +00:00
parent efe1c3b57f
commit 7446a213dc
3 changed files with 20 additions and 11 deletions
+2 -1
View File
@@ -2769,7 +2769,8 @@ NumCourseGroupColors=1
CourseGroupColor1=1,1,1,1
ExtraColor=1.0,0.0,0.0,1.0 // red
ExtraColorMeter=10
UseUnlockColor=0
UnlockColor=1,1,1,1
Loading songs...=
Loading courses...=
Reloading...=
+9 -1
View File
@@ -43,6 +43,8 @@ const RString COURSES_DIR = "Courses/";
static const ThemeMetric<RageColor> EXTRA_COLOR ("SongManager","ExtraColor");
static const ThemeMetric<int> EXTRA_COLOR_METER ("SongManager","ExtraColorMeter");
static const ThemeMetric<bool> USE_UNLOCK_COLOR ("SongManager","UseUnlockColor");
static const ThemeMetric<RageColor> UNLOCK_COLOR ("SongManager","UnlockColor");
RString SONG_GROUP_COLOR_NAME( size_t i ) { return ssprintf("SongGroupColor%i",(int) i+1); }
RString COURSE_GROUP_COLOR_NAME( size_t i ) { return ssprintf("CourseGroupColor%i",(int) i+1); }
@@ -332,7 +334,7 @@ RageColor SongManager::GetSongGroupColor( const RString &sSongGroup )
for( unsigned i=0; i<m_sSongGroupNames.size(); i++ )
{
if( m_sSongGroupNames[i] == sSongGroup )
return SONG_GROUP_COLOR.GetValue( i%NUM_SONG_GROUP_COLORS ); // TODO: Add course group colors?
return SONG_GROUP_COLOR.GetValue( i%NUM_SONG_GROUP_COLORS );
}
ASSERT_M( 0, ssprintf("requested color for song group '%s' that doesn't exist",sSongGroup.c_str()) );
@@ -343,6 +345,9 @@ RageColor SongManager::GetSongColor( const Song* pSong )
{
ASSERT( pSong );
if( USE_UNLOCK_COLOR && UNLOCKMAN->FindSong(pSong) != NULL )
return UNLOCK_COLOR;
/* XXX:
* Previously, this matched all notes, which set a song to "extra" if it
* had any 10-foot steps at all, even edits or doubles.
@@ -418,6 +423,9 @@ RageColor SongManager::GetCourseGroupColor( const RString &sCourseGroup )
RageColor SongManager::GetCourseColor( const Course* pCourse )
{
if( USE_UNLOCK_COLOR && UNLOCKMAN->FindCourse(pCourse) != NULL )
return UNLOCK_COLOR;
return GetCourseGroupColor( pCourse->m_sGroupName );
}
+6 -6
View File
@@ -118,7 +118,7 @@ public:
void PreferUnlockEntryID( int iEntryID );
// Unlocks a song.
void UnlockSong( const Song *song );
void UnlockSong( const Song *pSong );
// Return the associated EntryID.
int FindEntryID( const RString &sName ) const;
@@ -133,6 +133,11 @@ public:
void GetSongsUnlockedByEntryID( vector<Song *> &apSongsOut, int iEntryID );
void GetStepsUnlockedByEntryID( vector<Song *> &apSongsOut, vector<Difficulty> &apStepsOut, int iEntryID );
const UnlockEntry *FindSong( const Song *pSong ) const;
const UnlockEntry *FindSteps( const Song *pSong, const Steps *pSteps ) const;
const UnlockEntry *FindCourse( const Course *pCourse ) const;
const UnlockEntry *FindModifier( const RString &sOneMod ) const;
// Lua
void PushSelf( lua_State *L );
@@ -140,11 +145,6 @@ private:
// read unlocks
void Load();
const UnlockEntry *FindSong( const Song *pSong ) const;
const UnlockEntry *FindSteps( const Song *pSong, const Steps *pSteps ) const;
const UnlockEntry *FindCourse( const Course *pCourse ) const;
const UnlockEntry *FindModifier( const RString &sOneMod ) const;
set<int> m_RouletteCodes; // "codes" which are available in roulette and which unlock if rouletted
};