Disable saving ALL steps in the .sm format.
This commit is contained in:
@@ -287,7 +287,7 @@ static RString GetSMNotesTag( const Song &song, const Steps &in )
|
||||
return JoinLineList( lines );
|
||||
}
|
||||
|
||||
bool NotesWriterSM::Write( RString sPath, const Song &out )
|
||||
bool NotesWriterSM::Write( RString sPath, const Song &out, const vector<Steps*>& vpStepsToSave )
|
||||
{
|
||||
int flags = RageFile::WRITE;
|
||||
|
||||
@@ -302,8 +302,6 @@ bool NotesWriterSM::Write( RString sPath, const Song &out )
|
||||
|
||||
WriteGlobalTags( f, out );
|
||||
|
||||
// Save specified Steps to this file
|
||||
const vector<Steps*>& vpStepsToSave = out.GetAllSteps();
|
||||
FOREACH_CONST( Steps*, vpStepsToSave, s )
|
||||
{
|
||||
const Steps* pSteps = *s;
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ namespace NotesWriterSM
|
||||
* @param sPath the path to write the file.
|
||||
* @param out the Song to be written out.
|
||||
* @return its success or failure. */
|
||||
bool Write( RString sPath, const Song &out );
|
||||
bool Write( RString sPath, const Song &out, const vector<Steps*>& vpStepsToSave );
|
||||
/**
|
||||
* @brief Get some contents about the edit file first.
|
||||
* @param pSong the Song in question.
|
||||
|
||||
+16
-1
@@ -925,7 +925,22 @@ bool Song::SaveToSMFile()
|
||||
// If the file exists, make a backup.
|
||||
if( IsAFile(sPath) )
|
||||
FileCopy( sPath, sPath + ".old" );
|
||||
return NotesWriterSM::Write( sPath, *this );
|
||||
|
||||
vector<Steps*> vpStepsToSave;
|
||||
FOREACH_CONST( Steps*, m_vpSteps, s )
|
||||
{
|
||||
Steps *pSteps = *s;
|
||||
if( pSteps->IsAutogen() )
|
||||
continue; // don't write autogen notes
|
||||
|
||||
// Only save steps that weren't loaded from a profile.
|
||||
if( pSteps->WasLoadedFromProfile() )
|
||||
continue;
|
||||
|
||||
vpStepsToSave.push_back( pSteps );
|
||||
}
|
||||
|
||||
return NotesWriterSM::Write( sPath, *this, vpStepsToSave );
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user