diff clients/editor/scripts/gui/mapeditor.py @ 367:598547404022

* Initial support for closing maps: * Lots of cleanup functions has been added * TODO: Cameras are only removed when all maps are closed * TODO: Screen leaves traces when the last map is closed * Replaced pre/postMapRemove events with pre/postMapClosed * Fixed a bug in the Toolbar where it didn't properly handle removal of actions from an actiongroup
author cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 29 Oct 2009 22:11:48 +0000
parents ad5818097cd6
children 22222a900751
line wrap: on
line diff
--- a/clients/editor/scripts/gui/mapeditor.py	Thu Oct 29 20:19:08 2009 +0000
+++ b/clients/editor/scripts/gui/mapeditor.py	Thu Oct 29 22:11:48 2009 +0000
@@ -66,6 +66,7 @@
 		self._instances = []
 		
 		events.postMapShown.connect(self._mapChanged)
+		events.preMapClosed.connect(self._mapClosed)
 		events.onObjectSelected.connect(self.setObject)
 		self._undogroup = False
 		
@@ -112,6 +113,9 @@
 	def _mapChanged(self, sender, mapview):
 		self.setController(mapview.getController())
 		
+	def _mapClosed(self, sender, mapview):
+		self.setController(None)
+		
 	def _setCursor(self):
 		engine = self._editor.getEngine()
 		cursor = engine.getCursor()