From f142608716e8e5c0411715eb7bb0b88f65de0ee1 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Fri, 17 May 2013 12:41:41 -0700 Subject: Make the tmx converter update resnametable.txt If/when we use static instancing, we'll have to change this. --- tools/tmx_converter.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tools/tmx_converter.py') 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() -- cgit v1.2.3-70-g09d2