1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-31 14:36:39 +00:00

Update region and pathgrid record verifier messages

This commit is contained in:
Capostrophic 2018-08-24 22:01:08 +03:00
parent a9ce155a7b
commit 14ef145b3b
2 changed files with 19 additions and 20 deletions

View file

@ -37,9 +37,9 @@ void CSMTools::PathgridCheckStage::perform (int stage, CSMDoc::Messages& message
// check the number of pathgrid points // check the number of pathgrid points
if (pathgrid.mData.mS2 < static_cast<int>(pathgrid.mPoints.size())) if (pathgrid.mData.mS2 < static_cast<int>(pathgrid.mPoints.size()))
messages.add (id, pathgrid.mId + " has less points than expected", "", CSMDoc::Message::Severity_Error); messages.add (id, "Less points than expected", "", CSMDoc::Message::Severity_Error);
else if (pathgrid.mData.mS2 > static_cast<int>(pathgrid.mPoints.size())) else if (pathgrid.mData.mS2 > static_cast<int>(pathgrid.mPoints.size()))
messages.add (id, pathgrid.mId + " has more points than expected", "", CSMDoc::Message::Severity_Error); messages.add (id, "More points than expected", "", CSMDoc::Message::Severity_Error);
std::vector<CSMTools::Point> pointList(pathgrid.mPoints.size()); std::vector<CSMTools::Point> pointList(pathgrid.mPoints.size());
std::vector<int> duplList; std::vector<int> duplList;
@ -56,9 +56,9 @@ void CSMTools::PathgridCheckStage::perform (int stage, CSMDoc::Messages& message
if (pointList[pathgrid.mEdges[i].mV0].mOtherIndex[j] == pathgrid.mEdges[i].mV1) if (pointList[pathgrid.mEdges[i].mV0].mOtherIndex[j] == pathgrid.mEdges[i].mV1)
{ {
std::ostringstream ss; std::ostringstream ss;
ss << "has a duplicate edge between points" << pathgrid.mEdges[i].mV0 ss << "Duplicate edge between points"
<< " and " << pathgrid.mEdges[i].mV1; << pathgrid.mEdges[i].mV0 << " and " << pathgrid.mEdges[i].mV1;
messages.add (id, pathgrid.mId + ss.str(), "", CSMDoc::Message::Severity_Error); messages.add (id, ss.str(), "", CSMDoc::Message::Severity_Error);
break; break;
} }
} }
@ -70,8 +70,8 @@ void CSMTools::PathgridCheckStage::perform (int stage, CSMDoc::Messages& message
else else
{ {
std::ostringstream ss; std::ostringstream ss;
ss << " has an edge connecting a non-existent point " << pathgrid.mEdges[i].mV0; ss << "An edge is connected to a non-existent point " << pathgrid.mEdges[i].mV0;
messages.add (id, pathgrid.mId + ss.str(), "", CSMDoc::Message::Severity_Error); messages.add (id, ss.str(), "", CSMDoc::Message::Severity_Error);
} }
} }
@ -93,8 +93,8 @@ void CSMTools::PathgridCheckStage::perform (int stage, CSMDoc::Messages& message
if (!foundReverse) if (!foundReverse)
{ {
std::ostringstream ss; std::ostringstream ss;
ss << " has a missing edge between points " << i << " and " << pointList[i].mOtherIndex[j]; ss << "Missing edge between points " << i << " and " << pointList[i].mOtherIndex[j];
messages.add (id, pathgrid.mId + ss.str(), "", CSMDoc::Message::Severity_Error); messages.add (id, ss.str(), "", CSMDoc::Message::Severity_Error);
} }
} }
@ -113,11 +113,9 @@ void CSMTools::PathgridCheckStage::perform (int stage, CSMDoc::Messages& message
if (it == duplList.end()) if (it == duplList.end())
{ {
std::ostringstream ss; std::ostringstream ss;
ss << " has a duplicated point (" << i ss << "Point " << i << " duplicates point " << j
<< ") x=" << pathgrid.mPoints[i].mX << " (" << pathgrid.mPoints[i].mX << ", " << pathgrid.mPoints[i].mY << ", " << pathgrid.mPoints[i].mZ << ")";
<< ", y=" << pathgrid.mPoints[i].mY messages.add (id, ss.str(), "", CSMDoc::Message::Severity_Warning);
<< ", z=" << pathgrid.mPoints[i].mZ;
messages.add (id, pathgrid.mId + ss.str(), "", CSMDoc::Message::Severity_Warning);
duplList.push_back(i); duplList.push_back(i);
break; break;
@ -132,11 +130,12 @@ void CSMTools::PathgridCheckStage::perform (int stage, CSMDoc::Messages& message
if (pointList[i].mConnectionNum == 0) if (pointList[i].mConnectionNum == 0)
{ {
std::ostringstream ss; std::ostringstream ss;
ss << " has an orphaned point (" << i ss << "Point " << i << " ("
<< ") x=" << pathgrid.mPoints[i].mX << pathgrid.mPoints[i].mX << ", "
<< ", y=" << pathgrid.mPoints[i].mY << pathgrid.mPoints[i].mY << ", "
<< ", z=" << pathgrid.mPoints[i].mZ; << pathgrid.mPoints[i].mZ << ") "
messages.add (id, pathgrid.mId + ss.str(), "", CSMDoc::Message::Severity_Warning); << "is disconnected from other points";
messages.add (id, ss.str(), "", CSMDoc::Message::Severity_Warning);
} }
} }

View file

@ -36,7 +36,7 @@ void CSMTools::RegionCheckStage::perform (int stage, CSMDoc::Messages& messages)
// test for empty name // test for empty name
if (region.mName.empty()) if (region.mName.empty())
messages.add(id, region.mId + " has an empty name", "", CSMDoc::Message::Severity_Error); messages.add(id, "Name is missing", "", CSMDoc::Message::Severity_Error);
/// \todo test that the ID in mSleeplist exists /// \todo test that the ID in mSleeplist exists