mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-03 23:56:43 +00:00 
			
		
		
		
	do not start move drags while the document is locked for editing
This commit is contained in:
		
							parent
							
								
									1726393963
								
							
						
					
					
						commit
						dd564daba0
					
				
					 2 changed files with 14 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -27,7 +27,8 @@ int CSVRender::InstanceMode::getSubModeFromId (const std::string& id) const
 | 
			
		|||
 | 
			
		||||
CSVRender::InstanceMode::InstanceMode (WorldspaceWidget *worldspaceWidget, QWidget *parent)
 | 
			
		||||
: EditMode (worldspaceWidget, QIcon (":placeholder"), Mask_Reference, "Instance editing",
 | 
			
		||||
  parent), mSubMode (0), mSelectionMode (0), mDragMode (DragMode_None), mDragAxis (-1)
 | 
			
		||||
  parent), mSubMode (0), mSelectionMode (0), mDragMode (DragMode_None), mDragAxis (-1),
 | 
			
		||||
  mLocked (false)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -90,6 +91,12 @@ void CSVRender::InstanceMode::deactivate (CSVWidget::SceneToolbar *toolbar)
 | 
			
		|||
    EditMode::deactivate (toolbar);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void CSVRender::InstanceMode::setEditLock (bool locked)
 | 
			
		||||
{
 | 
			
		||||
    mLocked = locked;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void CSVRender::InstanceMode::primaryEditPressed (osg::ref_ptr<TagBase> tag)
 | 
			
		||||
{
 | 
			
		||||
    if (CSMPrefs::get()["3D Scene Input"]["context-select"].isTrue())
 | 
			
		||||
| 
						 | 
				
			
			@ -134,7 +141,7 @@ void CSVRender::InstanceMode::secondarySelectPressed (osg::ref_ptr<TagBase> tag)
 | 
			
		|||
 | 
			
		||||
bool CSVRender::InstanceMode::primaryEditStartDrag (osg::ref_ptr<TagBase> tag)
 | 
			
		||||
{
 | 
			
		||||
    if (mDragMode!=DragMode_None)
 | 
			
		||||
    if (mDragMode!=DragMode_None || mLocked)
 | 
			
		||||
        return false;
 | 
			
		||||
 | 
			
		||||
    if (tag && CSMPrefs::get()["3D Scene Input"]["context-select"].isTrue())
 | 
			
		||||
| 
						 | 
				
			
			@ -178,6 +185,8 @@ bool CSVRender::InstanceMode::primaryEditStartDrag (osg::ref_ptr<TagBase> tag)
 | 
			
		|||
 | 
			
		||||
bool CSVRender::InstanceMode::secondaryEditStartDrag (osg::ref_ptr<TagBase> tag)
 | 
			
		||||
{
 | 
			
		||||
    if (mLocked)
 | 
			
		||||
        return false;
 | 
			
		||||
 | 
			
		||||
    return false;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -26,6 +26,7 @@ namespace CSVRender
 | 
			
		|||
            InstanceSelectionMode *mSelectionMode;
 | 
			
		||||
            DragMode mDragMode;
 | 
			
		||||
            int mDragAxis;
 | 
			
		||||
            bool mLocked;
 | 
			
		||||
 | 
			
		||||
            int getSubModeFromId (const std::string& id) const;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -37,6 +38,8 @@ namespace CSVRender
 | 
			
		|||
 | 
			
		||||
            virtual void deactivate (CSVWidget::SceneToolbar *toolbar);
 | 
			
		||||
 | 
			
		||||
            virtual void setEditLock (bool locked);
 | 
			
		||||
 | 
			
		||||
            virtual void primaryEditPressed (osg::ref_ptr<TagBase> tag);
 | 
			
		||||
 | 
			
		||||
            virtual void secondaryEditPressed (osg::ref_ptr<TagBase> tag);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue