add special coloring for unlock songs/courses
This commit is contained in:
@@ -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...=
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user