add #CHARTSTYLE tag to Steps for .ssc files; Keyboard/Pad/whatever else you can think of, just keep it standardized

This commit is contained in:
AJ Kelly
2011-02-14 20:53:15 -06:00
parent db8bc289a3
commit 95af29b5e4
6 changed files with 33 additions and 2 deletions
+3
View File
@@ -9,6 +9,9 @@ change to JSON, but it is unsure if this will be done.
Implement .ssc at your own risk. Implement .ssc at your own risk.
________________________________________________________________________________ ________________________________________________________________________________
[v0.52] - AJ
* Add CHARTSTYLE tag to NoteData section.
[v0.51] - AJ [v0.51] - AJ
* Move VERSION tag to the first line. * Move VERSION tag to the first line.
* Limit VERSION tag to two decimal places. * Limit VERSION tag to two decimal places.
+11
View File
@@ -634,6 +634,11 @@ bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCach
pNewNotes->m_StepsType = GAMEMAN->StringToStepsType( sParams[1] ); pNewNotes->m_StepsType = GAMEMAN->StringToStepsType( sParams[1] );
} }
else if( sValueName=="CHARTSTYLE" )
{
pNewNotes->SetChartStyle( sParams[1] );
}
else if( sValueName=="DESCRIPTION" ) else if( sValueName=="DESCRIPTION" )
{ {
pNewNotes->SetDescription( sParams[1] ); pNewNotes->SetDescription( sParams[1] );
@@ -990,6 +995,12 @@ bool SSCLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePat
bSSCFormat = true; bSSCFormat = true;
} }
else if( sValueName=="CHARTSTYLE" )
{
pNewNotes->SetChartStyle( sParams[1] );
bSSCFormat = true;
}
else if( sValueName=="DESCRIPTION" ) else if( sValueName=="DESCRIPTION" )
{ {
pNewNotes->SetDescription( sParams[1] ); pNewNotes->SetDescription( sParams[1] );
+1
View File
@@ -262,6 +262,7 @@ static RString GetSSCNotesTag( const Song &song, const Steps &in, bool bSavingCa
lines.push_back( "#NOTEDATA:;" ); // our new separator. lines.push_back( "#NOTEDATA:;" ); // our new separator.
lines.push_back( ssprintf( "#STEPSTYPE:%s;", GAMEMAN->GetStepsTypeInfo(in.m_StepsType).szName ) ); lines.push_back( ssprintf( "#STEPSTYPE:%s;", GAMEMAN->GetStepsTypeInfo(in.m_StepsType).szName ) );
lines.push_back( ssprintf( "#DESCRIPTION:%s;", SmEscape(in.GetDescription()).c_str() ) ); lines.push_back( ssprintf( "#DESCRIPTION:%s;", SmEscape(in.GetDescription()).c_str() ) );
lines.push_back( ssprintf( "#CHARTSTYLE:%s;", SmEscape(in.GetChartStyle()).c_str() ) );
lines.push_back( ssprintf( "#DIFFICULTY:%s;", DifficultyToString(in.GetDifficulty()).c_str() ) ); lines.push_back( ssprintf( "#DIFFICULTY:%s;", DifficultyToString(in.GetDifficulty()).c_str() ) );
lines.push_back( ssprintf( "#METER:%d;", in.GetMeter() ) ); lines.push_back( ssprintf( "#METER:%d;", in.GetMeter() ) );
+3 -2
View File
@@ -36,8 +36,9 @@
#include <set> #include <set>
#include <float.h> #include <float.h>
const static float VERSION_NUMBER = 0.51f; /** @brief: The version of the .ssc file format. */
const int FILE_CACHE_VERSION = 163; // increment this to invalidate cache const static float VERSION_NUMBER = 0.52f;
const int FILE_CACHE_VERSION = 164; // increment this to invalidate cache
const float DEFAULT_MUSIC_SAMPLE_LENGTH = 12.f; const float DEFAULT_MUSIC_SAMPLE_LENGTH = 12.f;
+7
View File
@@ -319,6 +319,7 @@ void Steps::DeAutogen( bool bCopyNoteData )
Decompress(); // fills in m_pNoteData with sliding window transform Decompress(); // fills in m_pNoteData with sliding window transform
m_sDescription = Real()->m_sDescription; m_sDescription = Real()->m_sDescription;
m_sChartStyle = Real()->m_sChartStyle;
m_Difficulty = Real()->m_Difficulty; m_Difficulty = Real()->m_Difficulty;
m_iMeter = Real()->m_iMeter; m_iMeter = Real()->m_iMeter;
copy( Real()->m_CachedRadarValues, Real()->m_CachedRadarValues + NUM_PLAYERS, m_CachedRadarValues ); copy( Real()->m_CachedRadarValues, Real()->m_CachedRadarValues + NUM_PLAYERS, m_CachedRadarValues );
@@ -372,6 +373,12 @@ void Steps::SetCredit( RString sCredit )
m_sCredit = sCredit; m_sCredit = sCredit;
} }
void Steps::SetChartStyle( RString sChartStyle )
{
DeAutogen();
m_sChartStyle = sChartStyle;
}
bool Steps::MakeValidEditDescription( RString &sPreferredDescription ) bool Steps::MakeValidEditDescription( RString &sPreferredDescription )
{ {
if( int(sPreferredDescription.size()) > MAX_EDIT_STEPS_DESCRIPTION_LENGTH ) if( int(sPreferredDescription.size()) > MAX_EDIT_STEPS_DESCRIPTION_LENGTH )
+8
View File
@@ -67,6 +67,11 @@ public:
* @return the description used for this edit. * @return the description used for this edit.
*/ */
RString GetDescription() const { return Real()->m_sDescription; } RString GetDescription() const { return Real()->m_sDescription; }
/**
* @brief Retrieve the ChartStyle used for this chart.
* @return the description used for this chart.
*/
RString GetChartStyle() const { return Real()->m_sChartStyle; }
/** /**
* @brief Retrieve the difficulty used for this edit. * @brief Retrieve the difficulty used for this edit.
* @return the difficulty used for this edit. * @return the difficulty used for this edit.
@@ -92,6 +97,7 @@ public:
void SetDescription( RString sDescription ) { SetDifficultyAndDescription( this->GetDifficulty(), sDescription ); } void SetDescription( RString sDescription ) { SetDifficultyAndDescription( this->GetDifficulty(), sDescription ); }
void SetDifficultyAndDescription( Difficulty dc, RString sDescription ); void SetDifficultyAndDescription( Difficulty dc, RString sDescription );
void SetCredit( RString sCredit ); void SetCredit( RString sCredit );
void SetChartStyle( RString sChartStyle );
static bool MakeValidEditDescription( RString &sPreferredDescription ); // return true if was modified static bool MakeValidEditDescription( RString &sPreferredDescription ); // return true if was modified
void SetLoadedFromProfile( ProfileSlot slot ) { m_LoadedFromProfile = slot; } void SetLoadedFromProfile( ProfileSlot slot ) { m_LoadedFromProfile = slot; }
@@ -146,6 +152,8 @@ private:
/** @brief The name of the edit, or some other useful description. /** @brief The name of the edit, or some other useful description.
This used to also contain the step author's name. */ This used to also contain the step author's name. */
RString m_sDescription; RString m_sDescription;
/** @brief The style of the chart. (e.g. "Pad", "Keyboard") */
RString m_sChartStyle;
/** @brief The difficulty that these steps are assigned to. */ /** @brief The difficulty that these steps are assigned to. */
Difficulty m_Difficulty; Difficulty m_Difficulty;
/** @brief The numeric difficulty of the Steps, ranging from MIN_METER to MAX_METER. */ /** @brief The numeric difficulty of the Steps, ranging from MIN_METER to MAX_METER. */