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
+4
View File
@@ -13,6 +13,7 @@ ScreenWidth=640
ScreenHeight=480 ScreenHeight=480
OverlayScreens=ScreenSystemLayer OverlayScreens=ScreenSystemLayer
HomeEditMode=0 HomeEditMode=0
MaxStepsLoadedFromProfile=-1
[ModeSwitcher] [ModeSwitcher]
PrevModeX=-200 PrevModeX=-200
@@ -2190,6 +2191,9 @@ Class=ScreenEditMenu
ExplanationX=SCREEN_CENTER_X ExplanationX=SCREEN_CENTER_X
ExplanationY=SCREEN_BOTTOM-70 ExplanationY=SCREEN_BOTTOM-70
ExplanationOnCommand=wrapwidthpixels,900;zoom,0.7 ExplanationOnCommand=wrapwidthpixels,900;zoom,0.7
NumStepsLoadedFromProfileX=SCREEN_RIGHT-180
NumStepsLoadedFromProfileY=SCREEN_TOP+42
NumStepsLoadedFromProfileOnCommand=zoom,0.7
StyleIcon=0 StyleIcon=0
MemoryCardIcons=1 MemoryCardIcons=1
TimerSeconds=0 TimerSeconds=0
+11 -10
View File
@@ -5,16 +5,17 @@
CString PLAYER_COLOR_NAME( size_t p ) { return ssprintf("ColorP%d",p+1); } CString PLAYER_COLOR_NAME( size_t p ) { return ssprintf("ColorP%d",p+1); }
ThemeMetric<CString> DIFFICULTIES_TO_SHOW ("Common","DifficultiesToShow"); ThemeMetric<CString> DIFFICULTIES_TO_SHOW ("Common","DifficultiesToShow");
ThemeMetric<CString> INITIAL_SCREEN ("Common","InitialScreen"); ThemeMetric<CString> INITIAL_SCREEN ("Common","InitialScreen");
ThemeMetric<CString> FIRST_RUN_INITIAL_SCREEN ("Common","FirstRunInitialScreen"); ThemeMetric<CString> FIRST_RUN_INITIAL_SCREEN ("Common","FirstRunInitialScreen");
ThemeMetric<CString> DEFAULT_MODIFIERS ("Common","DefaultModifiers" ); ThemeMetric<CString> DEFAULT_MODIFIERS ("Common","DefaultModifiers" );
ThemeMetric<CString> DEFAULT_CPU_MODIFIERS ("Common","DefaultCpuModifiers" ); ThemeMetric<CString> DEFAULT_CPU_MODIFIERS ("Common","DefaultCpuModifiers" );
ThemeMetric<CString> COURSE_DIFFICULTIES_TO_SHOW ("Common","CourseDifficultiesToShow"); ThemeMetric<CString> COURSE_DIFFICULTIES_TO_SHOW ("Common","CourseDifficultiesToShow");
ThemeMetric1D<RageColor> PLAYER_COLOR ("Common",PLAYER_COLOR_NAME,NUM_PLAYERS); ThemeMetric1D<RageColor> PLAYER_COLOR ("Common",PLAYER_COLOR_NAME,NUM_PLAYERS);
ThemeMetric<float> JOIN_PAUSE_SECONDS ("Common","JoinPauseSeconds"); ThemeMetric<float> JOIN_PAUSE_SECONDS ("Common","JoinPauseSeconds");
ThemeMetric<CString> WINDOW_TITLE ("Common","WindowTitle"); ThemeMetric<CString> WINDOW_TITLE ("Common","WindowTitle");
ThemeMetric<bool> HOME_EDIT_MODE ("Common","HomeEditMode"); ThemeMetric<bool> HOME_EDIT_MODE ("Common","HomeEditMode");
ThemeMetric<int> MAX_STEPS_LOADED_FROM_PROFILE ("Common","MaxStepsLoadedFromProfile");
/* /*
+2
View File
@@ -16,6 +16,8 @@ extern ThemeMetric1D<RageColor> PLAYER_COLOR;
extern ThemeMetric<float> JOIN_PAUSE_SECONDS; extern ThemeMetric<float> JOIN_PAUSE_SECONDS;
extern ThemeMetric<CString> WINDOW_TITLE; extern ThemeMetric<CString> WINDOW_TITLE;
extern ThemeMetric<bool> HOME_EDIT_MODE; extern ThemeMetric<bool> HOME_EDIT_MODE;
extern ThemeMetric<int> MAX_STEPS_LOADED_FROM_PROFILE;
#endif #endif
+15 -1
View File
@@ -12,10 +12,10 @@
#include "ThemeManager.h" #include "ThemeManager.h"
#include "Steps.h" #include "Steps.h"
#include "song.h" #include "song.h"
#include "CommonMetrics.h"
#define PREV_SCREEN THEME->GetMetric(m_sName,"PrevScreen") #define PREV_SCREEN THEME->GetMetric(m_sName,"PrevScreen")
#define EXPLANATION_TEXT( row ) THEME->GetMetric(m_sName,"Explanation"+EditMenuRowToString(row)) #define EXPLANATION_TEXT( row ) THEME->GetMetric(m_sName,"Explanation"+EditMenuRowToString(row))
#define HELP_TEXT THEME->GetMetric(m_sName,"HelpText")
const ScreenMessage SM_RefreshSelector = (ScreenMessage)(SM_User+1); const ScreenMessage SM_RefreshSelector = (ScreenMessage)(SM_User+1);
@@ -44,6 +44,12 @@ void ScreenEditMenu::Init()
RefreshExplanationText(); RefreshExplanationText();
this->AddChild( &m_textExplanation ); this->AddChild( &m_textExplanation );
m_textNumStepsLoadedFromProfile.SetName( "NumStepsLoadedFromProfile" );
m_textNumStepsLoadedFromProfile.LoadFromFont( THEME->GetPathF(m_sName,"NumStepsLoadedFromProfile") );
SET_XY_AND_ON_COMMAND( m_textNumStepsLoadedFromProfile );
RefreshNumStepsLoadedFromProfile();
this->AddChild( &m_textNumStepsLoadedFromProfile );
this->SortByDrawOrder(); this->SortByDrawOrder();
SOUND->PlayMusic( THEME->GetPathS(m_sName,"music") ); SOUND->PlayMusic( THEME->GetPathS(m_sName,"music") );
@@ -249,6 +255,14 @@ void ScreenEditMenu::RefreshExplanationText()
ON_COMMAND( m_textExplanation ); ON_COMMAND( m_textExplanation );
} }
void ScreenEditMenu::RefreshNumStepsLoadedFromProfile()
{
CString s = ssprintf( "edits loaded: %d", SONGMAN->GetNumStepsLoadedFromProfile() );
int iMaxStepsLoadedFromProfile = MAX_STEPS_LOADED_FROM_PROFILE;
if( iMaxStepsLoadedFromProfile != -1 )
s += ssprintf( " / %d", iMaxStepsLoadedFromProfile );
m_textNumStepsLoadedFromProfile.SetText( s );
}
/* /*
* (c) 2002-2004 Chris Danford * (c) 2002-2004 Chris Danford
+2
View File
@@ -23,10 +23,12 @@ private:
void MenuStart( PlayerNumber pn ); void MenuStart( PlayerNumber pn );
void RefreshExplanationText(); void RefreshExplanationText();
void RefreshNumStepsLoadedFromProfile();
EditMenu m_Selector; EditMenu m_Selector;
BitmapText m_textExplanation; BitmapText m_textExplanation;
BitmapText m_textNumStepsLoadedFromProfile;
}; };
#endif #endif
+1 -1
View File
@@ -826,7 +826,7 @@ void Song::GetSteps(
if( !iMaxToGet ) if( !iMaxToGet )
return; return;
const vector<Steps*>& vpSteps = GetStepsByStepsType(st); const vector<Steps*> &vpSteps = st == STEPS_TYPE_INVALID ? GetAllSteps() : GetStepsByStepsType(st);
for( unsigned i=0; i<vpSteps.size(); i++ ) // for each of the Song's Steps for( unsigned i=0; i<vpSteps.size(); i++ ) // for each of the Song's Steps
{ {
Steps* pSteps = vpSteps[i]; Steps* pSteps = vpSteps[i];
+11 -10
View File
@@ -1238,18 +1238,21 @@ void SongManager::FreeAllLoadedFromProfiles()
StepsID::ClearCache(); StepsID::ClearCache();
} }
int SongManager::GetTotalNumberOfEdits() int SongManager::GetNumStepsLoadedFromProfile()
{ {
int iNumEdits = 0; int iCount = 0;
for( unsigned s=0; s<m_pSongs.size(); s++ ) FOREACH( Song*, m_pSongs, s )
{ {
Song* pSong = m_pSongs[s]; vector<Steps*> vpAllSteps = (*s)->GetAllSteps();
vector<Steps*> vSteps;
pSong->GetSteps( vSteps, STEPS_TYPE_INVALID, DIFFICULTY_INVALID ); FOREACH( Steps*, vpAllSteps, ss )
iNumEdits += vSteps.size(); {
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 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 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) static void Register(lua_State *L)
{ {
@@ -1285,7 +1287,6 @@ public:
ADD_METHOD( GetAllCourses ) ADD_METHOD( GetAllCourses )
ADD_METHOD( FindSong ) ADD_METHOD( FindSong )
ADD_METHOD( FindCourse ) ADD_METHOD( FindCourse )
ADD_METHOD( GetTotalNumberOfEdits )
Luna<T>::Register( L ); Luna<T>::Register( L );
// Add global singleton if constructed already. If it's not constructed yet, // Add global singleton if constructed already. If it's not constructed yet,
+1 -1
View File
@@ -35,7 +35,7 @@ public:
void SetPreferences(); void SetPreferences();
void LoadAllFromProfile( ProfileSlot s ); // songs, edits void LoadAllFromProfile( ProfileSlot s ); // songs, edits
int GetTotalNumberOfEdits(); int GetNumStepsLoadedFromProfile();
void FreeAllLoadedFromProfiles(); void FreeAllLoadedFromProfiles();
void LoadGroupSymLinks( CString sDir, CString sGroupFolder ); void LoadGroupSymLinks( CString sDir, CString sGroupFolder );