hide songs loaded from AdditionalSongFolders

This commit is contained in:
Chris Danford
2006-04-04 21:52:54 +00:00
parent be3e197485
commit 27c7482556
4 changed files with 13 additions and 4 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ void EditMenu::GetSongsToShowForGroup( const RString &sGroup, vector<Song*> &vpS
for( int i=vpSongsOut.size()-1; i>=0; i-- )
{
const Song* pSong = vpSongsOut[i];
if( UNLOCKMAN->SongIsLocked(pSong) || pSong->IsTutorial() )
if( UNLOCKMAN->SongIsLocked(pSong) || pSong->IsTutorial() || SONGMAN->WasLoadedFromAdditionalSongs(pSong) )
vpSongsOut.erase( vpSongsOut.begin()+i );
}
break;
+10 -2
View File
@@ -37,8 +37,9 @@
SongManager* SONGMAN = NULL; // global and accessable from anywhere in our program
const RString SONGS_DIR = "Songs/";
const RString COURSES_DIR = "Courses/";
const RString SONGS_DIR = "/Songs/";
const RString ADDITIONAL_SONGS_DIR = "/AdditionalSongs/";
const RString COURSES_DIR = "/Courses/";
static const ThemeMetric<RageColor> EXTRA_COLOR ("SongManager","ExtraColor");
static const ThemeMetric<int> EXTRA_COLOR_METER ("SongManager","ExtraColorMeter");
@@ -103,6 +104,7 @@ void SongManager::InitSongsFromDisk( LoadingWindow *ld )
{
RageTimer tm;
LoadStepManiaSongDir( SONGS_DIR, ld );
LoadStepManiaSongDir( ADDITIONAL_SONGS_DIR, ld );
LOG->Trace( "Found %d songs in %f seconds.", (int)m_pSongs.size(), tm.GetDeltaTime() );
}
@@ -937,6 +939,12 @@ void SongManager::DeleteSteps( Steps *pSteps )
pSong->DeleteSteps( pSteps );
}
bool SongManager::WasLoadedFromAdditionalSongs( const Song *pSong ) const
{
RString sDir = pSong->GetSongDir();
return BeginsWith( sDir, ADDITIONAL_SONGS_DIR );
}
void SongManager::GetAllCourses( vector<Course*> &AddTo, bool bIncludeAutogen )
{
for( unsigned i=0; i<m_pCourses.size(); i++ )
+1
View File
@@ -95,6 +95,7 @@ public:
void GetStepsLoadedFromProfile( vector<Steps*> &AddTo, ProfileSlot slot );
Song *GetSongFromSteps( Steps *pSteps );
void DeleteSteps( Steps *pSteps ); // transfers ownership of pSteps
bool WasLoadedFromAdditionalSongs( const Song *pSong ) const;
void GetAllCourses( vector<Course*> &AddTo, bool bIncludeAutogen );
void GetCourses( CourseType ct, vector<Course*> &AddTo, bool bIncludeAutogen );
+1 -1
View File
@@ -975,7 +975,7 @@ int main(int argc, char* argv[])
vector<RString> dirs;
split( PREFSMAN->m_sAdditionalSongFolders, ",", dirs, true );
for( unsigned i=0; i < dirs.size(); i++)
FILEMAN->Mount( "dir", dirs[i], "/Songs" );
FILEMAN->Mount( "dir", dirs[i], "/AdditionalSongs" );
}
MountTreeOfZips( ZIPS_DIR );