From 04d6d49eed7b952f3ba61f1364e538c6e5c8d5a2 Mon Sep 17 00:00:00 2001 From: Treeki Date: Tue, 25 Sep 2012 23:53:49 +0200 Subject: the beginnings of a world description editor --- src/mapdata.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/mapdata.py') diff --git a/src/mapdata.py b/src/mapdata.py index bdb8e2a..2c88f9b 100644 --- a/src/mapdata.py +++ b/src/mapdata.py @@ -546,9 +546,25 @@ class KPPathLayer(KPLayer): item.setFlag(flag, value) +@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') + + def __init__(self): + self.name = 'Untitled World' + + self.fs_hint_colours = (0x000000FF,0x000000FF) + self.fs_text_colours = (0xFFFFFFFF,0xFFFFFFFF) + + self.hud_hint_transform = (0,0,0) + self.hud_text_colours = (0xFFFFFFFF,0xFFFFFFFF) + + self.music_track_id = 0 + + @mapfile.dumpable('map_root') class KPMap(object): - __dump_attribs__ = ('layers', 'associateLayers', 'nextLayerNumber', 'doodadDefinitions') + __dump_attribs__ = ('layers', 'associateLayers', 'nextLayerNumber', 'doodadDefinitions', 'worlds') def _preload(self, src): # we need this early so we can use the deref methods! @@ -607,6 +623,8 @@ class KPMap(object): self.doodadDefinitions = [] self.doodadModel = KPMap.DoodadModel(self.doodadDefinitions) + self.worlds = [] + # LAYERS class LayerModel(QtCore.QAbstractListModel): -- cgit v1.2.3