add NumStepsLoadedFromProfile display

This commit is contained in:
Chris Danford
2005-03-08 01:46:57 +00:00
parent eadd3b3edb
commit e01845866f
8 changed files with 47 additions and 23 deletions
+11 -10
View File
@@ -1238,18 +1238,21 @@ void SongManager::FreeAllLoadedFromProfiles()
StepsID::ClearCache();
}
int SongManager::GetTotalNumberOfEdits()
int SongManager::GetNumStepsLoadedFromProfile()
{
int iNumEdits = 0;
for( unsigned s=0; s<m_pSongs.size(); s++ )
int iCount = 0;
FOREACH( Song*, m_pSongs, s )
{
Song* pSong = m_pSongs[s];
vector<Steps*> vSteps;
pSong->GetSteps( vSteps, STEPS_TYPE_INVALID, DIFFICULTY_INVALID );
iNumEdits += vSteps.size();
vector<Steps*> vpAllSteps = (*s)->GetAllSteps();
FOREACH( Steps*, vpAllSteps, ss )
{
if( (*ss)->GetLoadedFromProfile() != PROFILE_SLOT_INVALID )
iCount++;
}
}
return iNumEdits;
return iCount;
}
@@ -1277,7 +1280,6 @@ public:
}
static int FindSong( T* p, lua_State *L ) { Song *pS = p->FindSong(SArg(1)); if(pS) pS->PushSelf(L); else lua_pushnil(L); return 1; }
static int FindCourse( T* p, lua_State *L ) { Course *pC = p->FindCourse(SArg(1)); if(pC) pC->PushSelf(L); else lua_pushnil(L); return 1; }
static int GetTotalNumberOfEdits( T* p, lua_State *L ) { lua_pushnumber(L,p->GetTotalNumberOfEdits()); return 1; }
static void Register(lua_State *L)
{
@@ -1285,7 +1287,6 @@ public:
ADD_METHOD( GetAllCourses )
ADD_METHOD( FindSong )
ADD_METHOD( FindCourse )
ADD_METHOD( GetTotalNumberOfEdits )
Luna<T>::Register( L );
// Add global singleton if constructed already. If it's not constructed yet,