diff options
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): |