Reduce difference with the master branch where possible.

This commit is contained in:
cc9cii 2015-03-06 19:20:50 +11:00
parent 6d6ff8c6a4
commit 727b68dd15
13 changed files with 75 additions and 13 deletions

View file

@ -41,6 +41,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
) )

View file

@ -2,7 +2,6 @@
#include <cassert> #include <cassert>
#include <fstream> #include <fstream>
#include <iostream>
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>

View 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();
}

View 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

View file

@ -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(),

View file

@ -2,13 +2,11 @@
#define CSM_WOLRD_COLLECTION_H #define CSM_WOLRD_COLLECTION_H
#include <vector> #include <vector>
#include <iostream>
#include <map> #include <map>
#include <algorithm> #include <algorithm>
#include <cctype> #include <cctype>
#include <stdexcept> #include <stdexcept>
#include <functional> #include <functional>
#include <cassert>
#include <QVariant> #include <QVariant>

View file

@ -2,7 +2,6 @@
#include "collectionbase.hpp" #include "collectionbase.hpp"
#include <stdexcept> #include <stdexcept>
#include <cassert>
#include "columnbase.hpp" #include "columnbase.hpp"

View file

@ -6,7 +6,6 @@
#include <stdexcept> #include <stdexcept>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <iostream>
#include <QColor> #include <QColor>

View file

@ -46,6 +46,7 @@ QWidget *CSVWorld::EnumDelegate::createEditor(QWidget *parent,
const QModelIndex& index) const const QModelIndex& index) const
{ {
return createEditor(parent, option, index, CSMWorld::ColumnBase::Display_None); return createEditor(parent, option, index, CSMWorld::ColumnBase::Display_None);
//overloading virtual functions is HARD
} }
QWidget *CSVWorld::EnumDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem& option, QWidget *CSVWorld::EnumDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem& option,

View file

@ -185,7 +185,7 @@ namespace MWMechanics
bool missing = true; bool missing = true;
for (std::vector<ActiveEffect>::const_iterator iter(addTo.begin()); iter != addTo.end(); ++iter) for (std::vector<ActiveEffect>::const_iterator iter(addTo.begin()); iter != addTo.end(); ++iter)
{ {
if (effect->mEffectId == iter->mEffectId) if ((effect->mEffectId == iter->mEffectId) && (effect->mArg == iter->mArg))
{ {
missing = false; missing = false;
break; break;

View file

@ -316,6 +316,7 @@ namespace MWScript
store = MWBase::Environment::get().getWorld()->getExterior(cx,cy); store = MWBase::Environment::get().getWorld()->getExterior(cx,cy);
if(!cell) if(!cell)
{ {
runtime.getContext().report ("unknown cell (" + cellID + ")");
std::cerr << "unknown cell (" << cellID << ")\n"; std::cerr << "unknown cell (" << cellID << ")\n";
} }
} }
@ -428,6 +429,7 @@ namespace MWScript
store = MWBase::Environment::get().getWorld()->getExterior(cx,cy); store = MWBase::Environment::get().getWorld()->getExterior(cx,cy);
if(!cell) if(!cell)
{ {
runtime.getContext().report ("unknown cell (" + cellID + ")");
std::cerr << "unknown cell (" << cellID << ")\n"; std::cerr << "unknown cell (" << cellID << ")\n";
} }
} }

View file

@ -183,6 +183,7 @@ void ContentSelectorView::ContentSelector::setGameFileSelected(int index, bool s
void ContentSelectorView::ContentSelector::slotAddonTableItemActivated(const QModelIndex &index) void ContentSelectorView::ContentSelector::slotAddonTableItemActivated(const QModelIndex &index)
{ {
// toggles check state when an AddOn file is double clicked or activated by keyboard
QModelIndex sourceIndex = mAddonProxyModel->mapToSource (index); QModelIndex sourceIndex = mAddonProxyModel->mapToSource (index);
if (!mContentModel->isEnabled (sourceIndex)) if (!mContentModel->isEnabled (sourceIndex))