diff --git a/src/NotesLoaderSSC.cpp b/src/NotesLoaderSSC.cpp index 2a8500c807..8f5d0dc1c3 100644 --- a/src/NotesLoaderSSC.cpp +++ b/src/NotesLoaderSSC.cpp @@ -717,7 +717,7 @@ bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCach else if( sValueName=="CREDIT" ) { - ; // Not implemented yet, but should be. + pNewNotes->SetCredit( sParams[1] ); } else if( sValueName=="NOTES" ) diff --git a/src/NotesWriterSSC.cpp b/src/NotesWriterSSC.cpp index 365a490493..97c3458d7b 100644 --- a/src/NotesWriterSSC.cpp +++ b/src/NotesWriterSSC.cpp @@ -276,7 +276,7 @@ static RString GetSSCNotesTag( const Song &song, const Steps &in, bool bSavingCa } lines.push_back( ssprintf( "#RADARVALUES:%s:", join(",",asRadarValues).c_str() ) ); - lines.push_back( "#CREDIT:;" ); // will be done later. + lines.push_back( ssprintf( "#CREDIT:%s;", SmEscape(in.GetCredit()).c_str() ) ); // TODO: Remove this block, uncommon below block for Split Timing. -Wolfman2000 lines.push_back( "#BPMS:;" ); diff --git a/src/Steps.cpp b/src/Steps.cpp index 70815cf0fe..4fad419d41 100644 --- a/src/Steps.cpp +++ b/src/Steps.cpp @@ -322,7 +322,7 @@ void Steps::DeAutogen( bool bCopyNoteData ) m_Difficulty = Real()->m_Difficulty; m_iMeter = Real()->m_iMeter; copy( Real()->m_CachedRadarValues, Real()->m_CachedRadarValues + NUM_PLAYERS, m_CachedRadarValues ); - + m_sCredit = Real()->m_sCredit; parent = NULL; if( bCopyNoteData ) @@ -366,6 +366,12 @@ void Steps::SetDifficultyAndDescription( Difficulty dc, RString sDescription ) MakeValidEditDescription( m_sDescription ); } +void Steps::SetCredit( RString sCredit ) +{ + DeAutogen(); + m_sCredit = sCredit; +} + bool Steps::MakeValidEditDescription( RString &sPreferredDescription ) { if( int(sPreferredDescription.size()) > MAX_EDIT_STEPS_DESCRIPTION_LENGTH ) diff --git a/src/Steps.h b/src/Steps.h index 77d0fa3359..36c7f382a5 100644 --- a/src/Steps.h +++ b/src/Steps.h @@ -40,6 +40,7 @@ public: Difficulty GetDifficulty() const { return Real()->m_Difficulty; } int GetMeter() const { return Real()->m_iMeter; } const RadarValues& GetRadarValues( PlayerNumber pn ) const { return Real()->m_CachedRadarValues[pn]; } + RString GetCredit() const { return Real()->m_sCredit; } void SetFilename( RString fn ) { m_sFilename = fn; } RString GetFilename() const { return m_sFilename; } @@ -48,6 +49,7 @@ public: void SetDifficulty( Difficulty dc ) { SetDifficultyAndDescription( dc, GetDescription() ); } void SetDescription( RString sDescription ) { SetDifficultyAndDescription( this->GetDifficulty(), sDescription ); } void SetDifficultyAndDescription( Difficulty dc, RString sDescription ); + void SetCredit( RString sCredit ); static bool MakeValidEditDescription( RString &sPreferredDescription ); // return true if was modified void SetLoadedFromProfile( ProfileSlot slot ) { m_LoadedFromProfile = slot; } @@ -92,10 +94,11 @@ private: /* These values are pulled from the autogen source first, if there is one. */ mutable unsigned m_iHash; // only used if m_Difficulty == Difficulty_Edit - RString m_sDescription; // Step author, edit name, or something meaningful + RString m_sDescription; // Edit name, or something meaningful Difficulty m_Difficulty; // difficulty classification int m_iMeter; // difficulty rating from MIN_METER to MAX_METER RadarValues m_CachedRadarValues[NUM_PLAYERS]; + RString m_sCredit; // Step author }; #endif