From 530afdf8fa57ff1804160fbba857a6389ba6c854 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 17 Apr 2011 22:54:51 -0400 Subject: [PATCH 1/5] New branch: [sm130attacks]. Look into allowing song attacks again. --- src/NotesLoaderSM.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/NotesLoaderSM.cpp b/src/NotesLoaderSM.cpp index 7fa211df32..f1ab8ec5ad 100644 --- a/src/NotesLoaderSM.cpp +++ b/src/NotesLoaderSM.cpp @@ -10,6 +10,7 @@ #include "Song.h" #include "SongManager.h" #include "Steps.h" +#include "Attack.h" #include "PrefsManager.h" /** @brief The maximum file size for edits. */ @@ -468,7 +469,7 @@ bool SMLoader::LoadFromSMFile( const RString &sPath, Song &out, bool bFromCache // handle the data /* Don't use GetMainAndSubTitlesFromFullTitle; that's only for heuristically - * splitting other formats that *don't* natively support #SUBTITLE. */ + * splitting other formats that *don't* natively support #SUBTITLE. */ if( sValueName=="TITLE" ) out.m_sMainTitle = sParams[1]; @@ -540,7 +541,7 @@ bool SMLoader::LoadFromSMFile( const RString &sPath, Song &out, bool bFromCache ; /* ignore */ /* We calculate these. Some SMs in circulation have bogus values for - * these, so make sure we always calculate it ourself. */ + * these, so make sure we always calculate it ourself. */ else if( sValueName=="FIRSTBEAT" ) { if( bFromCache ) From dae89e1fd157b78c4aaceeaef2fbb010e5f96bb1 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 17 Apr 2011 23:03:39 -0400 Subject: [PATCH 2/5] [sm130attacks] Minor cleanup before testing. --- src/NotesLoaderSSC.cpp | 1 + src/NotesWriterSM.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/NotesLoaderSSC.cpp b/src/NotesLoaderSSC.cpp index 70d8947079..cd1fdcf9cf 100644 --- a/src/NotesLoaderSSC.cpp +++ b/src/NotesLoaderSSC.cpp @@ -11,6 +11,7 @@ #include "Song.h" #include "SongManager.h" #include "Steps.h" +#include "Attack.h" #include "PrefsManager.h" /** diff --git a/src/NotesWriterSM.cpp b/src/NotesWriterSM.cpp index 920081509a..c50c9890f5 100644 --- a/src/NotesWriterSM.cpp +++ b/src/NotesWriterSM.cpp @@ -134,6 +134,19 @@ static void WriteGlobalTags( RageFile &f, const Song &out ) } } f.PutLine( ";" ); + + f.Write( "#ATTACKS:" ); + for( unsigned j = 0; j < out.m_Attacks.size(); j++ ) + { + const Attack &a = out.m_Attacks[j]; + f.Write( ssprintf( "TIME=%.2f:LEN=%.2f:MODS=%s", + a.fStartSecond, a.fSecsRemaining, a.sModifiers.c_str() ) ); + + if( j+1 < out.m_Attacks.size() ) + f.Write( ":" ); + f.PutLine( "" ); + } + f.PutLine( ";" ); f.Write( "#DELAYS:" ); for( unsigned i=0; i Date: Sun, 17 Apr 2011 23:06:05 -0400 Subject: [PATCH 3/5] [sm130attacks] Force reload the cache here. Unsure if this will warrant a .ssc version increase. --- src/Song.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Song.cpp b/src/Song.cpp index aa8128bb5e..0554985d4e 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 = 168; +const int FILE_CACHE_VERSION = 169; /** @brief How long does a song sample last by default? */ const float DEFAULT_MUSIC_SAMPLE_LENGTH = 12.f; From 42acc3346e6960c01e6d057f76d93eb6f5a6d2e6 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 17 Apr 2011 23:27:01 -0400 Subject: [PATCH 4/5] [sm130attacks] Allow SongAttacks by default. When SplitTiming gets in, perhaps rename to StepAttacks? --- Themes/_fallback/metrics.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index 3f9a5e0371..cca76fb1d9 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -2289,10 +2289,10 @@ Mines,4="mod,attackmines;name,AttackMines" # Mines,4="mod,attackmines;name,AttackMines" Attacks="3" -AttacksDefault="mod,no randomattacks,no songattacks" -Attacks,1="name,Off" +AttacksDefault="mod,songattacks" +Attacks,1="mod,no randomattacks,no songattacks;name,Off" Attacks,2="mod,randomattacks;name,RandomAttacks" -Attacks,3="mod,songattacks;name,SongAttacks" +Attacks,3="name,SongAttacks" PlayerAutoPlay="2" PlayerAutoPlayDefault="mod,no playerautoplay" From 6cc8e006cd26e12010b797e36172ca95cb8e0e7b Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 17 Apr 2011 23:58:51 -0400 Subject: [PATCH 5/5] [sm130attacks] Allow attack options in ScreenEdit. Unfortunately, the previous song attacks by default commit didn't work properly. Assistance may be needed. --- Themes/_fallback/metrics.ini | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index cca76fb1d9..ecb55fe99d 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -2290,9 +2290,9 @@ Mines,4="mod,attackmines;name,AttackMines" Attacks="3" AttacksDefault="mod,songattacks" -Attacks,1="mod,no randomattacks,no songattacks;name,Off" +Attacks,3="mod,no randomattacks,no songattacks;name,Off" Attacks,2="mod,randomattacks;name,RandomAttacks" -Attacks,3="name,SongAttacks" +Attacks,1="name,SongAttacks" PlayerAutoPlay="2" PlayerAutoPlayDefault="mod,no playerautoplay" @@ -3620,7 +3620,7 @@ CancelTransitionsOut=true PlayMusic=false TimerSeconds=-1 ShowStyleIcon=false -LineNames="1,2,3,4,5,6,R,7,8,9,10,11,12,13,14,15,16" +LineNames="1,2,3,4,5,6,R,7,8,9,10,Attacks,11,12,13,14,15,16" Line1="list,Speed" Line2="list,Accel" Line3="list,Effect" @@ -3632,6 +3632,7 @@ Line7="list,Scroll" Line8="list,NoteSkins" Line9="list,Holds" Line10="list,Mines" +LineAttacks="list,Attacks" Line11="list,Hide" Line12="list,Persp" Line13="list,Assist"