Attacks can be saved in the editor.

It's more flexible to do it by hand though.
This commit is contained in:
Jason Felds
2011-06-24 22:11:07 -04:00
parent f3ddbf5d2a
commit 5ce88d4b54
5 changed files with 27 additions and 2 deletions
+13
View File
@@ -91,6 +91,19 @@ bool AttackArray::ContainsTransformOrTurn() const
return false;
}
vector<RString> AttackArray::ToVectorString() const
{
vector<RString> 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.
+5
View File
@@ -71,6 +71,11 @@ struct AttackArray : public vector<Attack>
* @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<RString> ToVectorString() const;
};
#endif
+2 -1
View File
@@ -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 ) );
+6
View File
@@ -3525,6 +3525,12 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector<int> &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() )
{
+1 -1
View File
@@ -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;