diff --git a/Docs/Changelog_SSCformat.txt b/Docs/Changelog_SSCformat.txt index 8f7253432e..e79ec62e3d 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.54] - Wolfman2000 +* Add #ATTACKS tag to the Notedata sections. Right now it does nothing. + [v0.53] - Wolfman2000 * Added Fakes to the RadarCategories. Start parsing between versions. * Always write out the latest version to cache and hard drive. diff --git a/src/NotesLoaderSSC.cpp b/src/NotesLoaderSSC.cpp index 1721e01dfa..acc84c9292 100644 --- a/src/NotesLoaderSSC.cpp +++ b/src/NotesLoaderSSC.cpp @@ -910,6 +910,53 @@ bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCach } */ } + else if( sValueName=="ATTACKS" ) + { + // TODO: Look into Step attacks vs Song Attacks. -Wolfman2000 + /* + // Build the RString vector here so we can write it to file again later + for( unsigned s=1; s < sParams.params.size(); ++s ) + out.m_sAttackString.push_back( sParams[s] ); + + Attack attack; + float end = -9999; + + for( unsigned j=1; j < sParams.params.size(); ++j ) + { + vector sBits; + split( sParams[j], "=", sBits, false ); + + // Need an identifer and a value for this to work + if( sBits.size() < 2 ) + continue; + + TrimLeft( sBits[0] ); + TrimRight( sBits[0] ); + + if( !sBits[0].CompareNoCase("TIME") ) + attack.fStartSecond = strtof( sBits[1], NULL ); + else if( !sBits[0].CompareNoCase("LEN") ) + attack.fSecsRemaining = strtof( sBits[1], NULL ); + else if( !sBits[0].CompareNoCase("END") ) + end = strtof( sBits[1], NULL ); + else if( !sBits[0].CompareNoCase("MODS") ) + { + attack.sModifiers = sBits[1]; + + if( end != -9999 ) + { + attack.fSecsRemaining = end - attack.fStartSecond; + end = -9999; + } + + if( attack.fSecsRemaining < 0.0f ) + attack.fSecsRemaining = 0.0f; + + out.m_Attacks.push_back( attack ); + } + } + */ + } else if( sValueName=="OFFSET" ) {/* pNewNotes->m_Timing.m_fBeat0OffsetInSeconds = StringToFloat( sParams[1] ); diff --git a/src/NotesWriterSSC.cpp b/src/NotesWriterSSC.cpp index e26d3d6c69..083d0cfd37 100644 --- a/src/NotesWriterSSC.cpp +++ b/src/NotesWriterSSC.cpp @@ -180,7 +180,7 @@ static void WriteGlobalTags( RageFile &f, const Song &out ) f.Write( "," ); } f.PutLine( ";" ); - + /* ASSERT( !out.m_Timing.m_ComboSegments.empty() ); f.Write( "#COMBOS:" ); @@ -301,6 +301,7 @@ static RString GetSSCNoteData( const Song &song, const Steps &in, bool bSavingCa lines.push_back( "#DELAYS:;" ); lines.push_back( "#TIMESIGNATURES:;" ); lines.push_back( "#TICKCOUNTS:;" ); + lines.push_back( "#ATTACKS:;" ); // lines.push_back( "#COMBOS:;" ); /* @@ -364,6 +365,9 @@ static RString GetSSCNoteData( const Song &song, const Steps &in, bool bSavingCa asComboValues.push_back( ssprintf( "%.6f=%d", NoteRowToBeat(cs.m_iStartRow), cs.m_iComboFactor ) ); } + + lines.push_back( "#ATTACKS:;" ); + lines.push_back( ssprintf( "#COMBOS:%s;", join("\n,", asComboValues).c_str() ) ); lines.push_back( ssprintf( "#OFFSET:%.6f;", in.m_Timing.m_fBeat0OffsetInSeconds ) ); diff --git a/src/Song.h b/src/Song.h index 07d05a7742..6c8fb81def 100644 --- a/src/Song.h +++ b/src/Song.h @@ -17,7 +17,7 @@ struct lua_State; struct BackgroundChange; /** @brief The version of the .ssc file format. */ -const static float STEPFILE_VERSION_NUMBER = 0.53f; +const static float STEPFILE_VERSION_NUMBER = 0.54f; /** @brief How many edits for this song can each profile have? */ const int MAX_EDITS_PER_SONG_PER_PROFILE = 5;