summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgumi <git@gumi.ca>2018-03-20 14:23:31 -0400
committergumi <git@gumi.ca>2018-03-20 14:23:31 -0400
commit1b5bc0c799492d5461ecbffa3406409abce0615c (patch)
treef28938f1885686906a8127e19678c873e6b8ea00
parente9d36834e9e449620b5d6a8b0896872197fc2d5b (diff)
downloadevol-tools-1b5bc0c799492d5461ecbffa3406409abce0615c.tar.gz
evol-tools-1b5bc0c799492d5461ecbffa3406409abce0615c.tar.bz2
evol-tools-1b5bc0c799492d5461ecbffa3406409abce0615c.tar.xz
evol-tools-1b5bc0c799492d5461ecbffa3406409abce0615c.zip
allow the tmx converter to ignore objects (not just warps)
-rwxr-xr-xhercules/tmx_converter.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/hercules/tmx_converter.py b/hercules/tmx_converter.py
index 8638a9c..82cdc98 100755
--- a/hercules/tmx_converter.py
+++ b/hercules/tmx_converter.py
@@ -75,6 +75,7 @@ class Object(object):
'name',
'x', 'y',
'w', 'h',
+ 'ignore',
)
class Mob(Object):
__slots__ = (
@@ -100,7 +101,7 @@ class Warp(Object):
'dest_map',
'dest_x',
'dest_y',
- 'npc_id',
+ 'npc_id',
'trigger_x',
'trigger_y',
) + other_warp_fields
@@ -118,7 +119,7 @@ class ContentHandler(xml.sax.ContentHandler):
'width', # width of the height layer
'height', # height of the height layer
'firstgid', # first gid of height layer
- 'heightmap',# height map
+ 'heightmap',# height map
'base', # base name of current map
'npc_dir', # world/map/npc/<base>
'mobs', # open file to _mobs.txt
@@ -271,6 +272,8 @@ class ContentHandler(xml.sax.ContentHandler):
print('</%s>' % name)
if name == u'object':
+ if hasattr(self.object, 'ignore'):
+ return;
obj = self.object
if isinstance(obj, Mob):
mob_id = obj.monster_id
@@ -403,7 +406,7 @@ def main(argv):
if os.path.isfile(posixpath.join(main.this_map_npc_dir, NPC_IMPORTS)):
npc_master.append('@include "%s"\n' % posixpath.join(SERVER_NPCS, base, NPC_IMPORTS))
-
+
map_db.write('%s %d\n' % (arg.split('.')[0], map_count))
map_conf.write(' "%s",\n' % (arg.split('.')[0]))
map_count += 1