forked from teamnwah/openmw-tes3coop
clear instance selection on select click on nothing/something that isn't an instance
This commit is contained in:
parent
319e3f24a3
commit
f28fa9fc16
3 changed files with 13 additions and 0 deletions
|
@ -2,6 +2,11 @@
|
||||||
|
|
||||||
#include "worldspacewidget.hpp"
|
#include "worldspacewidget.hpp"
|
||||||
|
|
||||||
|
CSVRender::WorldspaceWidget& CSVRender::EditMode::getWorldspaceWidget()
|
||||||
|
{
|
||||||
|
return *mWorldspaceWidget;
|
||||||
|
}
|
||||||
|
|
||||||
CSVRender::EditMode::EditMode (WorldspaceWidget *worldspaceWidget, const QIcon& icon,
|
CSVRender::EditMode::EditMode (WorldspaceWidget *worldspaceWidget, const QIcon& icon,
|
||||||
unsigned int mask, const QString& tooltip, QWidget *parent)
|
unsigned int mask, const QString& tooltip, QWidget *parent)
|
||||||
: ModeButton (icon, tooltip, parent), mWorldspaceWidget (worldspaceWidget), mMask (mask)
|
: ModeButton (icon, tooltip, parent), mWorldspaceWidget (worldspaceWidget), mMask (mask)
|
||||||
|
|
|
@ -17,6 +17,10 @@ namespace CSVRender
|
||||||
WorldspaceWidget *mWorldspaceWidget;
|
WorldspaceWidget *mWorldspaceWidget;
|
||||||
unsigned int mMask;
|
unsigned int mMask;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
WorldspaceWidget& getWorldspaceWidget();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
EditMode (WorldspaceWidget *worldspaceWidget, const QIcon& icon, unsigned int mask,
|
EditMode (WorldspaceWidget *worldspaceWidget, const QIcon& icon, unsigned int mask,
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include "elements.hpp"
|
#include "elements.hpp"
|
||||||
#include "object.hpp"
|
#include "object.hpp"
|
||||||
|
#include "worldspacewidget.hpp"
|
||||||
|
|
||||||
CSVRender::InstanceMode::InstanceMode (WorldspaceWidget *worldspaceWidget, QWidget *parent)
|
CSVRender::InstanceMode::InstanceMode (WorldspaceWidget *worldspaceWidget, QWidget *parent)
|
||||||
: EditMode (worldspaceWidget, QIcon (":placeholder"), Element_Reference, "Instance editing",
|
: EditMode (worldspaceWidget, QIcon (":placeholder"), Element_Reference, "Instance editing",
|
||||||
|
@ -30,6 +31,9 @@ void CSVRender::InstanceMode::selectPressed (osg::ref_ptr<TagBase> tag)
|
||||||
// hit an Object, toggle its selection state
|
// hit an Object, toggle its selection state
|
||||||
CSVRender::Object* object = objectTag->mObject;
|
CSVRender::Object* object = objectTag->mObject;
|
||||||
object->setSelected (!object->getSelected());
|
object->setSelected (!object->getSelected());
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getWorldspaceWidget().clearSelection (Element_Reference);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue