From 032c542396758e6f71bccdd968476ab8dfa30652 Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Fri, 24 Jan 2014 20:34:33 +0100 Subject: [PATCH] improving the cell cloning. --- apps/opencs/view/world/cellcreator.cpp | 9 +++++++-- apps/opencs/view/world/cellcreator.hpp | 1 - 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/opencs/view/world/cellcreator.cpp b/apps/opencs/view/world/cellcreator.cpp index 6298e3ba5..ebf88122b 100644 --- a/apps/opencs/view/world/cellcreator.cpp +++ b/apps/opencs/view/world/cellcreator.cpp @@ -22,7 +22,7 @@ std::string CSVWorld::CellCreator::getId() const CSVWorld::CellCreator::CellCreator (CSMWorld::Data& data, QUndoStack& undoStack, const CSMWorld::UniversalId& id) -: GenericCreator (data, undoStack, id), mCloningExterior(false) +: GenericCreator (data, undoStack, id) { mY = new QSpinBox (this); mY->setVisible (false); @@ -61,6 +61,7 @@ void CSVWorld::CellCreator::reset() mX->setValue (0); mY->setValue (0); mType->setCurrentIndex (0); + setType(0); GenericCreator::reset(); } @@ -80,14 +81,18 @@ void CSVWorld::CellCreator::valueChanged (int index) update(); } -void CSVWorld::CellCreator::cloneMode(const std::string& originid, const CSMWorld::UniversalId::Type type, const CSMWorld::UniversalId::ArgumentType argumentType) +void CSVWorld::CellCreator::cloneMode(const std::string& originid, + const CSMWorld::UniversalId::Type type, + const CSMWorld::UniversalId::ArgumentType argumentType) { CSVWorld::GenericCreator::cloneMode(originid, type, argumentType); if (*(originid.begin()) == '#') //if originid points to the exterior cell { setType(1); //enable x and y controls + mType->setCurrentIndex(1); } else { setType(0); + mType->setCurrentIndex(0); } } diff --git a/apps/opencs/view/world/cellcreator.hpp b/apps/opencs/view/world/cellcreator.hpp index 521abd173..3130c1328 100644 --- a/apps/opencs/view/world/cellcreator.hpp +++ b/apps/opencs/view/world/cellcreator.hpp @@ -19,7 +19,6 @@ namespace CSVWorld QLabel *mYLabel; QSpinBox *mY; - bool mCloningExterior; protected: virtual std::string getId() const;