From 81c7ce5b06783e26b174ab2003d37cd503422f2c Mon Sep 17 00:00:00 2001 From: Stanislav Bas Date: Sat, 27 Jun 2015 21:59:16 +0300 Subject: [PATCH] Add the proper getErrors() method to CellCreator. Fix the impossibility of the Exterior Cell creation. --- apps/opencs/view/world/cellcreator.cpp | 14 ++++++++++++++ apps/opencs/view/world/cellcreator.hpp | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/apps/opencs/view/world/cellcreator.cpp b/apps/opencs/view/world/cellcreator.cpp index 45fac2c5f0..c7d909f4cf 100644 --- a/apps/opencs/view/world/cellcreator.cpp +++ b/apps/opencs/view/world/cellcreator.cpp @@ -106,3 +106,17 @@ void CSVWorld::CellCreator::cloneMode(const std::string& originId, mType->setCurrentIndex(0); } } + +std::string CSVWorld::CellCreator::getErrors() const +{ + std::string errors; + if (mType->currentIndex() == 0) + { + errors = GenericCreator::getErrors(); + } + else if (getData().hasId(getId())) + { + errors = "The Exterior Cell is already exist"; + } + return errors; +} diff --git a/apps/opencs/view/world/cellcreator.hpp b/apps/opencs/view/world/cellcreator.hpp index b633ca06e1..6c682c6cd4 100644 --- a/apps/opencs/view/world/cellcreator.hpp +++ b/apps/opencs/view/world/cellcreator.hpp @@ -35,6 +35,10 @@ namespace CSVWorld virtual void cloneMode(const std::string& originId, const CSMWorld::UniversalId::Type type); + virtual std::string getErrors() const; + ///< Return formatted error descriptions for the current state of the creator. if an empty + /// string is returned, there is no error. + private slots: void setType (int index);