summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-09-25 23:53:49 +0200
committerTreeki <treeki@gmail.com>2012-09-25 23:53:49 +0200
commit04d6d49eed7b952f3ba61f1364e538c6e5c8d5a2 (patch)
tree6ce893e5003276fc5370358a825ae7303829d742 /src
parent214a447d606671766b5fb404a50f3af4f24369e4 (diff)
downloadkoopatlas-04d6d49eed7b952f3ba61f1364e538c6e5c8d5a2.tar.gz
koopatlas-04d6d49eed7b952f3ba61f1364e538c6e5c8d5a2.zip
the beginnings of a world description editor
Diffstat (limited to 'src')
-rw-r--r--src/mapdata.py20
-rw-r--r--src/worldeditor.py17
2 files changed, 36 insertions, 1 deletions
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):
diff --git a/src/worldeditor.py b/src/worldeditor.py
new file mode 100644
index 0000000..a2262ae
--- /dev/null
+++ b/src/worldeditor.py
@@ -0,0 +1,17 @@
+from common import *
+
+class KPWorldEditor(QtGui.QWidget):
+ def __init__(self, parent=None):
+ QtGui.QWidget.__init__(self, parent)
+ self.setWindowTitle('World Editor')
+
+ self.dataView = QtGui.QTableView(self)
+ self.addButton = QtGui.QPushButton('Add', self)
+ self.removedButton = QtGui.QPushButton('Remove', self)
+
+ layout = QtGui.QGridLayout(self)
+ layout.addWidget(self.dataView, 0, 0, 1, 2)
+ layout.addWidget(self.addButton, 1, 0, 1, 1)
+ layout.addWidget(self.removeButton, 1, 1, 1, 1)
+
+ self.currentWorlds = None