diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-05-17 12:41:41 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-05-17 12:44:59 -0700 |
commit | f142608716e8e5c0411715eb7bb0b88f65de0ee1 (patch) | |
tree | b30a65550fef201c5116b52d139e63b3fa7d2b53 /tools/tmx_converter.py | |
parent | cf071d9846890a24d8d462f82da9b6d0f96d8fd2 (diff) | |
download | serverdata-f142608716e8e5c0411715eb7bb0b88f65de0ee1.tar.gz serverdata-f142608716e8e5c0411715eb7bb0b88f65de0ee1.tar.bz2 serverdata-f142608716e8e5c0411715eb7bb0b88f65de0ee1.tar.xz serverdata-f142608716e8e5c0411715eb7bb0b88f65de0ee1.zip |
Make the tmx converter update resnametable.txt
If/when we use static instancing, we'll have to change this.
Diffstat (limited to 'tools/tmx_converter.py')
-rwxr-xr-x | tools/tmx_converter.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/tmx_converter.py b/tools/tmx_converter.py index 17773dc6..94cf0b2c 100755 --- a/tools/tmx_converter.py +++ b/tools/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() |