tms2map: now supports external tilesets
authorLukas Krickl <lukas@krickl.dev>
Sat, 5 Jul 2025 07:51:17 +0000 (09:51 +0200)
committerLukas Krickl <lukas@krickl.dev>
Sat, 5 Jul 2025 07:51:17 +0000 (09:51 +0200)
This will make re-using them easier in the future

tools/tms2map.py

index 57c9eed246daaee6c5e8c447ce1956a3fe87801c..d2e950409e42596450a46495c1ccdcbadf60fdbf 100755 (executable)
@@ -121,6 +121,11 @@ def get_flag(tile):
 
 # get all flags and write them to TILE_FLAGS
 def get_flags(tileset):
+    # do we have to load a tileset?
+    tilesetfile = os.path.join(os.path.dirname(src),tileset.attrib['source'])
+    tileset = ET.parse(tilesetfile).getroot()
+    
+
     for child in tileset:
         if child.tag == 'tile':
             get_flag(child)