mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-05 17:45:34 +00:00
Group the commands with begin/end macros.
This commit is contained in:
parent
bf5ba41223
commit
092080c69c
1 changed files with 3 additions and 0 deletions
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QElapsedTimer>
|
#include <QElapsedTimer>
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
#include "../../model/settings/usersettings.hpp"
|
#include "../../model/settings/usersettings.hpp"
|
||||||
#include "../../model/world/commands.hpp"
|
#include "../../model/world/commands.hpp"
|
||||||
|
@ -231,12 +232,14 @@ namespace CSVRender
|
||||||
// use the saved scene node name since the physics model has not moved yet
|
// use the saved scene node name since the physics model has not moved yet
|
||||||
std::string referenceId = mPhysics->sceneNodeToRefId(mGrabbedSceneNode);
|
std::string referenceId = mPhysics->sceneNodeToRefId(mGrabbedSceneNode);
|
||||||
|
|
||||||
|
mParent->mDocument.getUndoStack().beginMacro (QObject::tr("Move Object"));
|
||||||
mParent->mDocument.getUndoStack().push(new CSMWorld::ModifyCommand(*mIdTableModel,
|
mParent->mDocument.getUndoStack().push(new CSMWorld::ModifyCommand(*mIdTableModel,
|
||||||
mIdTableModel->getModelIndex(referenceId, mColIndexPosX), pos.x));
|
mIdTableModel->getModelIndex(referenceId, mColIndexPosX), pos.x));
|
||||||
mParent->mDocument.getUndoStack().push(new CSMWorld::ModifyCommand(*mIdTableModel,
|
mParent->mDocument.getUndoStack().push(new CSMWorld::ModifyCommand(*mIdTableModel,
|
||||||
mIdTableModel->getModelIndex(referenceId, mColIndexPosY), pos.y));
|
mIdTableModel->getModelIndex(referenceId, mColIndexPosY), pos.y));
|
||||||
mParent->mDocument.getUndoStack().push(new CSMWorld::ModifyCommand(*mIdTableModel,
|
mParent->mDocument.getUndoStack().push(new CSMWorld::ModifyCommand(*mIdTableModel,
|
||||||
mIdTableModel->getModelIndex(referenceId, mColIndexPosZ), pos.z));
|
mIdTableModel->getModelIndex(referenceId, mColIndexPosZ), pos.z));
|
||||||
|
mParent->mDocument.getUndoStack().endMacro();
|
||||||
|
|
||||||
// FIXME: highlight current object?
|
// FIXME: highlight current object?
|
||||||
//mCurrentObj = mGrabbedSceneNode; // FIXME: doesn't work?
|
//mCurrentObj = mGrabbedSceneNode; // FIXME: doesn't work?
|
||||||
|
|
Loading…
Reference in a new issue