Merge remote-tracking branch 'zini/master' into nifogre
Conflicts: components/nifogre/ogrenifloader.cppactorid
commit
01a1a0b846
@ -0,0 +1,39 @@
|
|||||||
|
|
||||||
|
#include "birthsigncheck.hpp"
|
||||||
|
|
||||||
|
#include <sstream>
|
||||||
|
#include <map>
|
||||||
|
|
||||||
|
#include <components/esm/loadbsgn.hpp>
|
||||||
|
|
||||||
|
#include "../world/universalid.hpp"
|
||||||
|
|
||||||
|
CSMTools::BirthsignCheckStage::BirthsignCheckStage (const CSMWorld::IdCollection<ESM::BirthSign>& birthsigns)
|
||||||
|
: mBirthsigns (birthsigns)
|
||||||
|
{}
|
||||||
|
|
||||||
|
int CSMTools::BirthsignCheckStage::setup()
|
||||||
|
{
|
||||||
|
return mBirthsigns.getSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSMTools::BirthsignCheckStage::perform (int stage, std::vector<std::string>& messages)
|
||||||
|
{
|
||||||
|
const ESM::BirthSign& birthsign = mBirthsigns.getRecord (stage).get();
|
||||||
|
|
||||||
|
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Birthsign, birthsign.mId);
|
||||||
|
|
||||||
|
// test for empty name, description and texture
|
||||||
|
if (birthsign.mName.empty())
|
||||||
|
messages.push_back (id.toString() + "|" + birthsign.mId + " has an empty name");
|
||||||
|
|
||||||
|
if (birthsign.mDescription.empty())
|
||||||
|
messages.push_back (id.toString() + "|" + birthsign.mId + " has an empty description");
|
||||||
|
|
||||||
|
if (birthsign.mTexture.empty())
|
||||||
|
messages.push_back (id.toString() + "|" + birthsign.mId + " is missing a texture");
|
||||||
|
|
||||||
|
/// \todo test if the texture exists
|
||||||
|
|
||||||
|
/// \todo check data members that can't be edited in the table view
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
#ifndef CSM_TOOLS_BIRTHSIGNCHECK_H
|
||||||
|
#define CSM_TOOLS_BIRTHSIGNCHECK_H
|
||||||
|
|
||||||
|
#include <components/esm/loadbsgn.hpp>
|
||||||
|
|
||||||
|
#include "../world/idcollection.hpp"
|
||||||
|
|
||||||
|
#include "stage.hpp"
|
||||||
|
|
||||||
|
namespace CSMTools
|
||||||
|
{
|
||||||
|
/// \brief VerifyStage: make sure that birthsign records are internally consistent
|
||||||
|
class BirthsignCheckStage : public Stage
|
||||||
|
{
|
||||||
|
const CSMWorld::IdCollection<ESM::BirthSign>& mBirthsigns;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
BirthsignCheckStage (const CSMWorld::IdCollection<ESM::BirthSign>& birthsigns);
|
||||||
|
|
||||||
|
virtual int setup();
|
||||||
|
///< \return number of steps
|
||||||
|
|
||||||
|
virtual void perform (int stage, std::vector<std::string>& messages);
|
||||||
|
///< Messages resulting from this tage will be appended to \a messages.
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue