mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 12:09:41 +00:00
Creating/cloning Cell sets the proper Interior flag
This commit is contained in:
parent
0420f21462
commit
1c9d36a368
2 changed files with 15 additions and 0 deletions
|
@ -8,6 +8,9 @@
|
||||||
#include <QSpinBox>
|
#include <QSpinBox>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
|
||||||
|
#include "../../model/world/commands.hpp"
|
||||||
|
#include "../../model/world/idtree.hpp"
|
||||||
|
|
||||||
std::string CSVWorld::CellCreator::getId() const
|
std::string CSVWorld::CellCreator::getId() const
|
||||||
{
|
{
|
||||||
if (mType->currentIndex()==0)
|
if (mType->currentIndex()==0)
|
||||||
|
@ -20,6 +23,15 @@ std::string CSVWorld::CellCreator::getId() const
|
||||||
return stream.str();
|
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,
|
CSVWorld::CellCreator::CellCreator (CSMWorld::Data& data, QUndoStack& undoStack,
|
||||||
const CSMWorld::UniversalId& id)
|
const CSMWorld::UniversalId& id)
|
||||||
: GenericCreator (data, undoStack, id)
|
: GenericCreator (data, undoStack, id)
|
||||||
|
|
|
@ -23,6 +23,9 @@ namespace CSVWorld
|
||||||
|
|
||||||
virtual std::string getId() const;
|
virtual std::string getId() const;
|
||||||
|
|
||||||
|
/// Allow subclasses to add additional data to \a command.
|
||||||
|
virtual void configureCreateCommand(CSMWorld::CreateCommand& command) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
CellCreator (CSMWorld::Data& data, QUndoStack& undoStack, const CSMWorld::UniversalId& id);
|
CellCreator (CSMWorld::Data& data, QUndoStack& undoStack, const CSMWorld::UniversalId& id);
|
||||||
|
|
Loading…
Reference in a new issue