mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 07:36:41 +00:00
handle context-sensitive select mode in instance editing
This commit is contained in:
parent
2cb106f6ad
commit
8e87b48866
2 changed files with 26 additions and 3 deletions
|
@ -1,25 +1,42 @@
|
||||||
|
|
||||||
#include "instancemode.hpp"
|
#include "instancemode.hpp"
|
||||||
|
|
||||||
|
#include "../../model/settings/usersettings.hpp"
|
||||||
|
|
||||||
#include "elements.hpp"
|
#include "elements.hpp"
|
||||||
#include "object.hpp"
|
#include "object.hpp"
|
||||||
#include "worldspacewidget.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",
|
||||||
parent)
|
parent), mContextSelect (false)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSVRender::InstanceMode::activate (CSVWidget::SceneToolbar *toolbar)
|
||||||
|
{
|
||||||
|
EditMode::activate (toolbar);
|
||||||
|
|
||||||
|
mContextSelect = CSMSettings::UserSettings::instance().setting ("scene-input/context-select")=="true";
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSVRender::InstanceMode::updateUserSetting (const QString& name, const QStringList& value)
|
||||||
|
{
|
||||||
|
if (name=="scene-input/context-select")
|
||||||
|
mContextSelect = value.at (0)=="true";
|
||||||
|
}
|
||||||
|
|
||||||
void CSVRender::InstanceMode::primaryEditPressed (osg::ref_ptr<TagBase> tag)
|
void CSVRender::InstanceMode::primaryEditPressed (osg::ref_ptr<TagBase> tag)
|
||||||
{
|
{
|
||||||
|
if (mContextSelect)
|
||||||
|
selectPressed (tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVRender::InstanceMode::secondaryEditPressed (osg::ref_ptr<TagBase> tag)
|
void CSVRender::InstanceMode::secondaryEditPressed (osg::ref_ptr<TagBase> tag)
|
||||||
{
|
{
|
||||||
|
if (mContextSelect)
|
||||||
|
selectPressed (tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVRender::InstanceMode::selectPressed (osg::ref_ptr<TagBase> tag)
|
void CSVRender::InstanceMode::selectPressed (osg::ref_ptr<TagBase> tag)
|
||||||
|
|
|
@ -9,10 +9,16 @@ namespace CSVRender
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
bool mContextSelect;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
InstanceMode (WorldspaceWidget *worldspaceWidget, QWidget *parent = 0);
|
InstanceMode (WorldspaceWidget *worldspaceWidget, QWidget *parent = 0);
|
||||||
|
|
||||||
|
virtual void activate (CSVWidget::SceneToolbar *toolbar);
|
||||||
|
|
||||||
|
virtual void updateUserSetting (const QString& name, const QStringList& value);
|
||||||
|
|
||||||
virtual void primaryEditPressed (osg::ref_ptr<TagBase> tag);
|
virtual void primaryEditPressed (osg::ref_ptr<TagBase> tag);
|
||||||
|
|
||||||
virtual void secondaryEditPressed (osg::ref_ptr<TagBase> tag);
|
virtual void secondaryEditPressed (osg::ref_ptr<TagBase> tag);
|
||||||
|
|
Loading…
Reference in a new issue