mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-09 21:42:13 +00:00
added start script verifier
This commit is contained in:
parent
2e31f01585
commit
0b70fdac57
@ -40,6 +40,7 @@ opencs_units (model/tools
|
|||||||
opencs_units_noqt (model/tools
|
opencs_units_noqt (model/tools
|
||||||
mandatoryid skillcheck classcheck factioncheck racecheck soundcheck regioncheck
|
mandatoryid skillcheck classcheck factioncheck racecheck soundcheck regioncheck
|
||||||
birthsigncheck spellcheck referencecheck referenceablecheck scriptcheck bodypartcheck
|
birthsigncheck spellcheck referencecheck referenceablecheck scriptcheck bodypartcheck
|
||||||
|
startscriptcheck
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
31
apps/opencs/model/tools/startscriptcheck.cpp
Normal file
31
apps/opencs/model/tools/startscriptcheck.cpp
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
#include "startscriptcheck.hpp"
|
||||||
|
|
||||||
|
#include <components/misc/stringops.hpp>
|
||||||
|
|
||||||
|
CSMTools::StartScriptCheckStage::StartScriptCheckStage (
|
||||||
|
const CSMWorld::IdCollection<ESM::StartScript>& startScripts,
|
||||||
|
const CSMWorld::IdCollection<ESM::Script>& scripts)
|
||||||
|
: mStartScripts (startScripts), mScripts (scripts)
|
||||||
|
{}
|
||||||
|
|
||||||
|
void CSMTools::StartScriptCheckStage::perform(int stage, CSMDoc::Messages& messages)
|
||||||
|
{
|
||||||
|
const CSMWorld::Record<ESM::StartScript>& record = mStartScripts.getRecord (stage);
|
||||||
|
|
||||||
|
if (record.isDeleted())
|
||||||
|
return;
|
||||||
|
|
||||||
|
std::string scriptId = record.get().mId;
|
||||||
|
|
||||||
|
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_StartScript, scriptId);
|
||||||
|
|
||||||
|
if (mScripts.searchId (Misc::StringUtils::lowerCase (scriptId))==-1)
|
||||||
|
messages.push_back (
|
||||||
|
std::make_pair (id, "Start script " + scriptId + " does not exist"));
|
||||||
|
}
|
||||||
|
|
||||||
|
int CSMTools::StartScriptCheckStage::setup()
|
||||||
|
{
|
||||||
|
return mStartScripts.getSize();
|
||||||
|
}
|
28
apps/opencs/model/tools/startscriptcheck.hpp
Normal file
28
apps/opencs/model/tools/startscriptcheck.hpp
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#ifndef CSM_TOOLS_STARTSCRIPTCHECK_H
|
||||||
|
#define CSM_TOOLS_STARTSCRIPTCHECK_H
|
||||||
|
|
||||||
|
#include <components/esm/loadsscr.hpp>
|
||||||
|
#include <components/esm/loadscpt.hpp>
|
||||||
|
|
||||||
|
#include "../doc/stage.hpp"
|
||||||
|
|
||||||
|
#include "../world/idcollection.hpp"
|
||||||
|
|
||||||
|
namespace CSMTools
|
||||||
|
{
|
||||||
|
class StartScriptCheckStage : public CSMDoc::Stage
|
||||||
|
{
|
||||||
|
const CSMWorld::IdCollection<ESM::StartScript>& mStartScripts;
|
||||||
|
const CSMWorld::IdCollection<ESM::Script>& mScripts;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
StartScriptCheckStage (const CSMWorld::IdCollection<ESM::StartScript>& startScripts,
|
||||||
|
const CSMWorld::IdCollection<ESM::Script>& scripts);
|
||||||
|
|
||||||
|
virtual void perform(int stage, CSMDoc::Messages& messages);
|
||||||
|
virtual int setup();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -24,6 +24,7 @@
|
|||||||
#include "scriptcheck.hpp"
|
#include "scriptcheck.hpp"
|
||||||
#include "bodypartcheck.hpp"
|
#include "bodypartcheck.hpp"
|
||||||
#include "referencecheck.hpp"
|
#include "referencecheck.hpp"
|
||||||
|
#include "startscriptcheck.hpp"
|
||||||
|
|
||||||
CSMDoc::Operation *CSMTools::Tools::get (int type)
|
CSMDoc::Operation *CSMTools::Tools::get (int type)
|
||||||
{
|
{
|
||||||
@ -84,6 +85,8 @@ CSMDoc::Operation *CSMTools::Tools::getVerifier()
|
|||||||
|
|
||||||
mVerifier->appendStage (new ScriptCheckStage (mDocument));
|
mVerifier->appendStage (new ScriptCheckStage (mDocument));
|
||||||
|
|
||||||
|
mVerifier->appendStage (new StartScriptCheckStage (mData.getStartScripts(), mData.getScripts()));
|
||||||
|
|
||||||
mVerifier->appendStage(
|
mVerifier->appendStage(
|
||||||
new BodyPartCheckStage(
|
new BodyPartCheckStage(
|
||||||
mData.getBodyParts(),
|
mData.getBodyParts(),
|
||||||
|
Loading…
Reference in New Issue
Block a user