Prepare the validator function for chart names.

This commit is contained in:
Jason Felds
2011-07-07 14:19:34 -04:00
parent f16fec8438
commit 061b6e802e
2 changed files with 16 additions and 0 deletions
+15
View File
@@ -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 )
+1
View File
@@ -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<RString> &vsOut );
/**