From 3c7bb93bbc5d780cdfb50768f8337d54b8178120 Mon Sep 17 00:00:00 2001 From: Kyzentun Date: Sun, 16 Feb 2014 11:43:28 -0700 Subject: [PATCH] Added ComboContinuesBetweenSongs back in. And if that line in ResetStageStatistics is committed as FOREACH_HumanPlayer, I'm going to punch git. --- src/GameState.cpp | 24 ++++++++++++++++++++++++ src/PrefsManager.cpp | 1 + src/PrefsManager.h | 1 + src/Profile.cpp | 3 +++ src/Profile.h | 3 ++- 5 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/GameState.cpp b/src/GameState.cpp index 5902ee152e..a27a01b3ee 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -795,6 +795,13 @@ void GameState::FinishStage() } } + // Save the current combo to the profiles so it can be used for ComboContinuesBetweenSongs. + FOREACH_HumanPlayer( p ) + { + Profile* pProfile = PROFILEMAN->GetProfile(p); + pProfile->m_iCurrentCombo = STATSMAN->m_CurStageStats.m_player[p].m_iCurCombo; + } + if( m_bDemonstrationOrJukebox ) return; @@ -926,7 +933,24 @@ void GameState::ResetMusicStatistics() void GameState::ResetStageStatistics() { + StageStats OldStats = STATSMAN->m_CurStageStats; STATSMAN->m_CurStageStats = StageStats(); + if( PREFSMAN->m_bComboContinuesBetweenSongs ) + { + FOREACH_PlayerNumber( p ) + { + bool FirstSong = m_iCurrentStageIndex == 0; + if( FirstSong ) + { + Profile* pProfile = PROFILEMAN->GetProfile(p); + STATSMAN->m_CurStageStats.m_player[p].m_iCurCombo = pProfile->m_iCurrentCombo; + } + else + { + STATSMAN->m_CurStageStats.m_player[p].m_iCurCombo = OldStats.m_player[p].m_iCurCombo; + } + } + } RemoveAllActiveAttacks(); FOREACH_PlayerNumber( p ) diff --git a/src/PrefsManager.cpp b/src/PrefsManager.cpp index 39fd2faeb2..7f4340f379 100644 --- a/src/PrefsManager.cpp +++ b/src/PrefsManager.cpp @@ -217,6 +217,7 @@ PrefsManager::PrefsManager() : m_iCoinsPerCredit ( "CoinsPerCredit", 1 ), m_iSongsPerPlay ( "SongsPerPlay", 3, ValidateSongsPerPlay ), m_bDelayedCreditsReconcile ( "DelayedCreditsReconcile", false ), + m_bComboContinuesBetweenSongs ( "ComboContinuesBetweenSongs", false ), m_ShowSongOptions ( "ShowSongOptions", Maybe_YES ), m_bDancePointsForOni ( "DancePointsForOni", true ), m_bPercentageScoring ( "PercentageScoring", false ), diff --git a/src/PrefsManager.h b/src/PrefsManager.h index 142a9d64d4..95f684f1a6 100644 --- a/src/PrefsManager.h +++ b/src/PrefsManager.h @@ -208,6 +208,7 @@ public: Preference m_iCoinsPerCredit; Preference m_iSongsPerPlay; Preference m_bDelayedCreditsReconcile; // zuh? + Preference m_bComboContinuesBetweenSongs; Preference m_ShowSongOptions; Preference m_bDancePointsForOni; Preference m_bPercentageScoring; diff --git a/src/Profile.cpp b/src/Profile.cpp index b28ca959be..524b059c7a 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -116,6 +116,7 @@ void Profile::InitGeneralData() m_LastStepsType = StepsType_Invalid; m_lastSong.Unset(); m_lastCourse.Unset(); + m_iCurrentCombo = 0; m_iTotalSessions = 0; m_iTotalSessionSeconds = 0; m_iTotalGameplaySeconds = 0; @@ -1088,6 +1089,7 @@ XNode* Profile::SaveGeneralDataCreateNode() const pGeneralDataNode->AppendChild( "LastStepsType", GAMEMAN->GetStepsTypeInfo(m_LastStepsType).szName ); pGeneralDataNode->AppendChild( m_lastSong.CreateNode() ); pGeneralDataNode->AppendChild( m_lastCourse.CreateNode() ); + pGeneralDataNode->AppendChild( "CurrentCombo", m_iCurrentCombo ); pGeneralDataNode->AppendChild( "TotalSessions", m_iTotalSessions ); pGeneralDataNode->AppendChild( "TotalSessionSeconds", m_iTotalSessionSeconds ); pGeneralDataNode->AppendChild( "TotalGameplaySeconds", m_iTotalGameplaySeconds ); @@ -1271,6 +1273,7 @@ void Profile::LoadGeneralDataFromNode( const XNode* pNode ) pNode->GetChildValue( "LastStepsType", s ); m_LastStepsType = GAMEMAN->StringToStepsType( s ); pTemp = pNode->GetChild( "Song" ); if( pTemp ) m_lastSong.LoadFromNode( pTemp ); pTemp = pNode->GetChild( "Course" ); if( pTemp ) m_lastCourse.LoadFromNode( pTemp ); + pNode->GetChildValue( "CurrentCombo", m_iCurrentCombo ); pNode->GetChildValue( "TotalSessions", m_iTotalSessions ); pNode->GetChildValue( "TotalSessionSeconds", m_iTotalSessionSeconds ); pNode->GetChildValue( "TotalGameplaySeconds", m_iTotalGameplaySeconds ); diff --git a/src/Profile.h b/src/Profile.h index 640249a7d7..60f676479b 100644 --- a/src/Profile.h +++ b/src/Profile.h @@ -78,7 +78,7 @@ public: m_LastDifficulty(Difficulty_Invalid), m_LastCourseDifficulty(Difficulty_Invalid), m_LastStepsType(StepsType_Invalid), m_lastSong(), - m_lastCourse(), m_iTotalSessions(0), + m_lastCourse(), m_iCurrentCombo(0), m_iTotalSessions(0), m_iTotalSessionSeconds(0), m_iTotalGameplaySeconds(0), m_fTotalCaloriesBurned(0), m_GoalType(GoalType_Calories), m_iGoalCalories(0), m_iGoalSeconds(0), m_iTotalDancePoints(0), @@ -165,6 +165,7 @@ public: StepsType m_LastStepsType; SongID m_lastSong; CourseID m_lastCourse; + int m_iCurrentCombo; int m_iTotalSessions; int m_iTotalSessionSeconds; int m_iTotalGameplaySeconds;