rename: IsUsingProfile -> IsPersistentProfile

Don't require IsPersistentProfile in some places related to fitness mode where a non-persistent Profile will suffice
This commit is contained in:
Chris Danford
2005-05-09 08:44:01 +00:00
parent e822ee71ce
commit fb1d69add3
16 changed files with 53 additions and 58 deletions
+1 -1
View File
@@ -167,7 +167,7 @@ void CourseUtil::SortCoursePointerArrayByAvgDifficulty( vector<Course*> &vpCours
void CourseUtil::SortCoursePointerArrayByNumPlays( vector<Course*> &vpCoursesInOut, ProfileSlot slot, bool bDescending ) void CourseUtil::SortCoursePointerArrayByNumPlays( vector<Course*> &vpCoursesInOut, ProfileSlot slot, bool bDescending )
{ {
if( !PROFILEMAN->IsUsingProfile(slot) ) if( !PROFILEMAN->IsPersistentProfile(slot) )
return; // nothing to do since we don't have data return; // nothing to do since we don't have data
Profile* pProfile = PROFILEMAN->GetProfile(slot); Profile* pProfile = PROFILEMAN->GetProfile(slot);
SortCoursePointerArrayByNumPlays( vpCoursesInOut, pProfile, bDescending ); SortCoursePointerArrayByNumPlays( vpCoursesInOut, pProfile, bDescending );
+3 -6
View File
@@ -130,11 +130,11 @@ bool GameCommand::DescribesCurrentMode( PlayerNumber pn ) const
return false; return false;
if( m_SortOrder != SORT_INVALID && GAMESTATE->m_PreferredSortOrder != m_SortOrder ) if( m_SortOrder != SORT_INVALID && GAMESTATE->m_PreferredSortOrder != m_SortOrder )
return false; return false;
if( m_iWeightPounds != -1 && PROFILEMAN->IsUsingProfile(pn) && PROFILEMAN->GetProfile(pn)->m_iWeightPounds != m_iWeightPounds ) if( m_iWeightPounds != -1 && PROFILEMAN->GetProfile(pn)->m_iWeightPounds != m_iWeightPounds )
return false; return false;
if( m_iGoalCalories != -1 && PROFILEMAN->IsUsingProfile(pn) && PROFILEMAN->GetProfile(pn)->m_iGoalCalories != m_iGoalCalories ) if( m_iGoalCalories != -1 && PROFILEMAN->GetProfile(pn)->m_iGoalCalories != m_iGoalCalories )
return false; return false;
if( m_GoalType != GOAL_INVALID && PROFILEMAN->IsUsingProfile(pn) && PROFILEMAN->GetProfile(pn)->m_GoalType != m_GoalType ) if( m_GoalType != GOAL_INVALID && PROFILEMAN->GetProfile(pn)->m_GoalType != m_GoalType )
return false; return false;
return true; return true;
@@ -768,15 +768,12 @@ void GameCommand::ApplySelf( const vector<PlayerNumber> &vpns ) const
SOUND->PlayOnce( THEME->GetPathToS( m_sSoundPath ) ); SOUND->PlayOnce( THEME->GetPathToS( m_sSoundPath ) );
if( m_iWeightPounds != -1 ) if( m_iWeightPounds != -1 )
FOREACH_CONST( PlayerNumber, vpns, pn ) FOREACH_CONST( PlayerNumber, vpns, pn )
if( PROFILEMAN->IsUsingProfile(*pn) )
PROFILEMAN->GetProfile(*pn)->m_iWeightPounds = m_iWeightPounds; PROFILEMAN->GetProfile(*pn)->m_iWeightPounds = m_iWeightPounds;
if( m_iGoalCalories != -1 ) if( m_iGoalCalories != -1 )
FOREACH_CONST( PlayerNumber, vpns, pn ) FOREACH_CONST( PlayerNumber, vpns, pn )
if( PROFILEMAN->IsUsingProfile(*pn) )
PROFILEMAN->GetProfile(*pn)->m_iGoalCalories = m_iGoalCalories; PROFILEMAN->GetProfile(*pn)->m_iGoalCalories = m_iGoalCalories;
if( m_GoalType != GOAL_INVALID ) if( m_GoalType != GOAL_INVALID )
FOREACH_CONST( PlayerNumber, vpns, pn ) FOREACH_CONST( PlayerNumber, vpns, pn )
if( PROFILEMAN->IsUsingProfile(*pn) )
PROFILEMAN->GetProfile(*pn)->m_GoalType = m_GoalType; PROFILEMAN->GetProfile(*pn)->m_GoalType = m_GoalType;
/* If we're going to stop music, do so before preparing new screens, so we don't /* If we're going to stop music, do so before preparing new screens, so we don't
+5 -7
View File
@@ -311,7 +311,7 @@ void GameState::PlayersFinalized()
MEMCARDMAN->UnmountCard( pn ); MEMCARDMAN->UnmountCard( pn );
if( !PROFILEMAN->IsUsingProfile(pn) ) if( !PROFILEMAN->IsPersistentProfile(pn) )
continue; // skip continue; // skip
Profile* pProfile = PROFILEMAN->GetProfile(pn); Profile* pProfile = PROFILEMAN->GetProfile(pn);
@@ -380,7 +380,7 @@ void GameState::EndGame()
FOREACH_HumanPlayer( pn ) FOREACH_HumanPlayer( pn )
{ {
if( !PROFILEMAN->IsUsingProfile(pn) ) if( !PROFILEMAN->IsPersistentProfile(pn) )
continue; continue;
bool bWasMemoryCard = PROFILEMAN->ProfileWasLoadedFromMemoryCard(pn); bool bWasMemoryCard = PROFILEMAN->ProfileWasLoadedFromMemoryCard(pn);
@@ -502,7 +502,7 @@ void GameState::FinishStage()
void GameState::SaveCurrentSettingsToProfile( PlayerNumber pn ) void GameState::SaveCurrentSettingsToProfile( PlayerNumber pn )
{ {
if( !PROFILEMAN->IsUsingProfile(pn) ) if( !PROFILEMAN->IsPersistentProfile(pn) )
return; return;
if( m_bDemonstrationOrJukebox ) if( m_bDemonstrationOrJukebox )
return; return;
@@ -1563,7 +1563,7 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector<RankingFeat> &asFeatsOu
} }
// Find Personal Records // Find Personal Records
if( PROFILEMAN->IsUsingProfile( pn ) ) if( PROFILEMAN->IsPersistentProfile( pn ) )
{ {
HighScoreList &hsl = pProf->GetCourseHighScoreList( pCourse, pTrail ); HighScoreList &hsl = pProf->GetCourseHighScoreList( pCourse, pTrail );
for( unsigned i=0; i<hsl.vHighScores.size(); i++ ) for( unsigned i=0; i<hsl.vHighScores.size(); i++ )
@@ -1865,8 +1865,6 @@ bool GameState::IsPlayerDead( PlayerNumber pn ) const
float GameState::GetGoalPercentComplete( PlayerNumber pn ) float GameState::GetGoalPercentComplete( PlayerNumber pn )
{ {
if( !PROFILEMAN->IsUsingProfile(pn) )
return 0;
const Profile *pProfile = PROFILEMAN->GetProfile(pn); const Profile *pProfile = PROFILEMAN->GetProfile(pn);
const StageStats &ssAccum = STATSMAN->GetAccumStageStats(); const StageStats &ssAccum = STATSMAN->GetAccumStageStats();
const StageStats &ssCurrent = STATSMAN->m_CurStageStats; const StageStats &ssCurrent = STATSMAN->m_CurStageStats;
@@ -2083,7 +2081,7 @@ LUA_REGISTER_CLASS( GameState )
#include "LuaFunctions.h" #include "LuaFunctions.h"
LuaFunction_PlayerNumber( IsPlayerEnabled, GAMESTATE->IsPlayerEnabled(pn) ) LuaFunction_PlayerNumber( IsPlayerEnabled, GAMESTATE->IsPlayerEnabled(pn) )
LuaFunction_PlayerNumber( IsHumanPlayer, GAMESTATE->IsHumanPlayer(pn) ) LuaFunction_PlayerNumber( IsHumanPlayer, GAMESTATE->IsHumanPlayer(pn) )
LuaFunction_PlayerNumber( IsPlayerUsingProfile, PROFILEMAN->IsUsingProfile(pn) ) LuaFunction_PlayerNumber( IsPlayerUsingProfile, PROFILEMAN->IsPersistentProfile(pn) )
LuaFunction_PlayerNumber( IsWinner, GAMESTATE->GetStageResult(pn)==RESULT_WIN ) LuaFunction_PlayerNumber( IsWinner, GAMESTATE->GetStageResult(pn)==RESULT_WIN )
LuaFunction_NoArgs( IsCourseMode, GAMESTATE->IsCourseMode() ) LuaFunction_NoArgs( IsCourseMode, GAMESTATE->IsCourseMode() )
LuaFunction_NoArgs( IsDemonstration, GAMESTATE->m_bDemonstrationOrJukebox ) LuaFunction_NoArgs( IsDemonstration, GAMESTATE->m_bDemonstrationOrJukebox )
+1 -1
View File
@@ -254,7 +254,7 @@ void MusicWheelItem::RefreshGrades()
else else
dc = GAMESTATE->m_PreferredDifficulty[p]; dc = GAMESTATE->m_PreferredDifficulty[p];
Grade grade; Grade grade;
if( PROFILEMAN->IsUsingProfile(p) ) if( PROFILEMAN->IsPersistentProfile(p) )
grade = PROFILEMAN->GetHighScoreForDifficulty( data->m_pSong, GAMESTATE->GetCurrentStyle(), (ProfileSlot)p, dc ).grade; grade = PROFILEMAN->GetHighScoreForDifficulty( data->m_pSong, GAMESTATE->GetCurrentStyle(), (ProfileSlot)p, dc ).grade;
else else
grade = PROFILEMAN->GetHighScoreForDifficulty( data->m_pSong, GAMESTATE->GetCurrentStyle(), PROFILE_SLOT_MACHINE, dc ).grade; grade = PROFILEMAN->GetHighScoreForDifficulty( data->m_pSong, GAMESTATE->GetCurrentStyle(), PROFILE_SLOT_MACHINE, dc ).grade;
+1 -1
View File
@@ -172,7 +172,7 @@ void PaneDisplay::SetContent( PaneContents c )
const Steps *pSteps = GAMESTATE->m_pCurSteps[m_PlayerNumber]; const Steps *pSteps = GAMESTATE->m_pCurSteps[m_PlayerNumber];
const Course *pCourse = GAMESTATE->m_pCurCourse; const Course *pCourse = GAMESTATE->m_pCurCourse;
const Trail *pTrail = GAMESTATE->m_pCurTrail[m_PlayerNumber]; const Trail *pTrail = GAMESTATE->m_pCurTrail[m_PlayerNumber];
const Profile *pProfile = PROFILEMAN->IsUsingProfile(m_PlayerNumber) ? PROFILEMAN->GetProfile(m_PlayerNumber) : NULL; const Profile *pProfile = PROFILEMAN->IsPersistentProfile(m_PlayerNumber) ? PROFILEMAN->GetProfile(m_PlayerNumber) : NULL;
bool bIsEdit = pSteps && pSteps->GetDifficulty() == DIFFICULTY_EDIT; bool bIsEdit = pSteps && pSteps->GetDifficulty() == DIFFICULTY_EDIT;
if( (g_Contents[c].req&NEED_NOTES) && !pSteps ) if( (g_Contents[c].req&NEED_NOTES) && !pSteps )
+15 -15
View File
@@ -249,7 +249,7 @@ void ProfileManager::SaveAllProfiles() const
FOREACH_HumanPlayer( pn ) FOREACH_HumanPlayer( pn )
{ {
if( !IsUsingProfile(pn) ) if( !IsPersistentProfile(pn) )
continue; continue;
this->SaveProfile( pn ); this->SaveProfile( pn );
@@ -451,14 +451,14 @@ const Profile* ProfileManager::GetProfile( ProfileSlot slot ) const
// //
void ProfileManager::IncrementToastiesCount( PlayerNumber pn ) void ProfileManager::IncrementToastiesCount( PlayerNumber pn )
{ {
if( PROFILEMAN->IsUsingProfile(pn) ) if( PROFILEMAN->IsPersistentProfile(pn) )
++PROFILEMAN->GetProfile(pn)->m_iNumToasties; ++PROFILEMAN->GetProfile(pn)->m_iNumToasties;
++PROFILEMAN->GetMachineProfile()->m_iNumToasties; ++PROFILEMAN->GetMachineProfile()->m_iNumToasties;
} }
void ProfileManager::AddStepTotals( PlayerNumber pn, int iNumTapsAndHolds, int iNumJumps, int iNumHolds, int iNumRolls, int iNumMines, int iNumHands, float fCaloriesBurned ) void ProfileManager::AddStepTotals( PlayerNumber pn, int iNumTapsAndHolds, int iNumJumps, int iNumHolds, int iNumRolls, int iNumMines, int iNumHands, float fCaloriesBurned )
{ {
if( PROFILEMAN->IsUsingProfile(pn) ) if( PROFILEMAN->IsPersistentProfile(pn) )
PROFILEMAN->GetProfile(pn)->AddStepTotals( iNumTapsAndHolds, iNumJumps, iNumHolds, iNumRolls, iNumMines, iNumHands, fCaloriesBurned ); PROFILEMAN->GetProfile(pn)->AddStepTotals( iNumTapsAndHolds, iNumJumps, iNumHolds, iNumRolls, iNumMines, iNumHands, fCaloriesBurned );
PROFILEMAN->GetMachineProfile()->AddStepTotals( iNumTapsAndHolds, iNumJumps, iNumHolds, iNumRolls, iNumMines, iNumHands, fCaloriesBurned ); PROFILEMAN->GetMachineProfile()->AddStepTotals( iNumTapsAndHolds, iNumJumps, iNumHolds, iNumRolls, iNumMines, iNumHands, fCaloriesBurned );
} }
@@ -498,7 +498,7 @@ void ProfileManager::AddStepsScore( const Song* pSong, const Steps* pSteps, Play
// //
if( hs.fPercentDP >= PREFSMAN->m_fMinPercentageForMachineSongHighScore ) if( hs.fPercentDP >= PREFSMAN->m_fMinPercentageForMachineSongHighScore )
{ {
if( PROFILEMAN->IsUsingProfile(pn) ) if( PROFILEMAN->IsPersistentProfile(pn) )
PROFILEMAN->GetProfile(pn)->AddStepsHighScore( pSong, pSteps, hs, iPersonalIndexOut ); PROFILEMAN->GetProfile(pn)->AddStepsHighScore( pSong, pSteps, hs, iPersonalIndexOut );
// don't leave machine high scores for edits // don't leave machine high scores for edits
@@ -509,14 +509,14 @@ void ProfileManager::AddStepsScore( const Song* pSong, const Steps* pSteps, Play
// //
// save recent score // save recent score
// //
if( PROFILEMAN->IsUsingProfile(pn) ) if( PROFILEMAN->IsPersistentProfile(pn) )
PROFILEMAN->GetProfile(pn)->AddStepsRecentScore( pSong, pSteps, hs ); PROFILEMAN->GetProfile(pn)->AddStepsRecentScore( pSong, pSteps, hs );
PROFILEMAN->GetMachineProfile()->AddStepsRecentScore( pSong, pSteps, hs ); PROFILEMAN->GetMachineProfile()->AddStepsRecentScore( pSong, pSteps, hs );
} }
void ProfileManager::IncrementStepsPlayCount( const Song* pSong, const Steps* pSteps, PlayerNumber pn ) void ProfileManager::IncrementStepsPlayCount( const Song* pSong, const Steps* pSteps, PlayerNumber pn )
{ {
if( PROFILEMAN->IsUsingProfile(pn) ) if( PROFILEMAN->IsPersistentProfile(pn) )
PROFILEMAN->GetProfile(pn)->IncrementStepsPlayCount( pSong, pSteps ); PROFILEMAN->GetProfile(pn)->IncrementStepsPlayCount( pSong, pSteps );
PROFILEMAN->GetMachineProfile()->IncrementStepsPlayCount( pSong, pSteps ); PROFILEMAN->GetMachineProfile()->IncrementStepsPlayCount( pSong, pSteps );
} }
@@ -530,7 +530,7 @@ HighScore ProfileManager::GetHighScoreForDifficulty( const Song *s, const Style
const Steps* pSteps = s->GetStepsByDifficulty( st->m_StepsType, dc ); const Steps* pSteps = s->GetStepsByDifficulty( st->m_StepsType, dc );
if( pSteps && PROFILEMAN->IsUsingProfile(slot) ) if( pSteps && PROFILEMAN->IsPersistentProfile(slot) )
return PROFILEMAN->GetProfile(slot)->GetStepsHighScoreList(s,pSteps).GetTopScore(); return PROFILEMAN->GetProfile(slot)->GetStepsHighScoreList(s,pSteps).GetTopScore();
else else
return HighScore(); return HighScore();
@@ -568,7 +568,7 @@ void ProfileManager::AddCourseScore( const Course* pCourse, const Trail* pTrail,
// //
if( hs.fPercentDP >= PREFSMAN->m_fMinPercentageForMachineCourseHighScore ) if( hs.fPercentDP >= PREFSMAN->m_fMinPercentageForMachineCourseHighScore )
{ {
if( PROFILEMAN->IsUsingProfile(pn) ) if( PROFILEMAN->IsPersistentProfile(pn) )
PROFILEMAN->GetProfile(pn)->AddCourseHighScore( pCourse, pTrail, hs, iPersonalIndexOut ); PROFILEMAN->GetProfile(pn)->AddCourseHighScore( pCourse, pTrail, hs, iPersonalIndexOut );
PROFILEMAN->GetMachineProfile()->AddCourseHighScore( pCourse, pTrail, hs, iMachineIndexOut ); PROFILEMAN->GetMachineProfile()->AddCourseHighScore( pCourse, pTrail, hs, iMachineIndexOut );
} }
@@ -576,14 +576,14 @@ void ProfileManager::AddCourseScore( const Course* pCourse, const Trail* pTrail,
// //
// save recent score // save recent score
// //
if( PROFILEMAN->IsUsingProfile(pn) ) if( PROFILEMAN->IsPersistentProfile(pn) )
PROFILEMAN->GetProfile(pn)->AddCourseRecentScore( pCourse, pTrail, hs ); PROFILEMAN->GetProfile(pn)->AddCourseRecentScore( pCourse, pTrail, hs );
PROFILEMAN->GetMachineProfile()->AddCourseRecentScore( pCourse, pTrail, hs ); PROFILEMAN->GetMachineProfile()->AddCourseRecentScore( pCourse, pTrail, hs );
} }
void ProfileManager::IncrementCoursePlayCount( const Course* pCourse, const Trail* pTrail, PlayerNumber pn ) void ProfileManager::IncrementCoursePlayCount( const Course* pCourse, const Trail* pTrail, PlayerNumber pn )
{ {
if( PROFILEMAN->IsUsingProfile(pn) ) if( PROFILEMAN->IsPersistentProfile(pn) )
PROFILEMAN->GetProfile(pn)->IncrementCoursePlayCount( pCourse, pTrail ); PROFILEMAN->GetProfile(pn)->IncrementCoursePlayCount( pCourse, pTrail );
PROFILEMAN->GetMachineProfile()->IncrementCoursePlayCount( pCourse, pTrail ); PROFILEMAN->GetMachineProfile()->IncrementCoursePlayCount( pCourse, pTrail );
} }
@@ -597,7 +597,7 @@ void ProfileManager::AddCategoryScore( StepsType st, RankingCategory rc, PlayerN
if( hs.fPercentDP > PREFSMAN->m_fMinPercentageForMachineSongHighScore ) if( hs.fPercentDP > PREFSMAN->m_fMinPercentageForMachineSongHighScore )
{ {
hs.sName = RANKING_TO_FILL_IN_MARKER[pn]; hs.sName = RANKING_TO_FILL_IN_MARKER[pn];
if( PROFILEMAN->IsUsingProfile(pn) ) if( PROFILEMAN->IsPersistentProfile(pn) )
PROFILEMAN->GetProfile(pn)->AddCategoryHighScore( st, rc, hs, iPersonalIndexOut ); PROFILEMAN->GetProfile(pn)->AddCategoryHighScore( st, rc, hs, iPersonalIndexOut );
else else
iPersonalIndexOut = -1; iPersonalIndexOut = -1;
@@ -607,12 +607,12 @@ void ProfileManager::AddCategoryScore( StepsType st, RankingCategory rc, PlayerN
void ProfileManager::IncrementCategoryPlayCount( StepsType st, RankingCategory rc, PlayerNumber pn ) void ProfileManager::IncrementCategoryPlayCount( StepsType st, RankingCategory rc, PlayerNumber pn )
{ {
if( PROFILEMAN->IsUsingProfile(pn) ) if( PROFILEMAN->IsPersistentProfile(pn) )
PROFILEMAN->GetProfile(pn)->IncrementCategoryPlayCount( st, rc ); PROFILEMAN->GetProfile(pn)->IncrementCategoryPlayCount( st, rc );
PROFILEMAN->GetMachineProfile()->IncrementCategoryPlayCount( st, rc ); PROFILEMAN->GetMachineProfile()->IncrementCategoryPlayCount( st, rc );
} }
bool ProfileManager::IsUsingProfile( ProfileSlot slot ) const bool ProfileManager::IsPersistentProfile( ProfileSlot slot ) const
{ {
switch( slot ) switch( slot )
{ {
@@ -636,13 +636,13 @@ class LunaProfileManager : public Luna<T>
public: public:
LunaProfileManager() { LUA->Register( Register ); } LunaProfileManager() { LUA->Register( Register ); }
static int IsUsingProfile( T* p, lua_State *L ) { lua_pushboolean(L, p->IsUsingProfile((PlayerNumber)IArg(1)) ); return 1; } static int IsPersistentProfile( T* p, lua_State *L ) { lua_pushboolean(L, p->IsPersistentProfile((PlayerNumber)IArg(1)) ); return 1; }
static int GetProfile( T* p, lua_State *L ) { PlayerNumber pn = (PlayerNumber)IArg(1); Profile* pP = p->GetProfile(pn); ASSERT(pP); pP->PushSelf(L); return 1; } static int GetProfile( T* p, lua_State *L ) { PlayerNumber pn = (PlayerNumber)IArg(1); Profile* pP = p->GetProfile(pn); ASSERT(pP); pP->PushSelf(L); return 1; }
static int GetMachineProfile( T* p, lua_State *L ) { p->GetMachineProfile()->PushSelf(L); return 1; } static int GetMachineProfile( T* p, lua_State *L ) { p->GetMachineProfile()->PushSelf(L); return 1; }
static void Register(lua_State *L) static void Register(lua_State *L)
{ {
ADD_METHOD( IsUsingProfile ) ADD_METHOD( IsPersistentProfile )
ADD_METHOD( GetProfile ) ADD_METHOD( GetProfile )
ADD_METHOD( GetMachineProfile ) ADD_METHOD( GetMachineProfile )
Luna<T>::Register( L ); Luna<T>::Register( L );
+2 -2
View File
@@ -47,8 +47,8 @@ public:
void LoadMachineProfile(); void LoadMachineProfile();
void SaveMachineProfile() const; void SaveMachineProfile() const;
bool IsUsingProfile( PlayerNumber pn ) const { return !m_sProfileDir[pn].empty(); } bool IsPersistentProfile( PlayerNumber pn ) const { return !m_sProfileDir[pn].empty(); }
bool IsUsingProfile( ProfileSlot slot ) const; bool IsPersistentProfile( ProfileSlot slot ) const;
// return a profile even if !IsUsingProfile // return a profile even if !IsUsingProfile
const Profile* GetProfile( PlayerNumber pn ) const; const Profile* GetProfile( PlayerNumber pn ) const;
+2 -2
View File
@@ -202,8 +202,8 @@ void ScreenEnding::Init()
FOREACH_HumanPlayer( p ) FOREACH_HumanPlayer( p )
{ {
// don't show stats if not using a profile // don't show stats if not using a persistent profile
if( !PROFILEMAN->IsUsingProfile(p) ) if( !PROFILEMAN->IsPersistentProfile(p) )
continue; continue;
FOREACH_EndingStatsLine( i ) FOREACH_EndingStatsLine( i )
+4 -5
View File
@@ -593,8 +593,7 @@ void ScreenEvaluation::Init()
// //
// init judgment area // init judgment area
// //
int l; for( int l=0; l<NUM_JUDGE_LINES; l++ )
for( l=0; l<NUM_JUDGE_LINES; l++ )
{ {
if( l == 0 && !GAMESTATE->ShowMarvelous() ) if( l == 0 && !GAMESTATE->ShowMarvelous() )
continue; // skip continue; // skip
@@ -639,7 +638,7 @@ void ScreenEvaluation::Init()
} }
} }
for( l=0; l<NUM_STATS_LINES; l++ ) for( int l=0; l<NUM_STATS_LINES; l++ )
{ {
if( !SHOW_STAT(l) ) if( !SHOW_STAT(l) )
continue; continue;
@@ -916,7 +915,7 @@ void ScreenEvaluation::CommitScores(
hs.fSurviveSeconds = stageStats.m_player[p].fAliveSeconds; hs.fSurviveSeconds = stageStats.m_player[p].fAliveSeconds;
hs.sModifiers = GAMESTATE->m_pPlayerState[p]->m_PlayerOptions.GetString(); hs.sModifiers = GAMESTATE->m_pPlayerState[p]->m_PlayerOptions.GetString();
hs.dateTime = DateTime::GetNowDateTime(); hs.dateTime = DateTime::GetNowDateTime();
hs.sPlayerGuid = PROFILEMAN->IsUsingProfile(p) ? PROFILEMAN->GetProfile(p)->m_sGuid : CString(""); hs.sPlayerGuid = PROFILEMAN->IsPersistentProfile(p) ? PROFILEMAN->GetProfile(p)->m_sGuid : CString("");
hs.sMachineGuid = PROFILEMAN->GetMachineProfile()->m_sGuid; hs.sMachineGuid = PROFILEMAN->GetMachineProfile()->m_sGuid;
hs.iProductID = PREFSMAN->m_iProductID; hs.iProductID = PREFSMAN->m_iProductID;
memcpy( hs.iTapNoteScores, stageStats.m_player[p].iTapNoteScores, sizeof(hs.iTapNoteScores) ); memcpy( hs.iTapNoteScores, stageStats.m_player[p].iTapNoteScores, sizeof(hs.iTapNoteScores) );
@@ -1302,7 +1301,7 @@ void ScreenEvaluation::Input( const DeviceInput& DeviceI, const InputEventType t
CodeDetector::EnteredCode(GameI.controller, CODE_SAVE_SCREENSHOT2) ) CodeDetector::EnteredCode(GameI.controller, CODE_SAVE_SCREENSHOT2) )
{ {
if( !m_bSavedScreenshot[pn] && // only allow one screenshot if( !m_bSavedScreenshot[pn] && // only allow one screenshot
PROFILEMAN->IsUsingProfile(pn) ) PROFILEMAN->IsPersistentProfile(pn) )
{ {
if( PROFILEMAN->ProfileWasLoadedFromMemoryCard(pn) ) if( PROFILEMAN->ProfileWasLoadedFromMemoryCard(pn) )
MEMCARDMAN->MountCard( pn ); MEMCARDMAN->MountCard( pn );
+1
View File
@@ -1135,6 +1135,7 @@ void ScreenOptions::MenuUpDown( PlayerNumber pn, const InputEventType type, int
return; return;
OptionRow &row = *m_Rows[iDest]; OptionRow &row = *m_Rows[iDest];
if( row.GetRowDef().IsEnabledForPlayer(pn) ) if( row.GetRowDef().IsEnabledForPlayer(pn) )
{ {
MoveRow( pn, iDelta, bRepeat ); MoveRow( pn, iDelta, bRepeat );
+2 -2
View File
@@ -1331,7 +1331,7 @@ void ScreenSelectMusic::AfterStepsChange( const vector<PlayerNumber> &vpns )
int iScore = 0; int iScore = 0;
if( pSteps ) if( pSteps )
{ {
Profile* pProfile = PROFILEMAN->IsUsingProfile(pn) ? PROFILEMAN->GetProfile(pn) : PROFILEMAN->GetMachineProfile(); Profile* pProfile = PROFILEMAN->IsPersistentProfile(pn) ? PROFILEMAN->GetProfile(pn) : PROFILEMAN->GetMachineProfile();
iScore = pProfile->GetStepsHighScoreList(pSong,pSteps).GetTopScore().iScore; iScore = pProfile->GetStepsHighScoreList(pSong,pSteps).GetTopScore().iScore;
} }
@@ -1376,7 +1376,7 @@ void ScreenSelectMusic::AfterTrailChange( const vector<PlayerNumber> &vpns )
int iScore = 0; int iScore = 0;
if( pTrail ) if( pTrail )
{ {
Profile* pProfile = PROFILEMAN->IsUsingProfile(pn) ? PROFILEMAN->GetProfile(pn) : PROFILEMAN->GetMachineProfile(); Profile* pProfile = PROFILEMAN->IsPersistentProfile(pn) ? PROFILEMAN->GetProfile(pn) : PROFILEMAN->GetMachineProfile();
iScore = pProfile->GetCourseHighScoreList(pCourse,pTrail).GetTopScore().iScore; iScore = pProfile->GetCourseHighScoreList(pCourse,pTrail).GetTopScore().iScore;
} }
+2 -2
View File
@@ -137,7 +137,7 @@ CString ScreenSystemLayer::GetCreditsMessage( PlayerNumber pn ) const
else if( PROFILEMAN->LastLoadWasTamperedOrCorrupt(pn) ) else if( PROFILEMAN->LastLoadWasTamperedOrCorrupt(pn) )
return CREDITS_LOAD_FAILED.GetValue(); return CREDITS_LOAD_FAILED.GetValue();
// Prefer the name of the profile over the name of the card. // Prefer the name of the profile over the name of the card.
else if( PROFILEMAN->IsUsingProfile(pn) ) else if( PROFILEMAN->IsPersistentProfile(pn) )
return pProfile->GetDisplayName(); return pProfile->GetDisplayName();
else if( GAMESTATE->PlayersCanJoin() ) else if( GAMESTATE->PlayersCanJoin() )
return CREDITS_INSERT_CARD.GetValue(); return CREDITS_INSERT_CARD.GetValue();
@@ -155,7 +155,7 @@ CString ScreenSystemLayer::GetCreditsMessage( PlayerNumber pn ) const
return CREDITS_LOAD_FAILED.GetValue(); return CREDITS_LOAD_FAILED.GetValue();
// If there is a local profile loaded, prefer it over the name of the memory card. // If there is a local profile loaded, prefer it over the name of the memory card.
if( PROFILEMAN->IsUsingProfile(pn) ) if( PROFILEMAN->IsPersistentProfile(pn) )
{ {
CString s = pProfile->GetDisplayName(); CString s = pProfile->GetDisplayName();
if( s.empty() ) if( s.empty() )
+1 -1
View File
@@ -195,7 +195,7 @@ void SongUtil::SortSongPointerArrayByGroupAndTitle( vector<Song*> &vpSongsInOut
void SongUtil::SortSongPointerArrayByNumPlays( vector<Song*> &vpSongsInOut, ProfileSlot slot, bool bDescending ) void SongUtil::SortSongPointerArrayByNumPlays( vector<Song*> &vpSongsInOut, ProfileSlot slot, bool bDescending )
{ {
if( !PROFILEMAN->IsUsingProfile(slot) ) if( !PROFILEMAN->IsPersistentProfile(slot) )
return; // nothing to do since we don't have data return; // nothing to do since we don't have data
Profile* pProfile = PROFILEMAN->GetProfile(slot); Profile* pProfile = PROFILEMAN->GetProfile(slot);
SortSongPointerArrayByNumPlays( vpSongsInOut, pProfile, bDescending ); SortSongPointerArrayByNumPlays( vpSongsInOut, pProfile, bDescending );
+1 -1
View File
@@ -1323,7 +1323,7 @@ bool HandleGlobalInputs( DeviceInput DeviceI, InputEventType type, GameInput Gam
BOOKKEEPER->WriteToDisk(); BOOKKEEPER->WriteToDisk();
PROFILEMAN->SaveMachineProfile(); PROFILEMAN->SaveMachineProfile();
FOREACH_PlayerNumber( p ) FOREACH_PlayerNumber( p )
if( PROFILEMAN->IsUsingProfile(p) ) if( PROFILEMAN->IsPersistentProfile(p) )
PROFILEMAN->SaveProfile( p ); PROFILEMAN->SaveProfile( p );
SCREENMAN->SystemMessage( "Stats saved" ); SCREENMAN->SystemMessage( "Stats saved" );
} }
+1 -1
View File
@@ -25,7 +25,7 @@ bool CompareStepsPointersBySortValueDescending(const Steps *pSteps1, const Steps
void StepsUtil::SortStepsPointerArrayByNumPlays( vector<Steps*> &vStepsPointers, ProfileSlot slot, bool bDescending ) void StepsUtil::SortStepsPointerArrayByNumPlays( vector<Steps*> &vStepsPointers, ProfileSlot slot, bool bDescending )
{ {
if( !PROFILEMAN->IsUsingProfile(slot) ) if( !PROFILEMAN->IsPersistentProfile(slot) )
return; // nothing to do since we don't have data return; // nothing to do since we don't have data
Profile* pProfile = PROFILEMAN->GetProfile(slot); Profile* pProfile = PROFILEMAN->GetProfile(slot);
SortStepsPointerArrayByNumPlays( vStepsPointers, pProfile, bDescending ); SortStepsPointerArrayByNumPlays( vStepsPointers, pProfile, bDescending );
+1 -1
View File
@@ -443,7 +443,7 @@ void UnlockManager::UpdateCachedPointers()
void UnlockManager::UnlockCode( int num ) void UnlockManager::UnlockCode( int num )
{ {
FOREACH_PlayerNumber( pn ) FOREACH_PlayerNumber( pn )
if( PROFILEMAN->IsUsingProfile(pn) ) if( PROFILEMAN->IsPersistentProfile(pn) )
PROFILEMAN->GetProfile(pn)->m_UnlockedSongs.insert( num ); PROFILEMAN->GetProfile(pn)->m_UnlockedSongs.insert( num );
PROFILEMAN->GetMachineProfile()->m_UnlockedSongs.insert( num ); PROFILEMAN->GetMachineProfile()->m_UnlockedSongs.insert( num );