diff options
Diffstat (limited to '')
-rw-r--r-- | src/mapdata.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mapdata.py b/src/mapdata.py index 6f71daf..c270bec 100644 --- a/src/mapdata.py +++ b/src/mapdata.py @@ -153,6 +153,8 @@ class KPPathTileLayer(KPLayer): def _load(self, mapObj, src): self.updateCache() + KP.mainWindow.pathNodeList.loadLayer(self) + print self, mapObj, src def __repr__(self): return "<KPPathTileLayer with %r connected to %r>" % (self.tileset, self.associate) @@ -378,12 +380,12 @@ class KPPath(object): def _dump(self, mapObj, dest): dest['startNodeLink'] = mapObj.refNode(self._startNodeRef()) dest['endNodeLink'] = mapObj.refNode(self._endNodeRef()) - dest['linkedLayer'] = mapObj.refLayer(self.linkedLayer) + # dest['linkedLayer'] = mapObj.refLayer(self.linkedLayer) def _load(self, mapObj, src): self._startNodeRef = weakref.ref(mapObj.derefNode(src['startNodeLink'])) self._endNodeRef = weakref.ref(mapObj.derefNode(src['endNodeLink'])) - self.linkedLayer = mapObj.derefLayer(src['linkedLayer']) + # self.linkedLayer = mapObj.derefLayer(src['linkedLayer']) def __init__(self, startNode=None, endNode=None, cloneFrom=None): if startNode is None and endNode is None: @@ -407,7 +409,7 @@ class KPPath(object): self.animation = cloneFrom.animation self.movementSpeed = 1.0 - self.linkedLayer = None + # self.linkedLayer = None def setStart(self, newStart): @@ -465,7 +467,7 @@ class KPPathLayer(KPLayer): @mapfile.dumpable('map_root') class KPMap(object): - __dump_attribs__ = ('layers', 'nextLayerNumber', 'doodadDefinitions', 'pathNodeTileset') + __dump_attribs__ = ('layers', 'associateLayers', 'nextLayerNumber', 'doodadDefinitions', 'pathNodeTileset') def _preload(self, src): # we need this early so we can use the deref methods! @@ -482,6 +484,8 @@ class KPMap(object): if path is None: raise "no path specified for this map" + self.associateLayers = KP.mainWindow.pathNodeList.getLayers() + import mapfile dumped = mapfile.dump(self) open(path, 'wb').write(dumped) @@ -499,6 +503,7 @@ class KPMap(object): self.pathLayer = self._createPathLayer() self.layers = [self.pathLayer] + self.associateLayers = [] self.layerModel = KPMap.LayerModel(self.layers) self.doodadDefinitions = [] |