mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-22 10:39:41 +00:00
Command system and undo
This commit is contained in:
parent
cc415526b0
commit
a54a1b9940
1 changed files with 8 additions and 12 deletions
|
@ -199,8 +199,8 @@ void CSVRender::TerrainTextureMode::primaryEditPressed(const WorldspaceHitResult
|
||||||
CSMDoc::Document& document = getWorldspaceWidget().getDocument();
|
CSMDoc::Document& document = getWorldspaceWidget().getDocument();
|
||||||
CSMWorld::IdTable& landTable = dynamic_cast<CSMWorld::IdTable&> (
|
CSMWorld::IdTable& landTable = dynamic_cast<CSMWorld::IdTable&> (
|
||||||
*document.getData().getTableModel (CSMWorld::UniversalId::Type_Land));
|
*document.getData().getTableModel (CSMWorld::UniversalId::Type_Land));
|
||||||
/*CSMWorld::IdTable& ltexTable = dynamic_cast<CSMWorld::IdTable&> (
|
CSMWorld::IdTable& ltexTable = dynamic_cast<CSMWorld::IdTable&> (
|
||||||
*document.getData().getTableModel (CSMWorld::UniversalId::Type_LandTextures));*/
|
*document.getData().getTableModel (CSMWorld::UniversalId::Type_LandTextures));
|
||||||
|
|
||||||
int textureColumn = landTable.findColumnIndex(CSMWorld::Columns::ColumnId_LandTexturesIndex);
|
int textureColumn = landTable.findColumnIndex(CSMWorld::Columns::ColumnId_LandTexturesIndex);
|
||||||
CSMWorld::LandTexturesColumn::DataType mPointer = landTable.data(landTable.getModelIndex(cellId, textureColumn)).value<CSMWorld::LandTexturesColumn::DataType>();
|
CSMWorld::LandTexturesColumn::DataType mPointer = landTable.data(landTable.getModelIndex(cellId, textureColumn)).value<CSMWorld::LandTexturesColumn::DataType>();
|
||||||
|
@ -245,20 +245,16 @@ void CSVRender::TerrainTextureMode::primaryEditPressed(const WorldspaceHitResult
|
||||||
// Not implemented
|
// Not implemented
|
||||||
}
|
}
|
||||||
|
|
||||||
// Modify data, this should be done via command system!
|
|
||||||
QVariant variant;
|
QVariant variant;
|
||||||
variant.setValue(mNew);
|
variant.setValue(mNew);
|
||||||
landTable.setData(landTable.getModelIndex(cellId, textureColumn), variant);
|
|
||||||
|
|
||||||
// Reference
|
CSMWorld::CommandMacro macro (document.getUndoStack(), "Edit texture records");
|
||||||
/*CSMWorld::ModifyLandTexturesCommand::ModifyLandTexturesCommand(IdTable& landTable,
|
QModelIndex index(landTable.getModelIndex (cellId, landTable.findColumnIndex (CSMWorld::Columns::ColumnId_LandTexturesIndex)));
|
||||||
IdTable& ltexTable, QUndoCommand* parent)*/
|
|
||||||
|
|
||||||
// Reference
|
CSMWorld::TouchLandCommand* ltexTouch = new CSMWorld::TouchLandCommand(landTable, ltexTable, cellId);
|
||||||
/*CSMWorld::DeleteCommand* command = new CSMWorld::DeleteCommand(referencesTable,
|
CSMWorld::ModifyCommand* ltexModify = new CSMWorld::ModifyCommand(landTable, index, variant);
|
||||||
static_cast<ObjectTag*>(iter->get())->mObject->getReferenceId());
|
macro.push (ltexTouch);
|
||||||
|
macro.push (ltexModify);
|
||||||
getWorldspaceWidget().getDocument().getUndoStack().push(command);*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVRender::TerrainTextureMode::primarySelectPressed(const WorldspaceHitResult& hit)
|
void CSVRender::TerrainTextureMode::primarySelectPressed(const WorldspaceHitResult& hit)
|
||||||
|
|
Loading…
Reference in a new issue