add special coloring for unlock songs/courses
This commit is contained in:
@@ -2769,7 +2769,8 @@ NumCourseGroupColors=1
|
|||||||
CourseGroupColor1=1,1,1,1
|
CourseGroupColor1=1,1,1,1
|
||||||
ExtraColor=1.0,0.0,0.0,1.0 // red
|
ExtraColor=1.0,0.0,0.0,1.0 // red
|
||||||
ExtraColorMeter=10
|
ExtraColorMeter=10
|
||||||
|
UseUnlockColor=0
|
||||||
|
UnlockColor=1,1,1,1
|
||||||
Loading songs...=
|
Loading songs...=
|
||||||
Loading courses...=
|
Loading courses...=
|
||||||
Reloading...=
|
Reloading...=
|
||||||
|
|||||||
@@ -41,8 +41,10 @@ SongManager* SONGMAN = NULL; // global and accessable from anywhere in our progr
|
|||||||
const RString SONGS_DIR = "Songs/";
|
const RString SONGS_DIR = "Songs/";
|
||||||
const RString COURSES_DIR = "Courses/";
|
const RString COURSES_DIR = "Courses/";
|
||||||
|
|
||||||
static const ThemeMetric<RageColor> EXTRA_COLOR ("SongManager","ExtraColor");
|
static const ThemeMetric<RageColor> EXTRA_COLOR ("SongManager","ExtraColor");
|
||||||
static const ThemeMetric<int> EXTRA_COLOR_METER ("SongManager","ExtraColorMeter");
|
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 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); }
|
RString COURSE_GROUP_COLOR_NAME( size_t i ) { return ssprintf("CourseGroupColor%i",(int) i+1); }
|
||||||
@@ -51,9 +53,9 @@ RString COURSE_GROUP_COLOR_NAME( size_t i ) { return ssprintf("CourseGroupColor%
|
|||||||
SongManager::SongManager()
|
SongManager::SongManager()
|
||||||
{
|
{
|
||||||
NUM_SONG_GROUP_COLORS .Load("SongManager","NumSongGroupColors");
|
NUM_SONG_GROUP_COLORS .Load("SongManager","NumSongGroupColors");
|
||||||
SONG_GROUP_COLOR .Load("SongManager",SONG_GROUP_COLOR_NAME,NUM_SONG_GROUP_COLORS);
|
SONG_GROUP_COLOR .Load("SongManager",SONG_GROUP_COLOR_NAME,NUM_SONG_GROUP_COLORS);
|
||||||
NUM_COURSE_GROUP_COLORS .Load("SongManager","NumCourseGroupColors");
|
NUM_COURSE_GROUP_COLORS .Load("SongManager","NumCourseGroupColors");
|
||||||
COURSE_GROUP_COLOR .Load("SongManager",COURSE_GROUP_COLOR_NAME,NUM_COURSE_GROUP_COLORS);
|
COURSE_GROUP_COLOR .Load("SongManager",COURSE_GROUP_COLOR_NAME,NUM_COURSE_GROUP_COLORS);
|
||||||
}
|
}
|
||||||
|
|
||||||
SongManager::~SongManager()
|
SongManager::~SongManager()
|
||||||
@@ -332,7 +334,7 @@ RageColor SongManager::GetSongGroupColor( const RString &sSongGroup )
|
|||||||
for( unsigned i=0; i<m_sSongGroupNames.size(); i++ )
|
for( unsigned i=0; i<m_sSongGroupNames.size(); i++ )
|
||||||
{
|
{
|
||||||
if( m_sSongGroupNames[i] == sSongGroup )
|
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()) );
|
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 );
|
ASSERT( pSong );
|
||||||
|
|
||||||
|
if( USE_UNLOCK_COLOR && UNLOCKMAN->FindSong(pSong) != NULL )
|
||||||
|
return UNLOCK_COLOR;
|
||||||
|
|
||||||
/* XXX:
|
/* XXX:
|
||||||
* Previously, this matched all notes, which set a song to "extra" if it
|
* Previously, this matched all notes, which set a song to "extra" if it
|
||||||
* had any 10-foot steps at all, even edits or doubles.
|
* 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 )
|
RageColor SongManager::GetCourseColor( const Course* pCourse )
|
||||||
{
|
{
|
||||||
|
if( USE_UNLOCK_COLOR && UNLOCKMAN->FindCourse(pCourse) != NULL )
|
||||||
|
return UNLOCK_COLOR;
|
||||||
|
|
||||||
return GetCourseGroupColor( pCourse->m_sGroupName );
|
return GetCourseGroupColor( pCourse->m_sGroupName );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public:
|
|||||||
void PreferUnlockEntryID( int iEntryID );
|
void PreferUnlockEntryID( int iEntryID );
|
||||||
|
|
||||||
// Unlocks a song.
|
// Unlocks a song.
|
||||||
void UnlockSong( const Song *song );
|
void UnlockSong( const Song *pSong );
|
||||||
|
|
||||||
// Return the associated EntryID.
|
// Return the associated EntryID.
|
||||||
int FindEntryID( const RString &sName ) const;
|
int FindEntryID( const RString &sName ) const;
|
||||||
@@ -133,6 +133,11 @@ public:
|
|||||||
void GetSongsUnlockedByEntryID( vector<Song *> &apSongsOut, int iEntryID );
|
void GetSongsUnlockedByEntryID( vector<Song *> &apSongsOut, int iEntryID );
|
||||||
void GetStepsUnlockedByEntryID( vector<Song *> &apSongsOut, vector<Difficulty> &apStepsOut, 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
|
// Lua
|
||||||
void PushSelf( lua_State *L );
|
void PushSelf( lua_State *L );
|
||||||
|
|
||||||
@@ -140,11 +145,6 @@ private:
|
|||||||
// read unlocks
|
// read unlocks
|
||||||
void Load();
|
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
|
set<int> m_RouletteCodes; // "codes" which are available in roulette and which unlock if rouletted
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user