From 1498632b8bc91d0f83dcbfbdd03fa7499ef0985e Mon Sep 17 00:00:00 2001 From: Colin Noga Date: Mon, 23 Jul 2012 13:29:54 -0500 Subject: Streamlined node drawing with auto-tilesets (bypass with Alt-click), double click a node layer to jump to it, selecting a path/node layer makes it visibly red (except level nodes) --- src/editorui/editormain.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/editorui/editormain.py') diff --git a/src/editorui/editormain.py b/src/editorui/editormain.py index 4b2e686..11df8dd 100644 --- a/src/editorui/editormain.py +++ b/src/editorui/editormain.py @@ -506,6 +506,11 @@ class KPEditorWidget(QtGui.QGraphicsView): x, y = clicked.x(), clicked.y() itemsUnder = self.scene().items(clicked) + if event.modifiers() & Qt.AltModifier: + dialog = True + else: + dialog = False + for item in itemsUnder: if isinstance(item, KPEditorNode): # Paint a path to this node (if one is selected) @@ -541,7 +546,7 @@ class KPEditorWidget(QtGui.QGraphicsView): path = KPPath(sourceNode, destNode) KP.map.pathLayer.paths.append(path) - KP.mainWindow.pathNodeList.addLayer(path) + KP.mainWindow.pathNodeList.addLayer(path, dialog) item = KPEditorPath(path) self.scene().addItem(item) @@ -556,7 +561,7 @@ class KPEditorWidget(QtGui.QGraphicsView): node = KPNode() node.position = (x - 12, y - 12) KP.map.pathLayer.nodes.append(node) - KP.mainWindow.pathNodeList.addLayer(node) + KP.mainWindow.pathNodeList.addLayer(node, dialog) # Start node => Original path => New node => New path => End node @@ -577,7 +582,7 @@ class KPEditorWidget(QtGui.QGraphicsView): newPath = KPPath(node, endNode, origPath) KP.map.pathLayer.paths.append(newPath) - KP.mainWindow.pathNodeList.addLayer(newPath) + KP.mainWindow.pathNodeList.addLayer(newPath, dialog) pathItem = KPEditorPath(newPath) self.scene().addItem(pathItem) @@ -588,7 +593,7 @@ class KPEditorWidget(QtGui.QGraphicsView): node = KPNode() node.position = (x - 12, y - 12) KP.map.pathLayer.nodes.append(node) - KP.mainWindow.pathNodeList.addLayer(node) + KP.mainWindow.pathNodeList.addLayer(node, dialog) item = KPEditorNode(node) self.scene().addItem(item) @@ -614,7 +619,7 @@ class KPEditorWidget(QtGui.QGraphicsView): path = KPPath(sourceNode, node) KP.map.pathLayer.paths.append(path) - KP.mainWindow.pathNodeList.addLayer(path) + KP.mainWindow.pathNodeList.addLayer(path, dialog) pathItem = KPEditorPath(path) self.scene().addItem(pathItem) -- cgit v1.2.3