diff options
author | Treeki <treeki@gmail.com> | 2012-09-26 05:38:44 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2012-09-26 05:38:44 +0200 |
commit | 64df3b0e7503b2da43d5448f788bb560e5a6881c (patch) | |
tree | 878c5caaebfa82e938158651c86daaa4834fd022 /src/mapdata.py | |
parent | 04d6d49eed7b952f3ba61f1364e538c6e5c8d5a2 (diff) | |
download | koopatlas-64df3b0e7503b2da43d5448f788bb560e5a6881c.tar.gz koopatlas-64df3b0e7503b2da43d5448f788bb560e5a6881c.zip |
added world change nodes. I hope this works.
Diffstat (limited to '')
-rw-r--r-- | src/mapdata.py | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/mapdata.py b/src/mapdata.py index 2c88f9b..5bfe9d5 100644 --- a/src/mapdata.py +++ b/src/mapdata.py @@ -427,7 +427,7 @@ class KPDoodadLayer(KPLayer): class KPNode(object): __dump_attribs__ = ( 'position', 'actions', 'level', 'hasSecret', 'mapChange', - 'transition', 'mapID', 'foreignID') + 'transition', 'mapID', 'foreignID', 'worldDefID') def _dump(self, mapObj, dest): dest['exitIDs'] = map(mapObj.refPath, self.exits) @@ -447,6 +447,7 @@ class KPNode(object): self.transition = 0 self.mapID = None self.foreignID = None + self.worldDefID = None def isStop(self): return True if (self.level or self.mapChange or len(self.exits) != 2) else False @@ -548,18 +549,19 @@ class KPPathLayer(KPLayer): @mapfile.dumpable('world_definition') class KPWorldDef(object): - __dump_attribs__ = ('name', 'fs_hint_colours', 'fs_text_colours', 'hud_hint_colours', 'hud_text_colours', 'music_track_id') + __dump_attribs__ = ('uniqueKey', 'name', 'fsHintColours', 'fsTextColours', 'hudHintTransform', 'hudTextColours', 'musicTrackID') def __init__(self): + self.uniqueKey = -1 self.name = 'Untitled World' - self.fs_hint_colours = (0x000000FF,0x000000FF) - self.fs_text_colours = (0xFFFFFFFF,0xFFFFFFFF) + self.fsHintColours = ((0,0,0,255),(0,0,0,255)) + self.fsTextColours = ((255,255,255,255),(255,255,255,255)) - self.hud_hint_transform = (0,0,0) - self.hud_text_colours = (0xFFFFFFFF,0xFFFFFFFF) + self.hudHintTransform = (0,0,0) + self.hudTextColours = ((255,255,255,255),(255,255,255,255)) - self.music_track_id = 0 + self.musicTrackID = 0 @mapfile.dumpable('map_root') @@ -581,11 +583,6 @@ class KPMap(object): else: self.version = 1 - if 'bgName' in source: - self.bgName = source['bgName'] - else: - self.bgName = '/Maps/Water.brres' - def _dump(self, mapObj, dest): dest['version'] = self.version dest['bgName'] = self.bgName @@ -624,7 +621,14 @@ class KPMap(object): self.doodadModel = KPMap.DoodadModel(self.doodadDefinitions) self.worlds = [] + self.nextWorldKey = 1 + + self.bgName = '/Maps/Water.brres' + def allocateWorldDefKey(self): + key = self.nextWorldKey + self.nextWorldKey += 1 + return key # LAYERS class LayerModel(QtCore.QAbstractListModel): |