summaryrefslogtreecommitdiff
path: root/src/mapdata.py
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-01-01 23:33:25 +0100
committerTreeki <treeki@gmail.com>2012-01-01 23:33:25 +0100
commite5d1d12873748e500210a6feebf108ef501134e2 (patch)
tree31660279a50e1b798587db49c69ccaeae47b8912 /src/mapdata.py
parentee339d840cdbc163bd82f522720aa44fb1ae4b69 (diff)
downloadkoopatlas-e5d1d12873748e500210a6feebf108ef501134e2.tar.gz
koopatlas-e5d1d12873748e500210a6feebf108ef501134e2.zip
fixed a plethora of bugs
Diffstat (limited to '')
-rw-r--r--src/mapdata.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/mapdata.py b/src/mapdata.py
index 4ae87ae..b0d3f0f 100644
--- a/src/mapdata.py
+++ b/src/mapdata.py
@@ -149,11 +149,23 @@ class KPTileLayer(KPLayer):
@mapfile.dumpable('associate_layer')
class KPPathTileLayer(KPLayer):
- __dump_attribs__ = KPLayer.__dump_attribs__ + ('tileset', 'objects', 'doodads', 'associate')
+ __dump_attribs__ = KPLayer.__dump_attribs__ + ('tileset', 'objects', 'doodads')
+
+ def _dump(self, mapObj, dest):
+ if isinstance(self.associate, KPNode):
+ dest['associatedRef'] = ('node', mapObj.refNode(self.associate))
+ else:
+ dest['associatedRef'] = ('path', mapObj.refPath(self.associate))
def _load(self, mapObj, src):
+ assocType, assocID = src['associatedRef']
+
+ if assocType == 'path':
+ self.associate = mapObj.derefPath(assocID)
+ else:
+ self.associate = mapObj.derefNode(assocID)
+
self.updateCache()
- KP.mainWindow.pathNodeList.loadLayer(self)
def __repr__(self):
return "<KPPathTileLayer with %r connected to %r>" % (self.tileset, self.associate)
@@ -173,8 +185,6 @@ class KPPathTileLayer(KPLayer):
self.updateCache()
- self.icon = KP.icon('LayerTile')
-
def _visibilityChanged(self, value):
for obj in self.objects:
item = obj.qtItem