summaryrefslogtreecommitdiff
path: root/src/editorui/paths.py
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-08-29 19:40:50 +0200
committerTreeki <treeki@gmail.com>2012-08-29 19:40:50 +0200
commit7e177703c0380ebf9d6afe9f27df4db24903d6ad (patch)
tree088c0237035b4cc684150e295a5412badf757aec /src/editorui/paths.py
parenta0fb27c3f890aec576e09754b2e008459956e1f7 (diff)
parentb7ae37e17b8704a6ba3779625c65d1bb05bec251 (diff)
downloadkoopatlas-7e177703c0380ebf9d6afe9f27df4db24903d6ad.tar.gz
koopatlas-7e177703c0380ebf9d6afe9f27df4db24903d6ad.zip
Merge branch 'master' of tsn:Koopatlas ARGH
Diffstat (limited to 'src/editorui/paths.py')
-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: