1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-30 06:36:44 +00:00

Update class and race record verifier messages

This commit is contained in:
Capostrophic 2018-08-24 21:15:43 +03:00
parent fd1a3ad88d
commit 7535daa94d
2 changed files with 13 additions and 14 deletions

View file

@ -37,11 +37,11 @@ void CSMTools::ClassCheckStage::perform (int stage, CSMDoc::Messages& messages)
// A class should have a name // A class should have a name
if (class_.mName.empty()) if (class_.mName.empty())
messages.push_back (std::make_pair (id, class_.mId + " doesn't have a name")); messages.push_back (std::make_pair (id, "Name is missing"));
// A playable class should have a description // A playable class should have a description
if (class_.mData.mIsPlayable != 0 && class_.mDescription.empty()) if (class_.mData.mIsPlayable != 0 && class_.mDescription.empty())
messages.push_back (std::make_pair (id, class_.mId + " doesn't have a description and it's playable")); messages.push_back (std::make_pair (id, "Description of a playable class is missing"));
// test for invalid attributes // test for invalid attributes
for (int i=0; i<2; ++i) for (int i=0; i<2; ++i)
@ -49,14 +49,14 @@ void CSMTools::ClassCheckStage::perform (int stage, CSMDoc::Messages& messages)
{ {
std::ostringstream stream; std::ostringstream stream;
stream << "Attribute #" << i << " of " << class_.mId << " is not set"; stream << "Attribute #" << i << " is not set";
messages.push_back (std::make_pair (id, stream.str())); messages.push_back (std::make_pair (id, stream.str()));
} }
if (class_.mData.mAttribute[0]==class_.mData.mAttribute[1] && class_.mData.mAttribute[0]!=-1) if (class_.mData.mAttribute[0]==class_.mData.mAttribute[1] && class_.mData.mAttribute[0]!=-1)
{ {
messages.push_back (std::make_pair (id, "Class lists same attribute twice")); messages.push_back (std::make_pair (id, "Same attribute is listed twice"));
} }
// test for non-unique skill // test for non-unique skill
@ -66,10 +66,9 @@ void CSMTools::ClassCheckStage::perform (int stage, CSMDoc::Messages& messages)
for (int i2=0; i2<2; ++i2) for (int i2=0; i2<2; ++i2)
++skills[class_.mData.mSkills[i][i2]]; ++skills[class_.mData.mSkills[i][i2]];
for (std::map<int, int>::const_iterator iter (skills.begin()); iter!=skills.end(); ++iter) for (auto &skill : skills)
if (iter->second>1) if (skill.second>1)
{ {
messages.push_back (std::make_pair (id, messages.push_back (std::make_pair (id, "Skill " + ESM::Skill::indexToId (skill.first) + " is listed more than once"));
ESM::Skill::indexToId (iter->first) + " is listed more than once"));
} }
} }

View file

@ -29,24 +29,24 @@ void CSMTools::RaceCheckStage::performPerRecord (int stage, CSMDoc::Messages& me
// test for empty name and description // test for empty name and description
if (race.mName.empty()) if (race.mName.empty())
messages.push_back (std::make_pair (id, race.mId + " has an empty name")); messages.push_back (std::make_pair (id, "Name is missing"));
if (race.mDescription.empty()) if (race.mDescription.empty())
messages.push_back (std::make_pair (id, race.mId + " has an empty description")); messages.push_back (std::make_pair (id, "Description is missing"));
// test for positive height // test for positive height
if (race.mData.mHeight.mMale<=0) if (race.mData.mHeight.mMale<=0)
messages.push_back (std::make_pair (id, "male " + race.mId + " has non-positive height")); messages.push_back (std::make_pair (id, "Male height is non-positive"));
if (race.mData.mHeight.mFemale<=0) if (race.mData.mHeight.mFemale<=0)
messages.push_back (std::make_pair (id, "female " + race.mId + " has non-positive height")); messages.push_back (std::make_pair (id, "Female height is non-positive"));
// test for non-negative weight // test for non-negative weight
if (race.mData.mWeight.mMale<0) if (race.mData.mWeight.mMale<0)
messages.push_back (std::make_pair (id, "male " + race.mId + " has negative weight")); messages.push_back (std::make_pair (id, "Male weight is negative"));
if (race.mData.mWeight.mFemale<0) if (race.mData.mWeight.mFemale<0)
messages.push_back (std::make_pair (id, "female " + race.mId + " has negative weight")); messages.push_back (std::make_pair (id, "Female weight is negative"));
/// \todo check data members that can't be edited in the table view /// \todo check data members that can't be edited in the table view
} }