enum name cleanup

This commit is contained in:
Chris Danford
2005-12-01 03:20:25 +00:00
parent 1829ba9eee
commit 36c7d8e0ed
26 changed files with 164 additions and 139 deletions
+1 -1
View File
@@ -214,7 +214,7 @@ void Course::Init()
m_sSubTitleTranslit = "";
m_sBannerPath = "";
m_sCDTitlePath = "";
m_LoadedFromProfile = PROFILE_SLOT_INVALID;
m_LoadedFromProfile = ProfileSlot_INVALID;
m_iTrailCacheSeed = 0;
}
+2 -2
View File
@@ -204,8 +204,8 @@ public:
bool GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) const;
bool GetTrailSorted( StepsType st, CourseDifficulty cd, Trail &trail ) const;
bool IsAnEdit() const { return m_LoadedFromProfile != PROFILE_SLOT_INVALID; }
ProfileSlot m_LoadedFromProfile; // PROFILE_SLOT_INVALID if wasn't loaded from a profile
bool IsAnEdit() const { return m_LoadedFromProfile != ProfileSlot_INVALID; }
ProfileSlot m_LoadedFromProfile; // ProfileSlot_INVALID if wasn't loaded from a profile
typedef pair<StepsType,Difficulty> CacheEntry;
struct CacheData
+30 -17
View File
@@ -33,8 +33,8 @@ static const CString EditMenuActionNames[] = {
"Create",
"Practice",
};
XToString( EditMenuAction, NUM_EDIT_MENU_ACTIONS );
XToThemedString( EditMenuAction, NUM_EDIT_MENU_ACTIONS );
XToString( EditMenuAction, NUM_EditMenuAction );
XToThemedString( EditMenuAction, NUM_EditMenuAction );
StringToX( EditMenuAction );
static CString ARROWS_X_NAME( size_t i ) { return ssprintf("Arrows%dX",int(i+1)); }
@@ -252,13 +252,13 @@ int EditMenu::GetRowSize( EditMenuRow er ) const
{
switch( er )
{
case ROW_GROUP: return m_sGroups.size();
case ROW_SONG: return m_pSongs.size();
case ROW_STEPS_TYPE: return m_StepsTypes.size();
case ROW_STEPS: return m_vpSteps.size();
case ROW_GROUP: return m_sGroups.size();
case ROW_SONG: return m_pSongs.size();
case ROW_STEPS_TYPE: return m_StepsTypes.size();
case ROW_STEPS: return m_vpSteps.size();
case ROW_SOURCE_STEPS_TYPE: return m_StepsTypes.size();
case ROW_SOURCE_STEPS: return m_vpSourceSteps.size();
case ROW_ACTION: return m_Actions.size();
case ROW_SOURCE_STEPS: return m_vpSourceSteps.size();
case ROW_ACTION: return m_Actions.size();
default: FAIL_M( ssprintf("%i", er) );
}
}
@@ -367,11 +367,24 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
{
if( dc == DIFFICULTY_EDIT )
{
vector<Steps*> v;
GetSelectedSong()->GetSteps( v, GetSelectedStepsType(), DIFFICULTY_EDIT );
StepsUtil::SortStepsByDescription( v );
FOREACH_CONST( Steps*, v, p )
m_vpSteps.push_back( StepsAndDifficulty(*p,dc) );
switch( EDIT_MODE.GetValue() )
{
case EDIT_MODE_FULL:
case EDIT_MODE_PRACTICE:
{
vector<Steps*> v;
GetSelectedSong()->GetSteps( v, GetSelectedStepsType(), DIFFICULTY_EDIT );
StepsUtil::SortStepsByDescription( v );
FOREACH_CONST( Steps*, v, p )
m_vpSteps.push_back( StepsAndDifficulty(*p,dc) );
}
break;
case EDIT_MODE_HOME:
// have only "New Edit"
break;
default:
ASSERT(0);
}
switch( EDIT_MODE.GetValue() )
{
@@ -508,12 +521,12 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
switch( EDIT_MODE.GetValue() )
{
case EDIT_MODE_PRACTICE:
m_Actions.push_back( EDIT_MENU_ACTION_PRACTICE );
m_Actions.push_back( EditMenuAction_Practice );
break;
case EDIT_MODE_HOME:
case EDIT_MODE_FULL:
m_Actions.push_back( EDIT_MENU_ACTION_EDIT );
m_Actions.push_back( EDIT_MENU_ACTION_DELETE );
m_Actions.push_back( EditMenuAction_Edit );
m_Actions.push_back( EditMenuAction_Delete );
break;
default:
ASSERT(0);
@@ -521,7 +534,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
}
else
{
m_Actions.push_back( EDIT_MENU_ACTION_CREATE );
m_Actions.push_back( EditMenuAction_Create );
}
m_iSelection[ROW_ACTION] = 0;
}
+6 -6
View File
@@ -31,13 +31,13 @@ const CString& EditMenuRowToThemedString( EditMenuRow r );
enum EditMenuAction
{
EDIT_MENU_ACTION_EDIT,
EDIT_MENU_ACTION_DELETE,
EDIT_MENU_ACTION_CREATE,
EDIT_MENU_ACTION_PRACTICE,
NUM_EDIT_MENU_ACTIONS
EditMenuAction_Edit,
EditMenuAction_Delete,
EditMenuAction_Create,
EditMenuAction_Practice,
NUM_EditMenuAction
};
#define FOREACH_EditMenuAction( ema ) FOREACH_ENUM( EditMenuAction, NUM_EDIT_MENU_ACTIONS, ema )
#define FOREACH_EditMenuAction( ema ) FOREACH_ENUM( EditMenuAction, NUM_EditMenuAction, ema )
const CString& EditMenuActionToString( EditMenuAction ema );
const CString& EditMenuActionToThemedString( EditMenuAction ema );
+1 -1
View File
@@ -268,7 +268,7 @@ static const CString MemoryCardStateNames[] = {
"removed",
"none",
};
XToString( MemoryCardState, NUM_MEMORY_CARD_STATES );
XToString( MemoryCardState, NUM_MemoryCardState );
static const CString PerDifficultyAwardNames[] = {
+14 -14
View File
@@ -195,25 +195,25 @@ enum ScoreEvent
//
enum ProfileSlot
{
PROFILE_SLOT_PLAYER_1,
PROFILE_SLOT_PLAYER_2,
PROFILE_SLOT_MACHINE,
NUM_PROFILE_SLOTS,
PROFILE_SLOT_INVALID
ProfileSlot_Player1,
ProfileSlot_Player2,
ProfileSlot_Machine,
NUM_ProfileSlot,
ProfileSlot_INVALID
};
#define FOREACH_ProfileSlot( slot ) FOREACH_ENUM( ProfileSlot, NUM_PROFILE_SLOTS, slot )
#define FOREACH_ProfileSlot( slot ) FOREACH_ENUM( ProfileSlot, NUM_ProfileSlot, slot )
enum MemoryCardState
{
MEMORY_CARD_STATE_READY,
MEMORY_CARD_STATE_CHECKING,
MEMORY_CARD_STATE_TOO_LATE,
MEMORY_CARD_STATE_ERROR,
MEMORY_CARD_STATE_REMOVED,
MEMORY_CARD_STATE_NO_CARD,
NUM_MEMORY_CARD_STATES,
MEMORY_CARD_STATE_INVALID,
MemoryCardState_Ready,
MemoryCardState_Checking,
MemoryCardState_TooLate,
MemoryCardState_Error,
MemoryCardState_Removed,
MemoryCardState_NoCard,
NUM_MemoryCardState,
MemoryCardState_INVALID,
};
const CString& MemoryCardStateToString( MemoryCardState mcs );
+3 -3
View File
@@ -11,14 +11,14 @@ REGISTER_ACTOR_CLASS( MemoryCardDisplay )
MemoryCardDisplay::MemoryCardDisplay()
{
m_PlayerNumber = PLAYER_INVALID;
m_LastSeenState = MEMORY_CARD_STATE_INVALID;
m_LastSeenState = MemoryCardState_INVALID;
}
void MemoryCardDisplay::Load( PlayerNumber pn )
{
m_PlayerNumber = pn;
for( int i=0; i<NUM_MEMORY_CARD_STATES; i++ )
for( int i=0; i<NUM_MemoryCardState; i++ )
{
MemoryCardState mcs = (MemoryCardState)i;
CString sState = MemoryCardStateToString(mcs);
@@ -43,7 +43,7 @@ void MemoryCardDisplay::Update( float fDelta )
MemoryCardState newMcs = MEMCARDMAN->GetCardState(m_PlayerNumber);
if( m_LastSeenState != newMcs )
{
if( m_LastSeenState != MEMORY_CARD_STATE_INVALID )
if( m_LastSeenState != MemoryCardState_INVALID )
m_spr[m_LastSeenState].SetHidden( true );
m_LastSeenState = newMcs;
m_spr[m_LastSeenState].SetHidden( false );
+1 -1
View File
@@ -19,7 +19,7 @@ public:
protected:
PlayerNumber m_PlayerNumber;
MemoryCardState m_LastSeenState;
Sprite m_spr[NUM_MEMORY_CARD_STATES];
Sprite m_spr[NUM_MemoryCardState];
};
#endif
+19 -19
View File
@@ -295,7 +295,7 @@ MemoryCardManager::MemoryCardManager()
FOREACH_PlayerNumber( p )
{
m_bMounted[p] = false;
m_State[p] = MEMORY_CARD_STATE_NO_CARD;
m_State[p] = MemoryCardState_NoCard;
}
/* These can play at any time. Preload them, so we don't cause a skip in gameplay. */
@@ -420,7 +420,7 @@ void MemoryCardManager::CheckStateChanges()
{
UsbStorageDevice &new_device = m_Device[p];
MemoryCardState state = MEMORY_CARD_STATE_INVALID;
MemoryCardState state = MemoryCardState_INVALID;
CString sError;
if( m_bCardsLocked )
@@ -430,21 +430,21 @@ void MemoryCardManager::CheckStateChanges()
/* We didn't have a card when we finalized, so we won't accept anything.
* If anything is inserted (even if it's still checking), say TOO LATE. */
if( new_device.m_State == UsbStorageDevice::STATE_NONE )
state = MEMORY_CARD_STATE_NO_CARD;
state = MemoryCardState_NoCard;
else
state = MEMORY_CARD_STATE_TOO_LATE;
state = MemoryCardState_TooLate;
}
else
{
/* We had a card inserted when we finalized. */
if( new_device.m_State == UsbStorageDevice::STATE_NONE )
state = MEMORY_CARD_STATE_REMOVED;
state = MemoryCardState_Removed;
if( new_device.m_State == UsbStorageDevice::STATE_READY )
{
if( m_FinalDevice[p].sSerial != new_device.sSerial )
{
/* A different card is inserted than we had when we finalized. */
state = MEMORY_CARD_STATE_ERROR;
state = MemoryCardState_Error;
sError = "Changed";
}
}
@@ -453,25 +453,25 @@ void MemoryCardManager::CheckStateChanges()
}
}
if( state == MEMORY_CARD_STATE_INVALID )
if( state == MemoryCardState_INVALID )
{
switch( new_device.m_State )
{
case UsbStorageDevice::STATE_NONE:
state = MEMORY_CARD_STATE_NO_CARD;
state = MemoryCardState_NoCard;
break;
case UsbStorageDevice::STATE_CHECKING:
state = MEMORY_CARD_STATE_CHECKING;
state = MemoryCardState_Checking;
break;
case UsbStorageDevice::STATE_ERROR:
state = MEMORY_CARD_STATE_ERROR;
state = MemoryCardState_Error;
sError = new_device.m_sError;
break;
case UsbStorageDevice::STATE_READY:
state = MEMORY_CARD_STATE_READY;
state = MemoryCardState_Ready;
break;
}
}
@@ -482,21 +482,21 @@ void MemoryCardManager::CheckStateChanges()
// play sound
switch( state )
{
case MEMORY_CARD_STATE_NO_CARD:
case MEMORY_CARD_STATE_REMOVED:
if( LastState == MEMORY_CARD_STATE_READY )
case MemoryCardState_NoCard:
case MemoryCardState_Removed:
if( LastState == MemoryCardState_Ready )
{
m_soundDisconnect.Play();
MESSAGEMAN->Broadcast( (Message)(Message_CardRemovedP1+p) );
}
break;
case MEMORY_CARD_STATE_READY:
case MemoryCardState_Ready:
m_soundReady.Play();
break;
case MEMORY_CARD_STATE_TOO_LATE:
case MemoryCardState_TooLate:
m_soundTooLate.Play();
break;
case MEMORY_CARD_STATE_ERROR:
case MemoryCardState_Error:
m_soundError.Play();
break;
}
@@ -579,7 +579,7 @@ void MemoryCardManager::UnlockCards()
bool MemoryCardManager::MountCard( PlayerNumber pn, int iTimeout )
{
LOG->Trace( "MemoryCardManager::MountCard(%i)", pn );
if( GetCardState(pn) != MEMORY_CARD_STATE_READY )
if( GetCardState(pn) != MemoryCardState_Ready )
return false;
ASSERT( !m_Device[pn].IsBlank() );
@@ -724,7 +724,7 @@ bool IsAnyPlayerUsingMemoryCard()
{
FOREACH_HumanPlayer( pn )
{
if( MEMCARDMAN->GetCardState(pn) == MEMORY_CARD_STATE_READY )
if( MEMCARDMAN->GetCardState(pn) == MemoryCardState_Ready )
return true;
}
return false;
+1 -1
View File
@@ -63,7 +63,7 @@ protected:
UsbStorageDevice m_FinalDevice[NUM_PLAYERS]; // device in the memory card slot when we finalized, blank if none
MemoryCardState m_State[NUM_PLAYERS];
CString m_sError[NUM_PLAYERS]; // if MEMORY_CARD_STATE_ERROR
CString m_sError[NUM_PLAYERS]; // if MemoryCardState_Error
RageSound m_soundReady;
RageSound m_soundError;
+1 -1
View File
@@ -290,7 +290,7 @@ void MusicWheelItem::RefreshGrades()
if( PROFILEMAN->IsPersistentProfile(p) )
PROFILEMAN->GetHighScoreForDifficulty( data->m_pSong, GAMESTATE->GetCurrentStyle(), (ProfileSlot)p, dc, hs );
else
PROFILEMAN->GetHighScoreForDifficulty( data->m_pSong, GAMESTATE->GetCurrentStyle(), PROFILE_SLOT_MACHINE, dc, hs );
PROFILEMAN->GetHighScoreForDifficulty( data->m_pSong, GAMESTATE->GetCurrentStyle(), ProfileSlot_Machine, dc, hs );
m_pGradeDisplay[p]->SetGrade( p, hs.GetGrade() );
}
+15 -15
View File
@@ -203,7 +203,7 @@ bool ProfileManager::LoadProfileFromMemoryCard( PlayerNumber pn )
UnloadProfile( pn );
// mount slot
if( MEMCARDMAN->GetCardState(pn) != MEMORY_CARD_STATE_READY )
if( MEMCARDMAN->GetCardState(pn) != MemoryCardState_Ready )
return false;
vector<CString> asDirsToTry;
@@ -521,8 +521,8 @@ void ProfileManager::LoadMachineProfile()
// If the machine name has changed, make sure we use the new name
m_pMachineProfile->m_sDisplayName = PREFSMAN->m_sMachineName;
SONGMAN->FreeAllLoadedFromProfile( PROFILE_SLOT_MACHINE );
SONGMAN->LoadAllFromProfileDir( MACHINE_PROFILE_DIR, PROFILE_SLOT_MACHINE );
SONGMAN->FreeAllLoadedFromProfile( ProfileSlot_Machine );
SONGMAN->LoadAllFromProfileDir( MACHINE_PROFILE_DIR, ProfileSlot_Machine );
}
bool ProfileManager::ProfileWasLoadedFromMemoryCard( PlayerNumber pn ) const
@@ -544,10 +544,10 @@ CString ProfileManager::GetProfileDir( ProfileSlot slot ) const
{
switch( slot )
{
case PROFILE_SLOT_PLAYER_1:
case PROFILE_SLOT_PLAYER_2:
case ProfileSlot_Player1:
case ProfileSlot_Player2:
return m_sProfileDir[slot];
case PROFILE_SLOT_MACHINE:
case ProfileSlot_Machine:
return MACHINE_PROFILE_DIR;
default:
ASSERT(0);
@@ -558,10 +558,10 @@ CString ProfileManager::GetProfileDirImportedFrom( ProfileSlot slot ) const
{
switch( slot )
{
case PROFILE_SLOT_PLAYER_1:
case PROFILE_SLOT_PLAYER_2:
case ProfileSlot_Player1:
case ProfileSlot_Player2:
return m_sProfileDirImportedFrom[slot];
case PROFILE_SLOT_MACHINE:
case ProfileSlot_Machine:
return NULL;
default:
ASSERT(0);
@@ -572,10 +572,10 @@ const Profile* ProfileManager::GetProfile( ProfileSlot slot ) const
{
switch( slot )
{
case PROFILE_SLOT_PLAYER_1:
case PROFILE_SLOT_PLAYER_2:
case ProfileSlot_Player1:
case ProfileSlot_Player2:
return GetProfile( (PlayerNumber)slot );
case PROFILE_SLOT_MACHINE:
case ProfileSlot_Machine:
return m_pMachineProfile;
default:
ASSERT(0);
@@ -749,10 +749,10 @@ bool ProfileManager::IsPersistentProfile( ProfileSlot slot ) const
{
switch( slot )
{
case PROFILE_SLOT_PLAYER_1:
case PROFILE_SLOT_PLAYER_2:
case ProfileSlot_Player1:
case ProfileSlot_Player2:
return GAMESTATE->IsHumanPlayer((PlayerNumber)slot) && !m_sProfileDir[slot].empty();
case PROFILE_SLOT_MACHINE:
case ProfileSlot_Machine:
return true;
default:
ASSERT(0);
+1 -1
View File
@@ -91,7 +91,7 @@ public:
// Song stats
//
int GetSongNumTimesPlayed( const Song* pSong, ProfileSlot card ) const;
bool IsSongNew( const Song* pSong ) const { return GetSongNumTimesPlayed(pSong,PROFILE_SLOT_MACHINE)==0; }
bool IsSongNew( const Song* pSong ) const { return GetSongNumTimesPlayed(pSong,ProfileSlot_Machine)==0; }
void AddStepsScore( const Song* pSong, const Steps* pSteps , PlayerNumber pn, const HighScore &hs, int &iPersonalIndexOut, int &iMachineIndexOut );
void IncrementStepsPlayCount( const Song* pSong, const Steps* pSteps, PlayerNumber pn );
void GetHighScoreForDifficulty( const Song *s, const Style *st, ProfileSlot slot, Difficulty dc, HighScore &hsOut ) const;
+9 -9
View File
@@ -212,14 +212,14 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
//
switch( action )
{
case EDIT_MENU_ACTION_EDIT:
case EDIT_MENU_ACTION_PRACTICE:
case EditMenuAction_Edit:
case EditMenuAction_Practice:
break;
case EDIT_MENU_ACTION_DELETE:
case EditMenuAction_Delete:
ASSERT( pSteps );
ScreenPrompt::Prompt( SM_None, "These steps will be lost permanently.\n\nContinue with delete?", PROMPT_YES_NO, ANSWER_NO );
break;
case EDIT_MENU_ACTION_CREATE:
case EditMenuAction_Create:
ASSERT( !pSteps );
{
// Yuck. Doing the memory allocation doesn't seem right since
@@ -259,13 +259,13 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
//
switch( action )
{
case EDIT_MENU_ACTION_EDIT:
case EDIT_MENU_ACTION_CREATE:
case EDIT_MENU_ACTION_PRACTICE:
case EditMenuAction_Edit:
case EditMenuAction_Create:
case EditMenuAction_Practice:
{
// Prepare prepare for ScreenEdit
ASSERT( pSteps );
bool bPromptToNameSteps = (action == EDIT_MENU_ACTION_CREATE && dc == DIFFICULTY_EDIT);
bool bPromptToNameSteps = (action == EditMenuAction_Create && dc == DIFFICULTY_EDIT);
if( bPromptToNameSteps )
{
ScreenTextEntry::TextEntry(
@@ -285,7 +285,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
}
}
break;
case EDIT_MENU_ACTION_DELETE:
case EditMenuAction_Delete:
break;
default:
ASSERT(0);
+2 -2
View File
@@ -219,8 +219,8 @@ void ScreenEnding::Init()
m_sprRemoveMemoryCard[p].Load( THEME->GetPathG("ScreenEnding",ssprintf("remove card P%d",p+1)) );
switch( MEMCARDMAN->GetCardState(p) )
{
case MEMORY_CARD_STATE_REMOVED:
case MEMORY_CARD_STATE_NO_CARD:
case MemoryCardState_Removed:
case MemoryCardState_NoCard:
m_sprRemoveMemoryCard[p].SetHidden( true );
break;
}
+2 -2
View File
@@ -263,7 +263,7 @@ void ScreenOptionsManageCourses::HandleScreenMessage( const ScreenMessage SM )
// create
Course *pCourse = new Course;
pCourse->m_sMainTitle = ScreenTextEntry::s_sLastAnswer;
pCourse->SetLoadedFromProfile( PROFILE_SLOT_MACHINE );
pCourse->SetLoadedFromProfile( ProfileSlot_Machine );
CourseEntry ce;
CourseUtil::MakeDefaultEditCourseEntry( ce );
pCourse->m_vEntries.push_back( ce );
@@ -349,7 +349,7 @@ void ScreenOptionsManageCourses::ProcessMenuStart( const InputEventPlus &input )
if( iCurRow == 0 ) // "create new"
{
if( SONGMAN->GetNumEditCourses(PROFILE_SLOT_MACHINE) >= MAX_EDIT_COURSES_PER_PROFILE )
if( SONGMAN->GetNumEditCourses(ProfileSlot_Machine) >= MAX_EDIT_COURSES_PER_PROFILE )
{
CString s = ssprintf(
"You have %d course edits, the maximum number allowed.\n\n"
+16 -4
View File
@@ -43,7 +43,7 @@ static bool ValidateEditStepsName( const CString &sAnswer, CString &sErrorOut )
// Steps name must be unique
vector<Steps*> v;
SONGMAN->GetStepsLoadedFromProfile( v, PROFILE_SLOT_MACHINE );
SONGMAN->GetStepsLoadedFromProfile( v, ProfileSlot_Machine );
FOREACH_CONST( Steps*, v, s )
{
if( GAMESTATE->m_pCurSteps[PLAYER_1].Get() == *s )
@@ -90,7 +90,7 @@ void ScreenOptionsManageEditSteps::BeginScreen()
iIndex++;
}
SONGMAN->GetStepsLoadedFromProfile( m_vpSteps, PROFILE_SLOT_MACHINE );
SONGMAN->GetStepsLoadedFromProfile( m_vpSteps, ProfileSlot_Machine );
FOREACH_CONST( Steps*, m_vpSteps, s )
{
@@ -138,11 +138,22 @@ void ScreenOptionsManageEditSteps::HandleScreenMessage( const ScreenMessage SM )
else if( SM == SM_GoToNextScreen )
{
int iCurRow = m_iCurrentRow[PLAYER_1];
if( iCurRow == (int)m_pRows.size() - 1 )
if( iCurRow == 0 ) // "create new"
{
SCREENMAN->SetNewScreen( "ScreenEditMenuNew" );
return; // don't call base
}
else if( iCurRow == (int)m_pRows.size()-1 ) // "done"
{
this->HandleScreenMessage( SM_GoToPrevScreen );
return; // don't call base
}
else // a Steps
{
SCREENMAN->SetNewScreen( "ScreenEdit" );
return; // don't call base
}
}
else if( SM == SM_BackFromRename )
{
@@ -219,7 +230,7 @@ void ScreenOptionsManageEditSteps::ProcessMenuStart( const InputEventPlus &input
if( iCurRow == 0 ) // "create new"
{
vector<Steps*> v;
SONGMAN->GetStepsLoadedFromProfile( v, PROFILE_SLOT_MACHINE );
SONGMAN->GetStepsLoadedFromProfile( v, ProfileSlot_Machine );
if( v.size() >= MAX_EDIT_STEPS_PER_PROFILE )
{
CString s = ssprintf(
@@ -229,6 +240,7 @@ void ScreenOptionsManageEditSteps::ProcessMenuStart( const InputEventPlus &input
ScreenPrompt::Prompt( SM_None, s );
return;
}
this->BeginFadingOut();
}
else if( iCurRow == (int)m_pRows.size()-1 ) // "done"
{
+2 -2
View File
@@ -1530,7 +1530,7 @@ void ScreenSelectMusic::AfterMusicChange()
g_sCDTitlePath = pSong->GetCDTitlePath();
g_bWantFallbackCdTitle = true;
const vector<Song*> best = SONGMAN->GetBestSongs( PROFILE_SLOT_MACHINE );
const vector<Song*> best = SONGMAN->GetBestSongs( ProfileSlot_Machine );
const int index = FindIndex( best.begin(), best.end(), pSong );
if( index != -1 )
m_MachineRank.SetText( FormatNumberAndSuffix( index+1 ) );
@@ -1663,7 +1663,7 @@ void ScreenSelectMusic::AfterMusicChange()
}
CourseType ct = PlayModeToCourseType( GAMESTATE->m_PlayMode );
const vector<Course*> best = SONGMAN->GetBestCourses( ct, PROFILE_SLOT_MACHINE );
const vector<Course*> best = SONGMAN->GetBestCourses( ct, ProfileSlot_Machine );
const int index = FindCourseIndexOfSameMode( best.begin(), best.end(), pCourse );
if( index != -1 )
m_MachineRank.SetText( FormatNumberAndSuffix( index+1 ) );
+11 -11
View File
@@ -38,8 +38,8 @@ static CString ClearMachineEdits()
int iNumSuccessful = 0;
vector<CString> vsEditFiles;
GetDirListing( PROFILEMAN->GetProfileDir(PROFILE_SLOT_MACHINE)+EDIT_STEPS_SUBDIR+"*.edit", vsEditFiles, false, true );
GetDirListing( PROFILEMAN->GetProfileDir(PROFILE_SLOT_MACHINE)+EDIT_COURSES_SUBDIR+"*.crs", vsEditFiles, false, true );
GetDirListing( PROFILEMAN->GetProfileDir(ProfileSlot_Machine)+EDIT_STEPS_SUBDIR+"*.edit", vsEditFiles, false, true );
GetDirListing( PROFILEMAN->GetProfileDir(ProfileSlot_Machine)+EDIT_COURSES_SUBDIR+"*.crs", vsEditFiles, false, true );
FOREACH_CONST( CString, vsEditFiles, i )
{
iNumAttempted++;
@@ -63,7 +63,7 @@ static CString ClearMemoryCardEdits()
bool bTriedToLoad = false;
FOREACH_PlayerNumber( pn )
{
if( MEMCARDMAN->GetCardState(pn) != MEMORY_CARD_STATE_READY )
if( MEMCARDMAN->GetCardState(pn) != MemoryCardState_Ready )
continue; // skip
if( !MEMCARDMAN->IsMounted(pn) )
@@ -181,7 +181,7 @@ static CString TransferStatsMachineToMemoryCard()
bool bTriedToSave = false;
FOREACH_PlayerNumber( pn )
{
if( MEMCARDMAN->GetCardState(pn) != MEMORY_CARD_STATE_READY )
if( MEMCARDMAN->GetCardState(pn) != MemoryCardState_Ready )
continue; // skip
if( !MEMCARDMAN->IsMounted(pn) )
@@ -216,7 +216,7 @@ static CString TransferStatsMemoryCardToMachine()
bool bTriedToLoad = false;
FOREACH_PlayerNumber( pn )
{
if( MEMCARDMAN->GetCardState(pn) != MEMORY_CARD_STATE_READY )
if( MEMCARDMAN->GetCardState(pn) != MemoryCardState_Ready )
continue; // skip
if( !MEMCARDMAN->IsMounted(pn) )
@@ -264,7 +264,7 @@ static CString CopyEditsMachineToMemoryCard()
bool bTriedToCopy = false;
FOREACH_PlayerNumber( pn )
{
if( MEMCARDMAN->GetCardState(pn) != MEMORY_CARD_STATE_READY )
if( MEMCARDMAN->GetCardState(pn) != MemoryCardState_Ready )
continue; // skip
if( !MEMCARDMAN->IsMounted(pn) )
@@ -277,7 +277,7 @@ static CString CopyEditsMachineToMemoryCard()
int iNumOverwritten = 0;
{
CString sFromDir = PROFILEMAN->GetProfileDir(PROFILE_SLOT_MACHINE) + EDIT_STEPS_SUBDIR;
CString sFromDir = PROFILEMAN->GetProfileDir(ProfileSlot_Machine) + EDIT_STEPS_SUBDIR;
CString sToDir = MEM_CARD_MOUNT_POINT[pn] + (CString)PREFSMAN->m_sMemoryCardProfileSubdir + "/" + EDIT_STEPS_SUBDIR;
vector<CString> vsFiles;
@@ -294,7 +294,7 @@ static CString CopyEditsMachineToMemoryCard()
}
{
CString sFromDir = PROFILEMAN->GetProfileDir(PROFILE_SLOT_MACHINE) + EDIT_COURSES_SUBDIR;
CString sFromDir = PROFILEMAN->GetProfileDir(ProfileSlot_Machine) + EDIT_COURSES_SUBDIR;
CString sToDir = MEM_CARD_MOUNT_POINT[pn] + (CString)PREFSMAN->m_sMemoryCardProfileSubdir + "/" + EDIT_COURSES_SUBDIR;
vector<CString> vsFiles;
@@ -329,7 +329,7 @@ static CString CopyEditsMemoryCardToMachine()
bool bTriedToCopy = false;
FOREACH_PlayerNumber( pn )
{
if( MEMCARDMAN->GetCardState(pn) != MEMORY_CARD_STATE_READY )
if( MEMCARDMAN->GetCardState(pn) != MemoryCardState_Ready )
continue; // skip
if( !MEMCARDMAN->IsMounted(pn) )
@@ -343,7 +343,7 @@ static CString CopyEditsMemoryCardToMachine()
{
CString sFromDir = MEM_CARD_MOUNT_POINT[pn] + (CString)PREFSMAN->m_sMemoryCardProfileSubdir + "/" + EDIT_STEPS_SUBDIR;
CString sToDir = PROFILEMAN->GetProfileDir(PROFILE_SLOT_MACHINE) + EDIT_STEPS_SUBDIR;
CString sToDir = PROFILEMAN->GetProfileDir(ProfileSlot_Machine) + EDIT_STEPS_SUBDIR;
vector<CString> vsFiles;
GetDirListing( sFromDir+"*.edit", vsFiles, false, false );
@@ -360,7 +360,7 @@ static CString CopyEditsMemoryCardToMachine()
{
CString sFromDir = MEM_CARD_MOUNT_POINT[pn] + (CString)PREFSMAN->m_sMemoryCardProfileSubdir + "/" + EDIT_COURSES_SUBDIR;
CString sToDir = PROFILEMAN->GetProfileDir(PROFILE_SLOT_MACHINE) + EDIT_COURSES_SUBDIR;
CString sToDir = PROFILEMAN->GetProfileDir(ProfileSlot_Machine) + EDIT_COURSES_SUBDIR;
vector<CString> vsFiles;
GetDirListing( sFromDir+"*.crs", vsFiles, false, false );
+6 -6
View File
@@ -107,7 +107,7 @@ CString ScreenSystemLayer::GetCreditsMessage( PlayerNumber pn ) const
const Profile* pProfile = PROFILEMAN->GetProfile( pn );
switch( mcs )
{
case MEMORY_CARD_STATE_NO_CARD:
case MemoryCardState_NoCard:
// this is a local machine profile
if( PROFILEMAN->LastLoadWasFromLastGood(pn) )
return pProfile->GetDisplayNameOrHighScoreName() + CREDITS_LOADED_FROM_LAST_GOOD_APPEND.GetValue();
@@ -121,11 +121,11 @@ CString ScreenSystemLayer::GetCreditsMessage( PlayerNumber pn ) const
else
return CString();
case MEMORY_CARD_STATE_ERROR: return THEME->GetMetric( m_sName, "CreditsCard" + MEMCARDMAN->GetCardError(pn) );
case MEMORY_CARD_STATE_TOO_LATE: return CREDITS_CARD_TOO_LATE.GetValue();
case MEMORY_CARD_STATE_CHECKING: return CREDITS_CARD_CHECKING.GetValue();
case MEMORY_CARD_STATE_REMOVED: return CREDITS_CARD_REMOVED.GetValue();
case MEMORY_CARD_STATE_READY:
case MemoryCardState_Error: return THEME->GetMetric( m_sName, "CreditsCard" + MEMCARDMAN->GetCardError(pn) );
case MemoryCardState_TooLate: return CREDITS_CARD_TOO_LATE.GetValue();
case MemoryCardState_Checking: return CREDITS_CARD_CHECKING.GetValue();
case MemoryCardState_Removed: return CREDITS_CARD_REMOVED.GetValue();
case MemoryCardState_Ready:
{
// If the profile failed to load and there was no usable backup...
if( PROFILEMAN->LastLoadWasTamperedOrCorrupt(pn) && !PROFILEMAN->LastLoadWasFromLastGood(pn) )
+2 -2
View File
@@ -53,7 +53,7 @@ Song::Song()
m_ForegroundChanges = AutoPtrCopyOnWrite<VBackgroundChange>(new VBackgroundChange);
m_LoadedFromProfile = PROFILE_SLOT_INVALID;
m_LoadedFromProfile = ProfileSlot_INVALID;
m_fMusicSampleStartSeconds = -1;
m_fMusicSampleLengthSeconds = DEFAULT_MUSIC_SAMPLE_LENGTH;
m_fMusicLengthSeconds = 0;
@@ -1414,7 +1414,7 @@ void Song::FreeAllLoadedFromProfile( ProfileSlot slot )
Steps* pSteps = m_vpSteps[s];
if( !pSteps->WasLoadedFromProfile() )
continue;
if( slot == PROFILE_SLOT_INVALID || pSteps->GetLoadedFromProfileSlot() == slot )
if( slot == ProfileSlot_INVALID || pSteps->GetLoadedFromProfileSlot() == slot )
apToRemove.push_back( pSteps );
}
+5 -5
View File
@@ -303,7 +303,7 @@ void SongManager::FreeSongs()
m_sSongGroupBannerPaths.clear();
for( int i = 0; i < NUM_PROFILE_SLOTS; ++i )
for( int i = 0; i < NUM_ProfileSlot; ++i )
m_pBestSongs[i].clear();
m_pShuffledSongs.clear();
}
@@ -644,7 +644,7 @@ void SongManager::FreeCourses()
delete m_pCourses[i];
m_pCourses.clear();
for( int i = 0; i < NUM_PROFILE_SLOTS; ++i )
for( int i = 0; i < NUM_ProfileSlot; ++i )
FOREACH_CourseType( ct )
m_pBestCourses[i][ct].clear();
m_pShuffledCourses.clear();
@@ -1371,10 +1371,10 @@ void SongManager::FreeAllLoadedFromProfile( ProfileSlot slot )
FOREACH( Course*, m_pCourses, c )
{
Course *pCourse = *c;
if( pCourse->GetLoadedFromProfileSlot() == PROFILE_SLOT_INVALID )
if( pCourse->GetLoadedFromProfileSlot() == ProfileSlot_INVALID )
continue;
if( slot == PROFILE_SLOT_INVALID || pCourse->GetLoadedFromProfileSlot() == slot )
if( slot == ProfileSlot_INVALID || pCourse->GetLoadedFromProfileSlot() == slot )
apToDelete.push_back( *c );
}
@@ -1395,7 +1395,7 @@ int SongManager::GetNumStepsLoadedFromProfile()
FOREACH( Steps*, vpAllSteps, ss )
{
if( (*ss)->GetLoadedFromProfileSlot() != PROFILE_SLOT_INVALID )
if( (*ss)->GetLoadedFromProfileSlot() != ProfileSlot_INVALID )
iCount++;
}
}
+6 -6
View File
@@ -41,7 +41,7 @@ public:
void LoadAllFromProfileDir( const CString &sProfileDir, ProfileSlot slot );
int GetNumStepsLoadedFromProfile();
void FreeAllLoadedFromProfile( ProfileSlot slot = PROFILE_SLOT_INVALID );
void FreeAllLoadedFromProfile( ProfileSlot slot = ProfileSlot_INVALID );
void LoadGroupSymLinks( CString sDir, CString sGroupFolder );
@@ -74,9 +74,9 @@ public:
// Lookup
const vector<Song*> &GetAllSongs() const { return m_pSongs; }
void GetBestSongs( vector<Song*> &AddTo, CString sGroupName, int iMaxStages = INT_MAX, ProfileSlot slot=PROFILE_SLOT_MACHINE ) const;
const vector<Song*> &GetBestSongs( ProfileSlot slot=PROFILE_SLOT_MACHINE ) const { return m_pBestSongs[slot]; }
const vector<Course*> &GetBestCourses( CourseType ct, ProfileSlot slot=PROFILE_SLOT_MACHINE ) const { return m_pBestCourses[slot][ct]; }
void GetBestSongs( vector<Song*> &AddTo, CString sGroupName, int iMaxStages = INT_MAX, ProfileSlot slot=ProfileSlot_Machine ) const;
const vector<Song*> &GetBestSongs( ProfileSlot slot=ProfileSlot_Machine ) const { return m_pBestSongs[slot]; }
const vector<Course*> &GetBestCourses( CourseType ct, ProfileSlot slot=ProfileSlot_Machine ) const { return m_pBestCourses[slot][ct]; }
void GetSongs( vector<Song*> &AddTo, CString sGroupName, int iMaxStages = INT_MAX ) const;
void GetSongs( vector<Song*> &AddTo, int iMaxStages ) const { GetSongs(AddTo,GROUP_ALL,iMaxStages); }
void GetSongs( vector<Song*> &AddTo ) const { GetSongs(AddTo,GROUP_ALL,INT_MAX); }
@@ -127,13 +127,13 @@ protected:
Song *FindSong( CString sGroup, CString sSong );
vector<Song*> m_pSongs; // all songs that can be played
vector<Song*> m_pBestSongs[NUM_PROFILE_SLOTS];
vector<Song*> m_pBestSongs[NUM_ProfileSlot];
vector<Song*> m_pShuffledSongs; // used by GetRandomSong
CStringArray m_sSongGroupNames;
CStringArray m_sSongGroupBannerPaths; // each song group may have a banner associated with it
vector<Course*> m_pCourses;
vector<Course*> m_pBestCourses[NUM_PROFILE_SLOTS][NUM_CourseType];
vector<Course*> m_pBestCourses[NUM_ProfileSlot][NUM_CourseType];
vector<Course*> m_pShuffledCourses; // used by GetRandomCourse
struct CourseGroupInfo
{
+1 -1
View File
@@ -29,7 +29,7 @@ Steps::Steps()
{
m_bSavedToDisk = false;
m_StepsType = STEPS_TYPE_INVALID;
m_LoadedFromProfile = PROFILE_SLOT_INVALID;
m_LoadedFromProfile = ProfileSlot_INVALID;
m_uHash = 0;
m_Difficulty = DIFFICULTY_INVALID;
m_iMeter = 0;
+3 -3
View File
@@ -32,8 +32,8 @@ public:
// Use a special value of difficulty
bool IsAnEdit() const { return m_Difficulty == DIFFICULTY_EDIT; }
bool IsAPlayerEdit() const { return m_Difficulty == DIFFICULTY_EDIT && GetLoadedFromProfileSlot() < PROFILE_SLOT_MACHINE; }
bool WasLoadedFromProfile() const { return m_LoadedFromProfile != PROFILE_SLOT_INVALID; }
bool IsAPlayerEdit() const { return m_Difficulty == DIFFICULTY_EDIT && GetLoadedFromProfileSlot() < ProfileSlot_Machine; }
bool WasLoadedFromProfile() const { return m_LoadedFromProfile != ProfileSlot_INVALID; }
ProfileSlot GetLoadedFromProfileSlot() const { return m_LoadedFromProfile; }
unsigned GetHash() const { return Real()->m_uHash; }
CString GetDescription() const { return Real()->m_sDescription; }
@@ -86,7 +86,7 @@ protected:
bool m_bSavedToDisk; // true if this was loaded from disk or has been saved to disk.
/* These values are pulled from the autogen source first, if there is one. */
ProfileSlot m_LoadedFromProfile; // PROFILE_SLOT_INVALID if wasn't loaded from a profile
ProfileSlot m_LoadedFromProfile; // ProfileSlot_INVALID if wasn't loaded from a profile
unsigned m_uHash; // only used if m_Difficulty == DIFFICULTY_EDIT
CString m_sDescription; // Step author, edit name, or something meaningful
Difficulty m_Difficulty; // difficulty classification
+4 -4
View File
@@ -19,7 +19,7 @@ struct lua_State;
struct BackgroundChange;
const int MAX_EDITS_PER_SONG_PER_PROFILE = 5;
const int MAX_EDITS_PER_SONG = 5*NUM_PROFILE_SLOTS;
const int MAX_EDITS_PER_SONG = 5*NUM_ProfileSlot;
extern const int FILE_CACHE_VERSION;
@@ -88,7 +88,7 @@ public:
CString m_sGroupName;
ProfileSlot m_LoadedFromProfile; // PROFILE_SLOT_INVALID if wasn't loaded from a profile
ProfileSlot m_LoadedFromProfile; // ProfileSlot_INVALID if wasn't loaded from a profile
bool m_bIsSymLink;
CString m_sMainTitle, m_sSubTitle, m_sArtist;
@@ -222,8 +222,8 @@ public:
void AddSteps( Steps* pSteps ); // we are responsible for deleting the memory pointed to by pSteps!
void DeleteSteps( const Steps* pSteps );
void FreeAllLoadedFromProfile( ProfileSlot slot = PROFILE_SLOT_INVALID );
bool WasLoadedFromProfile() const { return m_LoadedFromProfile != PROFILE_SLOT_INVALID; }
void FreeAllLoadedFromProfile( ProfileSlot slot = ProfileSlot_INVALID );
bool WasLoadedFromProfile() const { return m_LoadedFromProfile != ProfileSlot_INVALID; }
void GetStepsLoadedFromProfile( ProfileSlot slot, vector<Steps*> &vpStepsOut ) const;
int GetNumStepsLoadedFromProfile( ProfileSlot slot ) const;
bool IsEditAlreadyLoaded( Steps* pSteps ) const;