From 274882231e3996948849ceabd2dbeadc5bca0494 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 20 Jan 2011 00:32:53 +0200 Subject: Add to testxml checking in monsters.xml for targetcursor and is particle file exist. --- testxml/testxml.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/testxml/testxml.py b/testxml/testxml.py index ca1dab1..8d1804a 100755 --- a/testxml/testxml.py +++ b/testxml/testxml.py @@ -655,8 +655,30 @@ def testMonsters(fileName): errors = errors + 1 name = "" + testTargetCursor(id, node, fileName) testSprites(id, node, False, True) testSounds(id, node, "monster") + testParticles(id, node, "particlefx") + + +def testTargetCursor(id, node, file): + try: + targetCursor = node.attributes["targetCursor"].value + if targetCursor != "small" and targetCursor != "medium" and targetCursor != "large": + showMsgFile(id, "unknown target cursor " + targetCursor) + except: + None + +def testParticles(id, node, nodeName): + particles = node.getElementsByTagName(nodeName) + for particle in particles: + try: + particlefx = particle.childNodes[0].data + except: + showMsgFile(id, "particle tag have incorrect data", True) + + testParticle(particlefx) + def testSounds(id, node, type): @@ -675,6 +697,7 @@ def testSounds(id, node, type): elif type == "item": if event != "hit" and event != "strike": print "error: incorrect sound event name " + event + " in id=" + id + errors = errors + 1 testSound(sound.childNodes[0].data) -- cgit v1.2.3-70-g09d2