summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-04-01 17:36:12 -0300
committerJesusaves <cpntb1@ymail.com>2021-04-01 17:36:12 -0300
commit0e48afede60d3efb502b8428092811f5ac8e31bd (patch)
treef001504a0b690f5e76b28c257d074e03dbca6130
parent1f910f44e2614e78b0cb93c423390082ad0902b4 (diff)
downloadtools-0e48afede60d3efb502b8428092811f5ac8e31bd.tar.gz
tools-0e48afede60d3efb502b8428092811f5ac8e31bd.tar.bz2
tools-0e48afede60d3efb502b8428092811f5ac8e31bd.tar.xz
tools-0e48afede60d3efb502b8428092811f5ac8e31bd.zip
Enforce a Tiled minimum version. Initally set to 1.3 but 1.4+ advised
-rwxr-xr-xtestxml/testxml.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/testxml/testxml.py b/testxml/testxml.py
index af7561c..6ae9e12 100755
--- a/testxml/testxml.py
+++ b/testxml/testxml.py
@@ -44,6 +44,7 @@ warnings = 0
errDict = set()
safeDye = False
borderSize = 14 # Required 18 # Original 14
+tiledVersion = 13 # Minimum Tiled version, advised "14" for Tiled 1.4
colorsList = set()
showAll = False
silent = False
@@ -1404,9 +1405,20 @@ def testMap(mapName, file, path):
mapHeight = readAttrI(root, "height", 0, "error: missing map height: " + file, True)
mapTileWidth = readAttrI(root, "tilewidth", 0, "error: missing tile width: " + file, True)
mapTileHeight = readAttrI(root, "tileheight", 0, "error: missing tile height: " + file, True)
+ mapVersion = readAttr(root, "version", "1.0", "error: missing map version: " + file, True)
+
if mapWidth == 0 or mapHeight == 0 or mapTileWidth == 0 or mapTileHeight == 0:
return
+ mapVersion = mapVersion.replace(".", "")
+ try:
+ mapVersion = int(mapVersion)
+ except:
+ showMsgFile(file, "Invalid map version: " + str(mapVersion), False)
+
+ if mapVersion < tiledVersion:
+ showMsgFile(file, "Outdated map version: " + str(mapVersion), False)
+
if mapWidth < borderSize * 2 + 1:
if silent == False or file.find("maps/test") != 0:
showMsgFile(file, "map width to small: " + str(mapWidth), False)