don't allow blank edit names

This commit is contained in:
Chris Danford
2005-04-03 21:23:38 +00:00
parent dbea7450b6
commit 3c5a892b27
+13 -7
View File
@@ -152,14 +152,20 @@ static CString GetCopyDescription( const Steps *pSourceSteps )
static bool ValidateCurrentStepsDescription( CString s, CString &sErrorOut )
{
if( GAMESTATE->m_pCurSteps[0]->GetDifficulty() == DIFFICULTY_EDIT )
ASSERT( GAMESTATE->m_pCurSteps[0]->GetDifficulty() == DIFFICULTY_EDIT );
if( s.empty() )
{
if( !GAMESTATE->m_pCurSong->IsEditDescriptionUnique(GAMESTATE->m_pCurSteps[0]->m_StepsType, s, GAMESTATE->m_pCurSteps[0]) )
{
sErrorOut = "The supplied name supplied conflicts with another edit.\n\nPlease use a different name.";
return false;
}
sErrorOut = "You must supply a name for your new edit.";
return false;
}
if( !GAMESTATE->m_pCurSong->IsEditDescriptionUnique(GAMESTATE->m_pCurSteps[0]->m_StepsType, s, GAMESTATE->m_pCurSteps[0]) )
{
sErrorOut = "The supplied name supplied conflicts with another edit.\n\nPlease use a different name.";
return false;
}
return true;
}
@@ -236,7 +242,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
CString sEditName;
if( pSourceSteps )
{
pSteps->CopyFrom( pSourceSteps, st );
pSteps->CopyFrom( pSourceSteps, st, pSong->m_fMusicLengthSeconds );
sEditName = GetCopyDescription(pSourceSteps);
}
else