1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 15:39:02 +00:00
OpenMW/apps/opencs/view/world/pathgridcreator.cpp

30 lines
690 B
C++
Raw Normal View History

#include "pathgridcreator.hpp"
#include "../../model/world/data.hpp"
CSVWorld::PathgridCreator::PathgridCreator(
CSMWorld::Data& data,
QUndoStack& undoStack,
const CSMWorld::UniversalId& id,
bool relaxedIdRules
) : GenericCreator(data, undoStack, id, relaxedIdRules)
{}
std::string CSVWorld::PathgridCreator::getErrors() const
{
std::string pathgridId = getId();
// Check user input for any errors.
std::string errors;
if (pathgridId.empty())
{
errors = "No Pathgrid ID entered";
}
else if (getData().getPathgrids().searchId(pathgridId) > -1)
{
errors = "Pathgrid with this ID already exists";
}
return errors;
}