Save profile modifiers per gametype. Only reset saved modifiers when

loading profile modifiers, so we don't wipe out modifiers that aren't saved.
UsingProfileDefaultModifiers is gone; if an entry exists in the DefaultModifiers
list at all, UsingProfileDefaultModifiers is true.
This commit is contained in:
Glenn Maynard
2004-11-14 05:24:37 +00:00
parent 6e602f89c9
commit 4a246546a9
3 changed files with 58 additions and 13 deletions
+9 -5
View File
@@ -246,10 +246,15 @@ void GameState::PlayersFinalized()
Profile* pProfile = PROFILEMAN->GetProfile(pn);
if( pProfile->m_bUsingProfileDefaultModifiers )
CString sModifiers;
if( pProfile->GetDefaultModifiers( this->m_pCurGame, sModifiers ) )
{
GAMESTATE->m_PlayerOptions[pn].Init();
GAMESTATE->ApplyModifiers( pn, pProfile->m_sDefaultModifiers );
/* We don't save negative preferences (eg. "no reverse"). If the theme
* sets a default of "reverse", and the player turns it off, we should
* set it off. However, don't reset modifiers that aren't saved by the
* profile, so we don't ignore unsaved modifiers when a profile is in use. */
GAMESTATE->m_PlayerOptions[pn].ResetSavedPrefs();
GAMESTATE->ApplyModifiers( pn, sModifiers );
}
// Only set the sort order if it wasn't already set by a ModeChoice (or by an earlier profile)
if( m_SortOrder == SORT_INVALID && pProfile->m_SortOrder != SORT_INVALID )
@@ -386,8 +391,7 @@ void GameState::SaveCurrentSettingsToProfile( PlayerNumber pn )
Profile* pProfile = PROFILEMAN->GetProfile(pn);
pProfile->m_bUsingProfileDefaultModifiers = true;
pProfile->m_sDefaultModifiers = m_PlayerOptions[pn].GetSavedPrefsString();
pProfile->SetDefaultModifiers( this->m_pCurGame, m_PlayerOptions[pn].GetSavedPrefsString() );
if( IsSongSort(m_SortOrder) )
pProfile->m_SortOrder = m_SortOrder;
if( m_PreferredDifficulty[pn] != DIFFICULTY_INVALID )