diff --git a/src/Attack.cpp b/src/Attack.cpp index 1bf2c8623b..568b83ec4c 100644 --- a/src/Attack.cpp +++ b/src/Attack.cpp @@ -91,6 +91,19 @@ bool AttackArray::ContainsTransformOrTurn() const return false; } +vector AttackArray::ToVectorString() const +{ + vector ret; + FOREACH_CONST( Attack, *this, a ) + { + ret.push_back(ssprintf("TIME=%f:LEN=%f:MODS=%s", + a->fStartSecond, + a->fSecsRemaining, + a->sModifiers.c_str())); + } + return ret; +} + /* * (c) 2003-2004 Chris Danford * All rights reserved. diff --git a/src/Attack.h b/src/Attack.h index 7eadbe4937..9e3ae45310 100644 --- a/src/Attack.h +++ b/src/Attack.h @@ -71,6 +71,11 @@ struct AttackArray : public vector * @brief Determine if the list of attacks contains a transform or turn mod. * @return true if it does, or false otherwise. */ bool ContainsTransformOrTurn() const; + + /** + * @brief Return a string representation used for simfiles. + * @return the string representation. */ + vector ToVectorString() const; }; #endif diff --git a/src/NotesWriterSSC.cpp b/src/NotesWriterSSC.cpp index 4d42f22f9d..4071b4dd7b 100644 --- a/src/NotesWriterSSC.cpp +++ b/src/NotesWriterSSC.cpp @@ -329,7 +329,8 @@ static RString GetSSCNoteData( const Song &song, const Steps &in, bool bSavingCa if( a != (in.m_sAttackString.size() - 1) ) attacks += ":"; // Not the end, so write a divider ':' } - lines.push_back( ssprintf( "#ATTACKS%s;", attacks.c_str())); + Trim(attacks, ":"); // just in case something screwy happens. + lines.push_back( ssprintf( "#ATTACKS:%s;", attacks.c_str())); lines.push_back( ssprintf( "#OFFSET:%.6f;", in.m_Timing.m_fBeat0OffsetInSeconds ) ); diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 237d8a3801..47f6448c44 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -3525,6 +3525,12 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector &iAns // copy edit into current Steps m_pSteps->SetNoteData( m_NoteDataEdit ); + + // don't forget the attacks. + m_pSong->m_Attacks = GAMESTATE->m_pCurSong->m_Attacks; + m_pSong->m_sAttackString = GAMESTATE->m_pCurSong->m_Attacks.ToVectorString(); + m_pSteps->m_Attacks = GAMESTATE->m_pCurSteps[PLAYER_1]->m_Attacks; + m_pSteps->m_sAttackString = GAMESTATE->m_pCurSteps[PLAYER_1]->m_Attacks.ToVectorString(); switch( EDIT_MODE.GetValue() ) { diff --git a/src/Song.cpp b/src/Song.cpp index df12a2c63d..72c2001fd4 100644 --- a/src/Song.cpp +++ b/src/Song.cpp @@ -41,7 +41,7 @@ * @brief The internal version of the cache for StepMania. * * Increment this value to invalidate the current cache. */ -const int FILE_CACHE_VERSION = 183; +const int FILE_CACHE_VERSION = 184; /** @brief How long does a song sample last by default? */ const float DEFAULT_MUSIC_SAMPLE_LENGTH = 12.f;