summaryrefslogtreecommitdiff
path: root/tmx_converter.py
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-05-17 12:41:41 -0700
committerBen Longbons <b.r.longbons@gmail.com>2013-05-17 12:44:59 -0700
commit09e183bbe00971b57f29a88431e36ea7139c4e7a (patch)
tree880dc4795d89af7d2378d282021369b559a24c63 /tmx_converter.py
parentf4237e0e4c265f92774230713b95d3d58bae0664 (diff)
downloadtools-09e183bbe00971b57f29a88431e36ea7139c4e7a.tar.gz
tools-09e183bbe00971b57f29a88431e36ea7139c4e7a.tar.bz2
tools-09e183bbe00971b57f29a88431e36ea7139c4e7a.tar.xz
tools-09e183bbe00971b57f29a88431e36ea7139c4e7a.zip
Make the tmx converter update resnametable.txt
If/when we use static instancing, we'll have to change this.
Diffstat (limited to 'tmx_converter.py')
-rwxr-xr-xtmx_converter.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tmx_converter.py b/tmx_converter.py
index 17773dc..94cf0b2 100755
--- a/tmx_converter.py
+++ b/tmx_converter.py
@@ -328,11 +328,13 @@ def main(argv):
mob_names[int(k)] = v.strip()
npc_master = []
+ map_basenames = []
for arg in os.listdir(tmx_dir):
base, ext = posixpath.splitext(arg)
if ext == '.tmx':
+ map_basenames.append(base)
tmx = posixpath.join(tmx_dir, arg)
wlk = posixpath.join(wlk_dir, base + '.wlk')
this_map_npc_dir = posixpath.join(npc_dir, base)
@@ -344,6 +346,9 @@ def main(argv):
xml.sax.parse(tmx, ContentHandler(wlk, this_map_npc_dir, mobs, warps, imports))
npc_master.append('import: %s\n' % posixpath.join(SERVER_NPCS, base, NPC_IMPORTS))
+ with open(posixpath.join(wlk_dir, 'resnametable.txt'), 'w') as resname:
+ for base in sorted(map_basenames):
+ resname.write('%s.gat#%s.wlk#\n' % (base, base))
with open(posixpath.join(npc_dir, NPC_MASTER_IMPORTS), 'w') as out:
out.write('// %s\n\n' % MESSAGE)
npc_master.sort()