From fc9ba20ea4446049ebf68e1e9b9dfd77352cedd2 Mon Sep 17 00:00:00 2001 From: Colin Noga Date: Tue, 28 Aug 2012 13:02:14 -0500 Subject: export batch fixed, checkbox for secret added --- src/editorui/paths.py | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'src/editorui/paths.py') 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) @@ -216,6 +234,15 @@ class KPEditorNode(KPEditorItem): KP.mainWindow.pathNodeList.update() + @QtCore.pyqtSlot(int) + def secretChange(self, secret): + + node = self._nodeRef() + node.hasSecret = secret + + KP.mainWindow.pathNodeList.update() + + @QtCore.pyqtSlot(int) def foreignIDChange(self, ID): @@ -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: -- cgit v1.2.3