mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:23:52 +00:00
Added StartScriptCreator class with redefined getErrors method.
This commit is contained in:
parent
435e52306a
commit
3f27c85630
2 changed files with 51 additions and 0 deletions
26
apps/opencs/view/world/startscriptcreator.cpp
Normal file
26
apps/opencs/view/world/startscriptcreator.cpp
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
#include "startscriptcreator.hpp"
|
||||||
|
|
||||||
|
StartScriptCreator::StartScriptCreator()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CSVWORLD::StartScriptCreator::StartScriptCreator(CSMWorld::Data &data, QUndoStack &undoStack, const CSMWorld::UniversalId &id, bool relaxedIdRules):
|
||||||
|
GenericCreator (data, undoStack, id, true)
|
||||||
|
{}
|
||||||
|
|
||||||
|
std::string CSVWORLD::StartScriptCreator::getErrors() const
|
||||||
|
{
|
||||||
|
std::string errors;
|
||||||
|
|
||||||
|
errors = getIdValidatorResult();
|
||||||
|
if (errors.length() > 0)
|
||||||
|
return errors;
|
||||||
|
else if (getData().getScripts().searchId(getId()) == -1)
|
||||||
|
errors = "Script ID not found";
|
||||||
|
else if (getData().getStartScripts().searchId(getId()) > -1 )
|
||||||
|
errors = "Script with this ID already registered as Start Script";
|
||||||
|
|
||||||
|
return errors;
|
||||||
|
}
|
25
apps/opencs/view/world/startscriptcreator.hpp
Normal file
25
apps/opencs/view/world/startscriptcreator.hpp
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
#ifndef STARTSCRIPTCREATOR_HPP
|
||||||
|
#define STARTSCRIPTCREATOR_HPP
|
||||||
|
|
||||||
|
#include "genericcreator.hpp"
|
||||||
|
|
||||||
|
namespace CSVWORLD {
|
||||||
|
|
||||||
|
class StartScriptCreator : public GenericCreator
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
StartScriptCreator(CSMWorld::Data& data, QUndoStack& undoStack,
|
||||||
|
const CSMWorld::UniversalId& id, bool relaxedIdRules = false);
|
||||||
|
|
||||||
|
virtual std::string getErrors() const;
|
||||||
|
///< Return formatted error descriptions for the current state of the creator. if an empty
|
||||||
|
/// string is returned, there is no error.
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif // STARTSCRIPTCREATOR_HPP
|
Loading…
Reference in a new issue