diff --git a/Docs/Changelog_SSCformat.txt b/Docs/Changelog_SSCformat.txt index ae2eb57362..60301667a0 100644 --- a/Docs/Changelog_SSCformat.txt +++ b/Docs/Changelog_SSCformat.txt @@ -9,6 +9,9 @@ change to JSON, but it is unsure if this will be done. Implement .ssc at your own risk. ________________________________________________________________________________ +[v0.52] - AJ +* Add CHARTSTYLE tag to NoteData section. + [v0.51] - AJ * Move VERSION tag to the first line. * Limit VERSION tag to two decimal places. diff --git a/src/NotesLoaderSSC.cpp b/src/NotesLoaderSSC.cpp index b4be9ce8d2..63be9cacde 100644 --- a/src/NotesLoaderSSC.cpp +++ b/src/NotesLoaderSSC.cpp @@ -634,6 +634,11 @@ bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCach pNewNotes->m_StepsType = GAMEMAN->StringToStepsType( sParams[1] ); } + else if( sValueName=="CHARTSTYLE" ) + { + pNewNotes->SetChartStyle( sParams[1] ); + } + else if( sValueName=="DESCRIPTION" ) { pNewNotes->SetDescription( sParams[1] ); @@ -990,6 +995,12 @@ bool SSCLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePat bSSCFormat = true; } + else if( sValueName=="CHARTSTYLE" ) + { + pNewNotes->SetChartStyle( sParams[1] ); + bSSCFormat = true; + } + else if( sValueName=="DESCRIPTION" ) { pNewNotes->SetDescription( sParams[1] ); diff --git a/src/NotesWriterSSC.cpp b/src/NotesWriterSSC.cpp index 5c7e8f3a68..0da790abd5 100644 --- a/src/NotesWriterSSC.cpp +++ b/src/NotesWriterSSC.cpp @@ -262,6 +262,7 @@ static RString GetSSCNotesTag( const Song &song, const Steps &in, bool bSavingCa lines.push_back( "#NOTEDATA:;" ); // our new separator. lines.push_back( ssprintf( "#STEPSTYPE:%s;", GAMEMAN->GetStepsTypeInfo(in.m_StepsType).szName ) ); lines.push_back( ssprintf( "#DESCRIPTION:%s;", SmEscape(in.GetDescription()).c_str() ) ); + lines.push_back( ssprintf( "#CHARTSTYLE:%s;", SmEscape(in.GetChartStyle()).c_str() ) ); lines.push_back( ssprintf( "#DIFFICULTY:%s;", DifficultyToString(in.GetDifficulty()).c_str() ) ); lines.push_back( ssprintf( "#METER:%d;", in.GetMeter() ) ); diff --git a/src/Song.cpp b/src/Song.cpp index b4e7fe088d..10512d4977 100644 --- a/src/Song.cpp +++ b/src/Song.cpp @@ -36,8 +36,9 @@ #include #include -const static float VERSION_NUMBER = 0.51f; -const int FILE_CACHE_VERSION = 163; // increment this to invalidate cache +/** @brief: The version of the .ssc file format. */ +const static float VERSION_NUMBER = 0.52f; +const int FILE_CACHE_VERSION = 164; // increment this to invalidate cache const float DEFAULT_MUSIC_SAMPLE_LENGTH = 12.f; diff --git a/src/Steps.cpp b/src/Steps.cpp index 852c5b0b47..ff6ef6ce04 100644 --- a/src/Steps.cpp +++ b/src/Steps.cpp @@ -319,6 +319,7 @@ void Steps::DeAutogen( bool bCopyNoteData ) Decompress(); // fills in m_pNoteData with sliding window transform m_sDescription = Real()->m_sDescription; + m_sChartStyle = Real()->m_sChartStyle; m_Difficulty = Real()->m_Difficulty; m_iMeter = Real()->m_iMeter; copy( Real()->m_CachedRadarValues, Real()->m_CachedRadarValues + NUM_PLAYERS, m_CachedRadarValues ); @@ -372,6 +373,12 @@ void Steps::SetCredit( RString sCredit ) m_sCredit = sCredit; } +void Steps::SetChartStyle( RString sChartStyle ) +{ + DeAutogen(); + m_sChartStyle = sChartStyle; +} + 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 532857381a..e87dfef458 100644 --- a/src/Steps.h +++ b/src/Steps.h @@ -67,6 +67,11 @@ public: * @return the description used for this edit. */ RString GetDescription() const { return Real()->m_sDescription; } + /** + * @brief Retrieve the ChartStyle used for this chart. + * @return the description used for this chart. + */ + RString GetChartStyle() const { return Real()->m_sChartStyle; } /** * @brief Retrieve the difficulty used for this edit. * @return the difficulty used for this edit. @@ -92,6 +97,7 @@ public: void SetDescription( RString sDescription ) { SetDifficultyAndDescription( this->GetDifficulty(), sDescription ); } void SetDifficultyAndDescription( Difficulty dc, RString sDescription ); void SetCredit( RString sCredit ); + void SetChartStyle( RString sChartStyle ); static bool MakeValidEditDescription( RString &sPreferredDescription ); // return true if was modified void SetLoadedFromProfile( ProfileSlot slot ) { m_LoadedFromProfile = slot; } @@ -146,6 +152,8 @@ private: /** @brief The name of the edit, or some other useful description. This used to also contain the step author's name. */ RString m_sDescription; + /** @brief The style of the chart. (e.g. "Pad", "Keyboard") */ + RString m_sChartStyle; /** @brief The difficulty that these steps are assigned to. */ Difficulty m_Difficulty; /** @brief The numeric difficulty of the Steps, ranging from MIN_METER to MAX_METER. */