fix "unlocking a song doesn't automatically select it"
This commit is contained in:
@@ -142,9 +142,11 @@ void GameState::Reset()
|
||||
m_iRoundSeed = rand();
|
||||
|
||||
m_pCurSong = NULL;
|
||||
m_pPreferredSong = NULL;
|
||||
FOREACH_PlayerNumber( p )
|
||||
m_pCurSteps[p] = NULL;
|
||||
m_pCurCourse = NULL;
|
||||
m_pPreferredCourse = NULL;
|
||||
FOREACH_PlayerNumber( p )
|
||||
m_pCurTrail[p] = NULL;
|
||||
|
||||
@@ -270,11 +272,11 @@ void GameState::PlayersFinalized()
|
||||
if( m_SortOrder == SORT_INVALID && pProfile->m_SortOrder != SORT_INVALID )
|
||||
m_SortOrder = pProfile->m_SortOrder;
|
||||
if( pProfile->m_LastDifficulty != DIFFICULTY_INVALID )
|
||||
GAMESTATE->m_PreferredDifficulty[pn] = pProfile->m_LastDifficulty;
|
||||
m_PreferredDifficulty[pn] = pProfile->m_LastDifficulty;
|
||||
if( pProfile->m_LastCourseDifficulty != COURSE_DIFFICULTY_INVALID )
|
||||
GAMESTATE->m_PreferredCourseDifficulty[pn] = pProfile->m_LastCourseDifficulty;
|
||||
if( m_pCurSong == NULL && pProfile->m_pLastSong )
|
||||
m_pCurSong = pProfile->m_pLastSong;
|
||||
m_PreferredCourseDifficulty[pn] = pProfile->m_LastCourseDifficulty;
|
||||
if( m_pPreferredSong == NULL && pProfile->m_pLastSong )
|
||||
m_pPreferredSong = pProfile->m_pLastSong;
|
||||
}
|
||||
|
||||
FOREACH_PlayerNumber( pn )
|
||||
@@ -374,10 +376,6 @@ void GameState::EndGame()
|
||||
|
||||
Profile* pProfile = PROFILEMAN->GetProfile(pn);
|
||||
|
||||
// persist settings
|
||||
if( !g_vPlayedStageStats.empty() )
|
||||
pProfile->m_pLastSong = g_vPlayedStageStats.back().pSong;
|
||||
|
||||
PROFILEMAN->SaveProfile( pn );
|
||||
PROFILEMAN->UnloadProfile( pn );
|
||||
}
|
||||
@@ -405,6 +403,10 @@ void GameState::SaveCurrentSettingsToProfile( PlayerNumber pn )
|
||||
pProfile->m_LastDifficulty = m_PreferredDifficulty[pn];
|
||||
if( m_PreferredCourseDifficulty[pn] != COURSE_DIFFICULTY_INVALID )
|
||||
pProfile->m_LastCourseDifficulty = m_PreferredCourseDifficulty[pn];
|
||||
if( m_pPreferredSong )
|
||||
pProfile->m_pLastSong = m_pPreferredSong;
|
||||
if( m_pPreferredCourse )
|
||||
pProfile->m_pLastCourse = m_pPreferredCourse;
|
||||
}
|
||||
|
||||
void GameState::Update( float fDelta )
|
||||
|
||||
@@ -139,9 +139,17 @@ public:
|
||||
//
|
||||
// State Info used during gameplay
|
||||
//
|
||||
|
||||
// NULL on ScreenSelectMusic if the currently selected wheel item isn't a Song.
|
||||
Song* m_pCurSong;
|
||||
// The last Song that the user manually changed to.
|
||||
Song* m_pPreferredSong;
|
||||
Steps* m_pCurSteps[NUM_PLAYERS];
|
||||
|
||||
// NULL on ScreenSelectMusic if the currently selected wheel item isn't a Course.
|
||||
Course* m_pCurCourse;
|
||||
// The last Course that the user manually changed to.
|
||||
Course* m_pPreferredCourse;
|
||||
Course* m_pCurTrail[NUM_PLAYERS];
|
||||
|
||||
|
||||
|
||||
@@ -422,11 +422,17 @@ void ModeChoice::Apply( PlayerNumber pn ) const
|
||||
if( m_sModifiers != "" )
|
||||
GAMESTATE->ApplyModifiers( pn, m_sModifiers );
|
||||
if( m_pSong )
|
||||
{
|
||||
GAMESTATE->m_pCurSong = m_pSong;
|
||||
GAMESTATE->m_pPreferredSong = m_pSong;
|
||||
}
|
||||
if( m_pSteps )
|
||||
GAMESTATE->m_pCurSteps[pn] = m_pSteps;
|
||||
if( m_pCourse )
|
||||
{
|
||||
GAMESTATE->m_pCurCourse = m_pCourse;
|
||||
GAMESTATE->m_pPreferredCourse = m_pCourse;
|
||||
}
|
||||
if( m_pCharacter )
|
||||
GAMESTATE->m_pCurCharacters[pn] = m_pCharacter;
|
||||
if( m_CourseDifficulty != COURSE_DIFFICULTY_INVALID )
|
||||
|
||||
@@ -160,7 +160,7 @@ void MusicWheel::Load()
|
||||
pSteps,
|
||||
po,
|
||||
so );
|
||||
GAMESTATE->m_pCurSong = pSong;
|
||||
GAMESTATE->m_pCurSong = GAMESTATE->m_pPreferredSong = pSong;
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
if( GAMESTATE->IsHumanPlayer(p) )
|
||||
@@ -269,8 +269,6 @@ bool MusicWheel::SelectSong( Song *p )
|
||||
if(p == NULL)
|
||||
return false;
|
||||
|
||||
GAMESTATE->m_pCurSong = p;
|
||||
|
||||
unsigned i;
|
||||
vector<WheelItemData> &from = m_WheelItemDatas[GAMESTATE->m_SortOrder];
|
||||
for( i=0; i<from.size(); i++ )
|
||||
|
||||
@@ -89,6 +89,7 @@ void Profile::InitGeneralData()
|
||||
m_LastDifficulty = DIFFICULTY_INVALID;
|
||||
m_LastCourseDifficulty = COURSE_DIFFICULTY_INVALID;
|
||||
m_pLastSong = NULL;
|
||||
m_pLastCourse = NULL;
|
||||
m_iTotalPlays = 0;
|
||||
m_iTotalPlaySeconds = 0;
|
||||
m_iTotalGameplaySeconds = 0;
|
||||
@@ -741,6 +742,7 @@ XNode* Profile::SaveGeneralDataCreateNode() const
|
||||
pGeneralDataNode->AppendChild( "LastDifficulty", DifficultyToString(m_LastDifficulty) );
|
||||
pGeneralDataNode->AppendChild( "LastCourseDifficulty", CourseDifficultyToString(m_LastCourseDifficulty) );
|
||||
if( m_pLastSong ) pGeneralDataNode->AppendChild( "LastSong", m_pLastSong->GetSongDir() );
|
||||
if( m_pLastCourse ) pGeneralDataNode->AppendChild( "LastCourse",m_pLastCourse->m_sPath );
|
||||
pGeneralDataNode->AppendChild( "TotalPlays", m_iTotalPlays );
|
||||
pGeneralDataNode->AppendChild( "TotalPlaySeconds", m_iTotalPlaySeconds );
|
||||
pGeneralDataNode->AppendChild( "TotalGameplaySeconds", m_iTotalGameplaySeconds );
|
||||
@@ -881,6 +883,7 @@ void Profile::LoadGeneralDataFromNode( const XNode* pNode )
|
||||
pNode->GetChildValue( "LastDifficulty", s ); m_LastDifficulty = StringToDifficulty( s );
|
||||
pNode->GetChildValue( "LastCourseDifficulty", s ); m_LastCourseDifficulty = StringToCourseDifficulty( s );
|
||||
pNode->GetChildValue( "LastSong", s ); m_pLastSong = SONGMAN->GetSongFromDir(s);
|
||||
pNode->GetChildValue( "LastCourse", s ); m_pLastCourse = SONGMAN->GetCourseFromPath(s);
|
||||
pNode->GetChildValue( "TotalPlays", m_iTotalPlays );
|
||||
pNode->GetChildValue( "TotalPlaySeconds", m_iTotalPlaySeconds );
|
||||
pNode->GetChildValue( "TotalGameplaySeconds", m_iTotalGameplaySeconds );
|
||||
|
||||
@@ -102,6 +102,7 @@ public:
|
||||
Difficulty m_LastDifficulty;
|
||||
CourseDifficulty m_LastCourseDifficulty;
|
||||
Song* m_pLastSong;
|
||||
Course* m_pLastCourse;
|
||||
int m_iTotalPlays;
|
||||
int m_iTotalPlaySeconds;
|
||||
int m_iTotalGameplaySeconds;
|
||||
|
||||
@@ -1291,14 +1291,17 @@ void ScreenSelectMusic::AfterMusicChange()
|
||||
}
|
||||
|
||||
Song* pSong = m_MusicWheel.GetSelectedSong();
|
||||
GAMESTATE->m_pCurSong = pSong;
|
||||
if( pSong )
|
||||
GAMESTATE->m_pCurSong = pSong;
|
||||
GAMESTATE->m_pPreferredSong = pSong;
|
||||
|
||||
m_GrooveGraph.SetFromSong( pSong );
|
||||
|
||||
Course* pCourse = m_MusicWheel.GetSelectedCourse();
|
||||
GAMESTATE->m_pCurCourse = pCourse;
|
||||
if( pCourse )
|
||||
GAMESTATE->m_pCurCourse = pCourse;
|
||||
GAMESTATE->m_pPreferredCourse = pCourse;
|
||||
|
||||
|
||||
int pn;
|
||||
for( pn = 0; pn < NUM_PLAYERS; ++pn)
|
||||
|
||||
Reference in New Issue
Block a user