forked from mirror/openmw-tes3mp
Fix input validation in StartScriptCreator
This commit is contained in:
parent
b93b97575e
commit
fbca094dda
2 changed files with 4 additions and 16 deletions
|
@ -75,27 +75,15 @@ std::string CSVWorld::StartScriptCreator::getErrors() const
|
|||
std::string errors;
|
||||
if (scriptId.empty())
|
||||
{
|
||||
if (!errors.empty())
|
||||
{
|
||||
errors += "<br>";
|
||||
}
|
||||
errors += "No Script ID entered";
|
||||
errors = "No Script ID entered";
|
||||
}
|
||||
else if (getData().getScripts().searchId(scriptId) == -1)
|
||||
{
|
||||
if (!errors.empty())
|
||||
{
|
||||
errors += "<br>";
|
||||
}
|
||||
errors += "Script ID not found";
|
||||
errors = "Script ID not found";
|
||||
}
|
||||
else if (getData().getStartScripts().searchId(scriptId) > -1)
|
||||
{
|
||||
if (!errors.empty())
|
||||
{
|
||||
errors += "<br>";
|
||||
}
|
||||
errors += "Script with this ID already registered as Start Script";
|
||||
errors = "Script with this ID already registered as Start Script";
|
||||
}
|
||||
|
||||
return errors;
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace CSVWorld
|
|||
const std::string& originId,
|
||||
const CSMWorld::UniversalId::Type type);
|
||||
|
||||
/// \return Formatted error descriptions for current user input.
|
||||
/// \return Error description for current user input.
|
||||
virtual std::string getErrors() const;
|
||||
|
||||
/// \brief Set focus to script ID input widget.
|
||||
|
|
Loading…
Reference in a new issue