mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-23 00:09:42 +00:00
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;
|
std::string errors;
|
||||||
if (scriptId.empty())
|
if (scriptId.empty())
|
||||||
{
|
{
|
||||||
if (!errors.empty())
|
errors = "No Script ID entered";
|
||||||
{
|
|
||||||
errors += "<br>";
|
|
||||||
}
|
|
||||||
errors += "No Script ID entered";
|
|
||||||
}
|
}
|
||||||
else if (getData().getScripts().searchId(scriptId) == -1)
|
else if (getData().getScripts().searchId(scriptId) == -1)
|
||||||
{
|
{
|
||||||
if (!errors.empty())
|
errors = "Script ID not found";
|
||||||
{
|
|
||||||
errors += "<br>";
|
|
||||||
}
|
|
||||||
errors += "Script ID not found";
|
|
||||||
}
|
}
|
||||||
else if (getData().getStartScripts().searchId(scriptId) > -1)
|
else if (getData().getStartScripts().searchId(scriptId) > -1)
|
||||||
{
|
{
|
||||||
if (!errors.empty())
|
errors = "Script with this ID already registered as Start Script";
|
||||||
{
|
|
||||||
errors += "<br>";
|
|
||||||
}
|
|
||||||
errors += "Script with this ID already registered as Start Script";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return errors;
|
return errors;
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace CSVWorld
|
||||||
const std::string& originId,
|
const std::string& originId,
|
||||||
const CSMWorld::UniversalId::Type type);
|
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;
|
virtual std::string getErrors() const;
|
||||||
|
|
||||||
/// \brief Set focus to script ID input widget.
|
/// \brief Set focus to script ID input widget.
|
||||||
|
|
Loading…
Reference in a new issue