diff options
author | Treeki <treeki@gmail.com> | 2011-11-14 03:37:59 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-11-14 03:37:59 +0100 |
commit | 081bdfe91b68665800ab751190a9fbaa57f1f226 (patch) | |
tree | 33dc52c71241ca333c82e5314494a969d4b1455b /src | |
parent | 1b3fd1e50827fea107bc92f76dfd51a3535bdbc0 (diff) | |
download | koopatlas-081bdfe91b68665800ab751190a9fbaa57f1f226.tar.gz koopatlas-081bdfe91b68665800ab751190a9fbaa57f1f226.zip |
cleaning up some bugs
Diffstat (limited to '')
-rw-r--r-- | src/editorui.py | 8 | ||||
-rw-r--r-- | src/ui.py | 11 |
2 files changed, 16 insertions, 3 deletions
diff --git a/src/editorui.py b/src/editorui.py index e89810c..48164a0 100644 --- a/src/editorui.py +++ b/src/editorui.py @@ -115,6 +115,10 @@ class KPEditorObject(KPEditorItem): def hoverMoveEvent(self, event): + if self._layerRef() != KP.mapScene.currentLayer: + self.setCursor(Qt.ArrowCursor) + return + pos = event.pos() bit = self.resizerPortionAt(pos.x(), pos.y()) @@ -135,7 +139,7 @@ class KPEditorObject(KPEditorItem): pos = event.pos() bit = self.resizerPortionAt(pos.x(), pos.y()) - if bit: + if self._layerRef() == KP.mapScene.currentLayer and bit: event.accept() x, xSide, y, ySide = False, None, False, None @@ -240,6 +244,7 @@ class KPMapScene(QtGui.QGraphicsScene): # todo: look up why I used setItemIndexMethod(self.NoIndex) in Reggie self.currentLayer = None + KP.mapScene = self def drawBackground(self, painter, rect): @@ -446,4 +451,3 @@ class KPEditorWidget(QtGui.QGraphicsView): QtGui.QGraphicsView.mouseMoveEvent(self, event) - @@ -49,15 +49,25 @@ class KPLayerList(QtGui.QWidget): KP.map.appendLayer(KP.map.createNewLayer()) def removeLayer(self): + layer = self.selectedLayer() + scene = KP.mainWindow.scene + + for obj in layer.objects: + item = obj.qtItem + if item: + scene.removeItem(item) + KP.map.removeLayer(self.selectedLayer()) def moveUp(self): index = self.selectedLayerIndex() KP.map.moveLayer(index, index - 1) + KP.mainWindow.editor.viewport().update() def moveDown(self): index = self.selectedLayerIndex() KP.map.moveLayer(index, index + 2) + KP.mainWindow.editor.viewport().update() @@ -256,7 +266,6 @@ class KPMainWindow(QtGui.QMainWindow): @QtCore.pyqtSlot(int, KPTileObject) def handleSelectedObjectChanged(self, index, obj): - print("New obj: %d, %r" % (index, obj)) self.editor.paintNext = obj self.editor.paintNextID = index |