Trim chart name, description, and credit after loading them from the simfile.

This commit is contained in:
Kyzentun Keeslala
2016-06-29 19:33:36 -06:00
parent e590616873
commit 2a2007b9c8
2 changed files with 9 additions and 4 deletions
+8 -3
View File
@@ -108,6 +108,7 @@ void SetOrigin(SongTagInfo& info)
void SetCredit(SongTagInfo& info) void SetCredit(SongTagInfo& info)
{ {
info.song->m_sCredit = (*info.params)[1]; info.song->m_sCredit = (*info.params)[1];
Trim(info.song->m_sCredit);
} }
void SetBanner(SongTagInfo& info) void SetBanner(SongTagInfo& info)
{ {
@@ -313,7 +314,9 @@ void SetStepsVersion(StepsTagInfo& info)
} }
void SetChartName(StepsTagInfo& info) void SetChartName(StepsTagInfo& info)
{ {
info.steps->SetChartName((*info.params)[1]); RString name= (*info.params)[1];
Trim(name);
info.steps->SetChartName(name);
} }
void SetStepsType(StepsTagInfo& info) void SetStepsType(StepsTagInfo& info)
{ {
@@ -328,13 +331,15 @@ void SetChartStyle(StepsTagInfo& info)
} }
void SetDescription(StepsTagInfo& info) void SetDescription(StepsTagInfo& info)
{ {
RString name= (*info.params)[1];
Trim(name);
if(info.song->m_fVersion < VERSION_CHART_NAME_TAG && !info.for_load_edit) if(info.song->m_fVersion < VERSION_CHART_NAME_TAG && !info.for_load_edit)
{ {
info.steps->SetChartName((*info.params)[1]); info.steps->SetChartName(name);
} }
else else
{ {
info.steps->SetDescription((*info.params)[1]); info.steps->SetDescription(name);
} }
info.ssc_format= true; info.ssc_format= true;
} }
+1 -1
View File
@@ -45,7 +45,7 @@
* @brief The internal version of the cache for StepMania. * @brief The internal version of the cache for StepMania.
* *
* Increment this value to invalidate the current cache. */ * Increment this value to invalidate the current cache. */
const int FILE_CACHE_VERSION = 226; const int FILE_CACHE_VERSION = 227;
/** @brief How long does a song sample last by default? */ /** @brief How long does a song sample last by default? */
const float DEFAULT_MUSIC_SAMPLE_LENGTH = 12.f; const float DEFAULT_MUSIC_SAMPLE_LENGTH = 12.f;