PlayerOption po1; // Initialize it.

PlayerOption po2;

po2.FromString( po1.GetString() );
po2 does not necessarily equal po1 because the note skin might be omitted so po2's note skin will be blank. Passing true to GetString() will include the note skin so po2.FromString( po1.GetString(true) ) will cause po2 to equal po1.
This commit is contained in:
Steve Checkoway
2006-08-18 00:09:09 +00:00
parent 17c16210d1
commit 8c6575ecbb
2 changed files with 7 additions and 7 deletions
+5 -5
View File
@@ -76,14 +76,14 @@ static void AddPart( vector<RString> &AddTo, float level, RString name )
AddTo.push_back( LevelStr + name );
}
RString PlayerOptions::GetString() const
RString PlayerOptions::GetString( bool bForceNoteSkin ) const
{
vector<RString> v;
GetMods( v );
GetMods( v, bForceNoteSkin );
return join( ", ", v );
}
void PlayerOptions::GetMods( vector<RString> &AddTo ) const
void PlayerOptions::GetMods( vector<RString> &AddTo, bool bForceNoteSkin ) const
{
RString sReturn;
@@ -195,8 +195,8 @@ void PlayerOptions::GetMods( vector<RString> &AddTo ) const
AddPart( AddTo, m_fSkew, "Incoming" );
}
// Don't display a string if using the default NoteSkin.
if( !m_sNoteSkin.empty() && m_sNoteSkin != NOTESKIN->GAME_BASE_NOTESKIN_NAME.GetValue() )
// Don't display a string if using the default NoteSkin unless we force it.
if( bForceNoteSkin || (!m_sNoteSkin.empty() && m_sNoteSkin != NOTESKIN->GAME_BASE_NOTESKIN_NAME.GetValue()) )
{
RString s = m_sNoteSkin;
Capitalize( s );
+2 -2
View File
@@ -16,10 +16,10 @@ public:
PlayerOptions() { Init(); };
void Init();
void Approach( const PlayerOptions& other, float fDeltaSeconds );
RString GetString() const;
RString GetString( bool bForceNoteSkin = false ) const;
RString GetSavedPrefsString() const; // only the basic options that players would want for every song
void ResetSavedPrefs();
void GetMods( vector<RString> &AddTo ) const;
void GetMods( vector<RString> &AddTo, bool bForceNoteSkin = false ) const;
void GetLocalizedMods( vector<RString> &AddTo ) const;
void FromString( const RString &sOptions, bool bWarnOnInvalid = false );
void ChooseRandomModifiers();