From 64df3b0e7503b2da43d5448f788bb560e5a6881c Mon Sep 17 00:00:00 2001 From: Treeki Date: Wed, 26 Sep 2012 05:38:44 +0200 Subject: added world change nodes. I hope this works. --- src/mapdata.py | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'src/mapdata.py') 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): -- cgit v1.2.3