diff orpg/mapper/fog_msg.py @ 13:211ac836b6a0 grumpy-goblin

{090731-00} Fixes problem with Name & Settings window, cleans code.
author sirebral
date Fri, 31 Jul 2009 15:22:11 -0500
parents 4385a7d0efd1
children 97265586402b
line wrap: on
line diff
--- a/orpg/mapper/fog_msg.py	Fri Jul 24 10:03:22 2009 -0500
+++ b/orpg/mapper/fog_msg.py	Fri Jul 31 15:22:11 2009 -0500
@@ -41,10 +41,8 @@
 
     def get_line(self,outline,action,output_act):
         elem = Element( "poly" )
-        if ( output_act ):
-            elem.setAttribute( "action", action )
-        if ( outline == 'all' ) or ( outline == 'none' ):
-            elem.setAttribute( "outline", outline )
+        if ( output_act ): elem.setAttribute( "action", action )
+        if ( outline == 'all' ) or ( outline == 'none' ): elem.setAttribute( "outline", outline )
         else:
             elem.setAttribute( "outline", "points" )
             for pair in string.split( outline, ";" ):
@@ -77,11 +75,9 @@
         #print "use_fog :",self.use_fog
         #print "output_action :",output_action
         #print "action :",action
-        if not (self.use_fog):
-            return ""
+        if not (self.use_fog): return ""
         fog_string = ""
-        if self.fogregion.isEmpty():
-            fog_string=self.get_line("all","del",output_action)
+        if self.fogregion.isEmpty(): fog_string=self.get_line("all","del",output_action)
         for ri in self.fogregion.GetRectList():
             x1=ri.GetX()
             x2=x1+ri.GetW()-1
@@ -96,8 +92,7 @@
             s += ">"
             s += fog_string
             s += "</fog>"
-        else:
-            s+="/>"
+        else: s+="/>"
         return s
 
     def interpret_dom(self,xml_dom):
@@ -127,10 +122,8 @@
                 #     polyline.append(IPoint().make(int(pt[0]),int(pt[1])))
             #print "length of polyline", len(polyline)
             if (len(polyline)>2):
-                if action=="del":
-                    self.fogregion.FromPolygon(polyline,0)
-                else:
-                    self.fogregion.FromPolygon(polyline,1)
+                if action=="del": self.fogregion.FromPolygon(polyline,0)
+                else: self.fogregion.FromPolygon(polyline,1)
 
     def init_from_dom(self,xml_dom):
         self.interpret_dom(xml_dom)