diff orpg/mapper/fog.py @ 137:54446a995007 alpha

Traipse Alpha 'OpenRPG' {091018-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 (Cleaning up for Beta) Added Bookmarks Fix to Remote Admin Commands Minor fix to text based Server Fix to Pretty Print, from Core Fix to Splitter Nodes not being created Fix to massive amounts of images loading, from Core Added 'boot' command to remote admin Added confirmation window for sent nodes Minor changes to allow for portability to an OpenSUSE linux OS Miniatures Layer pop up box allows users to turn off Mini labels, from FlexiRPG Zoom Mouse plugin added Images added to Plugin UI Switching to Element Tree Map efficiency, from FlexiRPG Added Status Bar to Update Manager default_manifest.xml renamed to default_upmana.xml Cleaner clode for saved repositories New TrueDebug Class in orpg_log (See documentation for usage) Mercurial's hgweb folder is ported to upmana **Pretty important update that can help remove thousands of dead children from your gametree. **Children, <forms />, <group_atts />, <horizontal />, <cols />, <rows />, <height />, etc... are all tags now. Check your gametree and look for dead children!! **New Gametree Recusion method, mapping, and context sensitivity. !!Alpha - Watch out for infinite loops!!
author sirebral
date Wed, 18 Nov 2009 19:57:52 -0600
parents 217fb049bd00
children 8e07c1a2c69b
line wrap: on
line diff
--- a/orpg/mapper/fog.py	Mon Nov 16 19:13:41 2009 -0600
+++ b/orpg/mapper/fog.py	Wed Nov 18 19:57:52 2009 -0600
@@ -209,8 +209,7 @@
         if show == "Yes": self.canvas.frame.session.send(xml_str)
 
     def layerToXML(self, action="update"):
-        if not self.use_fog:
-            return ""
+        if not self.use_fog: return ""
         fog_string = ""
         ri = wx.RegionIterator(self.fogregion)
         if not (ri.HaveRects()): fog_string = FogArea("all", self.log).toxml("del")
@@ -245,11 +244,11 @@
             if not self.use_fog:
                 self.use_fog = True
                 self.recompute_fog()
-            if xml_dom.hasAttribute('serial'): self.serial_number = int(xml_dom.getAttribute('serial'))
-            children = xml_dom._get_childNodes()
+            if xml_dom.get('serial'): self.serial_number = int(xml_dom.get('serial'))
+            children = xml_dom.getchildren()
             for l in children:
-                action = l.getAttribute("action")
-                outline = l.getAttribute("outline")
+                action = l.get("action")
+                outline = l.get("outline")
                 if (outline == "all"):
                     polyline = [IPoint().make(0,0), IPoint().make(self.width-1, 0),
                               IPoint().make(self.width-1, self.height-1),
@@ -262,10 +261,10 @@
                     polyline = []
                     lastx = None
                     lasty = None
-                    list = l._get_childNodes()
+                    list = l.getchildren()
                     for point in list:
-                        x = point.getAttribute( "x" )
-                        y = point.getAttribute( "y" )
+                        x = point.get( "x" )
+                        y = point.get( "y" )
                         if (x != lastx or y != lasty):
                             polyline.append(IPoint().make(int(x), int(y)))
                         lastx = x