diff --git a/src/SongUtil.cpp b/src/SongUtil.cpp index 36f9aa72ee..02933a784a 100644 --- a/src/SongUtil.cpp +++ b/src/SongUtil.cpp @@ -833,6 +833,21 @@ bool SongUtil::ValidateCurrentStepsDescription( const RString &sAnswer, RString return true; } +bool SongUtil::ValidateCurrentStepsChartName(const RString &answer, RString &error) +{ + if (answer.empty()) return true; + + /* Don't allow duplicate title names within the same StepsType. + * We need some way of identifying the unique charts. */ + Steps *pSteps = GAMESTATE->m_pCurSteps[PLAYER_1]; + + if (pSteps->GetChartName() == answer) return true; + + // TODO next commit: borrow code from EditStepsDescription. + + return true; +} + static LocalizedString AUTHOR_NAME_CANNOT_CONTAIN( "SongUtil", "The step author's name cannot contain any of the following characters: %s" ); bool SongUtil::ValidateCurrentStepsCredit( const RString &sAnswer, RString &sErrorOut ) diff --git a/src/SongUtil.h b/src/SongUtil.h index 4ecbcb8687..acc505da15 100644 --- a/src/SongUtil.h +++ b/src/SongUtil.h @@ -163,6 +163,7 @@ namespace SongUtil bool ValidateCurrentEditStepsDescription( const RString &sAnswer, RString &sErrorOut ); bool ValidateCurrentStepsDescription( const RString &sAnswer, RString &sErrorOut ); bool ValidateCurrentStepsCredit( const RString &sAnswer, RString &sErrorOut ); + bool ValidateCurrentStepsChartName(const RString &answer, RString &error); void GetAllSongGenres( vector &vsOut ); /**