forked from mirror/openmw-tes3mp
Creating/cloning Cell sets the proper Interior flag
This commit is contained in:
parent
f3bb00e3d9
commit
5761ec428d
2 changed files with 15 additions and 0 deletions
|
@ -8,6 +8,9 @@
|
|||
#include <QSpinBox>
|
||||
#include <QLabel>
|
||||
|
||||
#include "../../model/world/commands.hpp"
|
||||
#include "../../model/world/idtree.hpp"
|
||||
|
||||
std::string CSVWorld::CellCreator::getId() const
|
||||
{
|
||||
if (mType->currentIndex()==0)
|
||||
|
@ -20,6 +23,15 @@ std::string CSVWorld::CellCreator::getId() const
|
|||
return stream.str();
|
||||
}
|
||||
|
||||
void CSVWorld::CellCreator::configureCreateCommand(CSMWorld::CreateCommand& command) const
|
||||
{
|
||||
CSMWorld::IdTree *model = dynamic_cast<CSMWorld::IdTree *>(getData().getTableModel(getCollectionId()));
|
||||
Q_ASSERT(model != NULL);
|
||||
int parentIndex = model->findColumnIndex(CSMWorld::Columns::ColumnId_Cell);
|
||||
int index = model->findNestedColumnIndex(parentIndex, CSMWorld::Columns::ColumnId_Interior);
|
||||
command.addNestedValue(parentIndex, index, mType->currentIndex() == 0);
|
||||
}
|
||||
|
||||
CSVWorld::CellCreator::CellCreator (CSMWorld::Data& data, QUndoStack& undoStack,
|
||||
const CSMWorld::UniversalId& id)
|
||||
: GenericCreator (data, undoStack, id)
|
||||
|
|
|
@ -23,6 +23,9 @@ namespace CSVWorld
|
|||
|
||||
virtual std::string getId() const;
|
||||
|
||||
/// Allow subclasses to add additional data to \a command.
|
||||
virtual void configureCreateCommand(CSMWorld::CreateCommand& command) const;
|
||||
|
||||
public:
|
||||
|
||||
CellCreator (CSMWorld::Data& data, QUndoStack& undoStack, const CSMWorld::UniversalId& id);
|
||||
|
|
Loading…
Reference in a new issue