summaryrefslogtreecommitdiff
path: root/src/editorui/paths.py
diff options
context:
space:
mode:
authorColin Noga <Tempus@chronometry.ca>2012-08-28 13:02:14 -0500
committerColin Noga <Tempus@chronometry.ca>2012-08-28 13:02:14 -0500
commitfc9ba20ea4446049ebf68e1e9b9dfd77352cedd2 (patch)
treeade73af132c8d413ef5e93d97d55c0781787f4ed /src/editorui/paths.py
parent03cd34aba4e4184142c025fe7cdcb9e4e0a5d7ab (diff)
downloadkoopatlas-fc9ba20ea4446049ebf68e1e9b9dfd77352cedd2.tar.gz
koopatlas-fc9ba20ea4446049ebf68e1e9b9dfd77352cedd2.zip
export batch fixed, checkbox for secret added
Diffstat (limited to '')
-rw-r--r--src/editorui/paths.py37
1 files changed, 35 insertions, 2 deletions
diff --git a/src/editorui/paths.py b/src/editorui/paths.py
index 70c3b99..394b82a 100644
--- a/src/editorui/paths.py
+++ b/src/editorui/paths.py
@@ -86,6 +86,17 @@ class KPEditorNode(KPEditorItem):
self.setPalette(palette)
+ class SecretBox(QtGui.QCheckBox):
+ def __init__(self):
+ QtGui.QCheckBox.__init__(self)
+
+ palette = self.palette()
+ palette.setColor(QtGui.QPalette.ButtonText, Qt.black)
+ palette.setColor(QtGui.QPalette.Window, Qt.transparent)
+
+ self.setPalette(palette)
+
+
class mapArcEdit(QtGui.QLineEdit):
def __init__(self):
QtGui.QLineEdit.__init__(self)
@@ -129,10 +140,17 @@ class KPEditorNode(KPEditorItem):
self.stageProxy = self.HiddenProxy(self.stage, self, 6, 24)
self.stage.valueChanged.connect(self.stageChange)
+ self.secret = self.SecretBox()
+ self.secretProxy = self.HiddenProxy(self.secret, self, -60, 26)
+ self.secret.stateChanged.connect(self.secretChange)
+
if node.level != None:
self.world.setValue(node.level[0])
self.stage.setValue(node.level[1])
+ if node.hasSecret != None:
+ self.secret.setChecked(node.hasSecret)
+
self.foreignID = self.LevelSlotSpinner()
self.foreignIDProxy = self.HiddenProxy(self.foreignID, self, 60, 24)
@@ -217,6 +235,15 @@ class KPEditorNode(KPEditorItem):
@QtCore.pyqtSlot(int)
+ def secretChange(self, secret):
+
+ node = self._nodeRef()
+ node.hasSecret = secret
+
+ KP.mainWindow.pathNodeList.update()
+
+
+ @QtCore.pyqtSlot(int)
def foreignIDChange(self, ID):
node = self._nodeRef()
@@ -329,11 +356,12 @@ class KPEditorNode(KPEditorItem):
if node.level:
self.worldProxy.show()
self.stageProxy.show()
+ self.secretProxy.show()
else:
self.worldProxy.hide()
self.stageProxy.hide()
-
+ self.secretProxy.hide()
if node.mapChange != None:
self.foreignID.show()
@@ -349,6 +377,7 @@ class KPEditorNode(KPEditorItem):
self.buttonProxy.hide()
self.worldProxy.hide()
self.stageProxy.hide()
+ self.secretProxy.hide()
self.foreignID.hide()
self.transition.hide()
self.mapChange.hide()
@@ -358,7 +387,11 @@ class KPEditorNode(KPEditorItem):
node = self._nodeRef()
layer = KP.map.pathLayer
- layer.nodes.remove(node)
+ try:
+ layer.nodes.remove(node)
+ except ValueError:
+ pass
+
KP.mainWindow.pathNodeList.removeLayer(node)
if len(node.exits) == 2: