comparison orpg/mapper/grid.py @ 227:81d0bfd5e800 alpha

Traipse Alpha 'OpenRPG' {100612-00} Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc's main goal is to offer more advanced features and enhance the productivity of the user. Update Summary (Preparing to close updates) New Features: New to Map, can re-order Grid, Miniatures, and Whiteboard layer draw order Fixes: Fix to InterParse that was causing an Infernal Loop with Namespace Internal Fix to XML data, removed old Minidom and switched to Element Tree Fix to Server that was causing eternal attempt to find a Server ID, in Register Rooms thread Fix to metaservers.xml file not being created
author sirebral
date Sat, 12 Jun 2010 03:50:37 -0500
parents 06f10429eedc
children
comparison
equal deleted inserted replaced
182:4b2884f29a72 227:81d0bfd5e800
19 # 19 #
20 # File: mapper/gird.py 20 # File: mapper/gird.py
21 # Author: OpenRPG Team 21 # Author: OpenRPG Team
22 # Maintainer: 22 # Maintainer:
23 # Version: 23 # Version:
24 # $Id: grid.py,v 1.29 2007/12/07 20:39:49 digitalxero Exp $ 24 # $Id: grid.py,v Traipse 'Ornery-Orc' prof.ebral Exp $
25 # 25 #
26 # Description: 26 # Description:
27 # 27 #
28 __version__ = "$Id: grid.py,v 1.29 2007/12/07 20:39:49 digitalxero Exp $" 28 __version__ = "$Id: grid.py,v Traipse 'Ornery-Orc' prof.ebral Exp $"
29 29
30 from base import * 30 from base import *
31 from isometric import * 31 from isometric import *
32 from miniatures import SNAPTO_ALIGN_CENTER 32 from miniatures import SNAPTO_ALIGN_CENTER
33 from miniatures import SNAPTO_ALIGN_TL 33 from miniatures import SNAPTO_ALIGN_TL
404 self.isUpdated = False 404 self.isUpdated = False
405 return xml_str 405 return xml_str
406 else: return '' 406 else: return ''
407 407
408 def layerTakeDOM(self, xml_dom): 408 def layerTakeDOM(self, xml_dom):
409 if xml_dom.hasAttribute("color"): 409 color = xml_dom.get('color')
410 r,g,b = self.r_h.rgb_tuple(xml_dom.getAttribute("color")) 410 if color != None:
411 r,g,b = self.r_h.rgb_tuple(color)
411 self.set_color(cmpColour(r,g,b)) 412 self.set_color(cmpColour(r,g,b))
412 #backwards compatible with non-isometric map formated clients 413 #backwards compatible with non-isometric map formated clients
413 ratio = RATIO_DEFAULT 414 ratio = RATIO_DEFAULT if xml_dom.get("ratio") == None else xml_dom.get('ratio')
414 if xml_dom.hasAttribute("ratio"): ratio = xml_dom.getAttribute("ratio") 415 mode = xml_dom.get('mode')
415 if xml_dom.hasAttribute("mode"): 416 if mode != None: self.SetMode(int(mode))
416 self.SetMode(int(xml_dom.getAttribute("mode"))) 417 size = xml_dom.get('size')
417 if xml_dom.hasAttribute("size"): 418 if size != None:
418 self.unit_size = int(xml_dom.getAttribute("size")) 419 self.unit_size = int(size)
419 self.unit_size_y = self.unit_size 420 self.unit_size_y = self.unit_size
420 if xml_dom.hasAttribute("snap"): 421 if (xml_dom.get("snap") == 'True') or (xml_dom.get("snap") == "1"): self.snap = True
421 if (xml_dom.getAttribute("snap") == 'True') or (xml_dom.getAttribute("snap") == "1"): self.snap = True 422 else: self.snap = False
422 else: self.snap = False 423 line = xml_dom.get('line')
423 if xml_dom.hasAttribute("line"): 424 if line != None: self.SetLine(int(line))
424 self.SetLine(int(xml_dom.getAttribute("line"))) 425