Preparing for a new #TAG, "WARNINGS".
There needs to be a place for warnings on a stepfile without using #TITLE, #SUBTITLE, or #ARTIST. This tag will hopefully be that new place. No version or cache incrementing yet: it's still not complete. Still, what's here shouldn't harm anything.
This commit is contained in:
@@ -145,6 +145,16 @@ void SSCLoader::ProcessScrolls( TimingData &out, const RString sParam )
|
||||
}
|
||||
}
|
||||
|
||||
void SSCLoader::ProcessWarnings( Steps *out, const RString param)
|
||||
{
|
||||
vector<RString> splitWarnings;
|
||||
split(param, ",", splitWarnings);
|
||||
|
||||
FOREACH(RString, splitWarnings, s)
|
||||
{
|
||||
out->SetWarning(*s);
|
||||
}
|
||||
}
|
||||
|
||||
bool SSCLoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCache )
|
||||
{
|
||||
@@ -446,6 +456,10 @@ bool SSCLoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach
|
||||
}
|
||||
case GETTING_STEP_INFO:
|
||||
{
|
||||
if (sValueName=="WARNINGS")
|
||||
{
|
||||
ProcessWarnings(pNewNotes, sParams[1]);
|
||||
}
|
||||
if( sValueName=="STEPSTYPE" )
|
||||
{
|
||||
pNewNotes->m_StepsType = GAMEMAN->StringToStepsType( sParams[1] );
|
||||
|
||||
@@ -68,6 +68,8 @@ struct SSCLoader : public SMLoader
|
||||
void ProcessLabels( TimingData &, const RString );
|
||||
virtual void ProcessCombos( TimingData &, const RString, const int = -1 );
|
||||
void ProcessScrolls( TimingData &, const RString );
|
||||
|
||||
void ProcessWarnings( Steps *out, const RString param);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -507,6 +507,12 @@ public:
|
||||
lua_pushstring( L, out );
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int GetWarnings(T *p, lua_State *L)
|
||||
{
|
||||
lua_pushstring(L, p->GetWarningsToSetString());
|
||||
return 1;
|
||||
}
|
||||
|
||||
LunaSteps()
|
||||
{
|
||||
@@ -521,6 +527,7 @@ public:
|
||||
ADD_METHOD( HasAttacks );
|
||||
ADD_METHOD( GetRadarValues );
|
||||
ADD_METHOD( GetTimingData );
|
||||
ADD_METHOD( GetWarnings );
|
||||
//ADD_METHOD( GetSMNoteData );
|
||||
ADD_METHOD( GetStepsType );
|
||||
ADD_METHOD( IsAnEdit );
|
||||
|
||||
+32
@@ -98,6 +98,35 @@ public:
|
||||
/** @brief The stringified list of attacks. */
|
||||
vector<RString> m_sAttackString;
|
||||
|
||||
set<RString> GetWarnings() const
|
||||
{
|
||||
return this->chartWarnings;
|
||||
}
|
||||
|
||||
RString GetWarningsToSetString() const
|
||||
{
|
||||
RString ret = "";
|
||||
set<RString> tmp = this->GetWarnings();
|
||||
unsigned index = 0;
|
||||
FOREACHS_CONST(RString, tmp, s)
|
||||
{
|
||||
ret += *s;
|
||||
if (++index < tmp.size())
|
||||
ret += ",";
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void SetWarning(const RString warning)
|
||||
{
|
||||
this->chartWarnings.insert(warning);
|
||||
}
|
||||
|
||||
void EraseWarnings()
|
||||
{
|
||||
this->chartWarnings.clear();
|
||||
}
|
||||
|
||||
void SetFilename( RString fn ) { m_sFilename = fn; }
|
||||
RString GetFilename() const { return m_sFilename; }
|
||||
void SetSavedToDisk( bool b ) { DeAutogen(); m_bSavedToDisk = b; }
|
||||
@@ -194,6 +223,9 @@ private:
|
||||
bool m_bAreCachedRadarValuesJustLoaded;
|
||||
/** @brief The name of the person who created the Steps. */
|
||||
RString m_sCredit;
|
||||
|
||||
/** @brief The list of warnings found in a chart. */
|
||||
set<RString> chartWarnings;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user