summaryrefslogtreecommitdiff
path: root/src/editorui
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-12-08 01:50:52 +0100
committerTreeki <treeki@gmail.com>2011-12-08 01:50:52 +0100
commitc1cd2955c3e9b1dbb7ea72c85f996a19ab37ea3b (patch)
tree178588c02814c217ca50a5e7a2a49fc55d3219b9 /src/editorui
parent21cf889b5e45a5619a09e46db246abd4abbec3a4 (diff)
downloadkoopatlas-c1cd2955c3e9b1dbb7ea72c85f996a19ab37ea3b.tar.gz
koopatlas-c1cd2955c3e9b1dbb7ea72c85f996a19ab37ea3b.zip
the first version of map exporting
Diffstat (limited to 'src/editorui')
-rw-r--r--src/editorui/paths.py24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/editorui/paths.py b/src/editorui/paths.py
index 2f4388a..617e981 100644
--- a/src/editorui/paths.py
+++ b/src/editorui/paths.py
@@ -18,7 +18,6 @@ class KPEditorNode(KPEditorItem):
self.iconList = [QtGui.QIcon("Resources/Through.png"),
QtGui.QIcon("Resources/Level.png"),
- QtGui.QIcon("Resources/Stop.png"),
QtGui.QIcon("Resources/Exit.png")]
self.state = 0
@@ -33,7 +32,7 @@ class KPEditorNode(KPEditorItem):
def toggle(self):
self.state += 1
- if self.state == 4:
+ if self.state == 3:
self.state = 0
self.stateToggled.emit(self.state)
@@ -156,8 +155,7 @@ class KPEditorNode(KPEditorItem):
node.mapChange = None
node.mapID = None
node.foreignID = None
- node.isStop = True
- node.level = [0,0]
+ node.level = None
if state == 1:
node.level = [1, 1]
@@ -165,9 +163,6 @@ class KPEditorNode(KPEditorItem):
self.stage.setValue(node.level[1])
elif state == 2:
- pass
-
- elif state == 3:
node.transition = 0
node.mapChange = 'None.arc'
node.foreignID = 0
@@ -187,10 +182,6 @@ class KPEditorNode(KPEditorItem):
self.transition.setCurrentIndex(0)
- else:
- node.isStop = False
-
-
self.update()
@@ -254,7 +245,7 @@ class KPEditorNode(KPEditorItem):
selectionRect = None
- if node.level != [0,0]:
+ if node.level:
painter.setBrush(QtGui.QColor(0, 0, 0, 0))
painter.setPen(QtGui.QColor(0, 0, 0, 0))
painter.drawPixmap(self._boundingRect.topLeft(), QtGui.QPixmap("Resources/BlackLevel.png"))
@@ -279,7 +270,7 @@ class KPEditorNode(KPEditorItem):
selectionRect = self._boundingRect.adjusted(1,5,-1,-5)
- elif node.isStop:
+ elif len(node.exits) != 2:
brush = QtGui.QBrush(QtGui.QColor(255, 220, 220))
painter.setPen(QtGui.QColor(255, 255, 255))
painter.setBrush(brush)
@@ -301,7 +292,7 @@ class KPEditorNode(KPEditorItem):
self.buttonProxy.show()
- if node.level != [0,0]:
+ if node.level:
self.worldProxy.show()
self.stageProxy.show()
@@ -474,7 +465,6 @@ class KPEditorPath(QtGui.QGraphicsLineItem):
path = self._pathRef()
path.animation = buttonID
- print path.animation
path.qtItem.update()
@@ -619,6 +609,9 @@ class KPEditorPath(QtGui.QGraphicsLineItem):
startNode = path._startNodeRef().qtItem
endNode = path._endNodeRef().qtItem
+ startNode.update()
+ endNode.update()
+
self._startNodeRef = weakref.ref(startNode)
self._endNodeRef = weakref.ref(endNode)
self._pathRef = weakref.ref(path)
@@ -696,6 +689,7 @@ class KPEditorPath(QtGui.QGraphicsLineItem):
node = ref()._nodeRef()
try:
node.exits.remove(path)
+ node.qtItem.update()
except ValueError:
pass