Add cancel transition for STextEntry

Validate new edit name is unique
This commit is contained in:
Chris Danford
2005-03-23 05:12:31 +00:00
parent 4c3b100c16
commit 6adaa3f1a2
9 changed files with 86 additions and 41 deletions
+14
View File
@@ -147,6 +147,19 @@ static CString GetCopyDescription( const Steps *pSourceSteps )
return s;
}
static bool ValidateCurrentStepsDescription( CString s, CString &sErrorOut )
{
if( GAMESTATE->m_pCurSteps[0]->GetDifficulty() == DIFFICULTY_EDIT )
{
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. Please use a different name.";
return false;
}
}
return true;
}
static void SetCurrentStepsDescription( CString s )
{
GAMESTATE->m_pCurSteps[0]->SetDescription( s );
@@ -277,6 +290,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
"Name the new edit.",
GAMESTATE->m_pCurSteps[0]->GetDescription(),
MAX_DESCRIPTION_LENGTH,
ValidateCurrentStepsDescription,
SetCurrentStepsDescription,
DeleteCurrentSteps );
}