mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-22 07:09:42 +00:00
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"
|
||||
|
||||
CSVRender::WorldspaceWidget& CSVRender::EditMode::getWorldspaceWidget()
|
||||
{
|
||||
return *mWorldspaceWidget;
|
||||
}
|
||||
|
||||
CSVRender::EditMode::EditMode (WorldspaceWidget *worldspaceWidget, const QIcon& icon,
|
||||
unsigned int mask, const QString& tooltip, QWidget *parent)
|
||||
: ModeButton (icon, tooltip, parent), mWorldspaceWidget (worldspaceWidget), mMask (mask)
|
||||
|
|
|
@ -17,6 +17,10 @@ namespace CSVRender
|
|||
WorldspaceWidget *mWorldspaceWidget;
|
||||
unsigned int mMask;
|
||||
|
||||
protected:
|
||||
|
||||
WorldspaceWidget& getWorldspaceWidget();
|
||||
|
||||
public:
|
||||
|
||||
EditMode (WorldspaceWidget *worldspaceWidget, const QIcon& icon, unsigned int mask,
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "elements.hpp"
|
||||
#include "object.hpp"
|
||||
#include "worldspacewidget.hpp"
|
||||
|
||||
CSVRender::InstanceMode::InstanceMode (WorldspaceWidget *worldspaceWidget, QWidget *parent)
|
||||
: 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
|
||||
CSVRender::Object* object = objectTag->mObject;
|
||||
object->setSelected (!object->getSelected());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getWorldspaceWidget().clearSelection (Element_Reference);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue