comparison 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
comparison
equal deleted inserted replaced
136:b4e02e8cd314 137:54446a995007
207 xml_str += poly.toxml("del") 207 xml_str += poly.toxml("del")
208 xml_str += "</fog></map>" 208 xml_str += "</fog></map>"
209 if show == "Yes": self.canvas.frame.session.send(xml_str) 209 if show == "Yes": self.canvas.frame.session.send(xml_str)
210 210
211 def layerToXML(self, action="update"): 211 def layerToXML(self, action="update"):
212 if not self.use_fog: 212 if not self.use_fog: return ""
213 return ""
214 fog_string = "" 213 fog_string = ""
215 ri = wx.RegionIterator(self.fogregion) 214 ri = wx.RegionIterator(self.fogregion)
216 if not (ri.HaveRects()): fog_string = FogArea("all", self.log).toxml("del") 215 if not (ri.HaveRects()): fog_string = FogArea("all", self.log).toxml("del")
217 while ri.HaveRects(): 216 while ri.HaveRects():
218 #if "__WXGTK__" not in wx.PlatformInfo: 217 #if "__WXGTK__" not in wx.PlatformInfo:
243 def layerTakeDOM(self, xml_dom): 242 def layerTakeDOM(self, xml_dom):
244 try: 243 try:
245 if not self.use_fog: 244 if not self.use_fog:
246 self.use_fog = True 245 self.use_fog = True
247 self.recompute_fog() 246 self.recompute_fog()
248 if xml_dom.hasAttribute('serial'): self.serial_number = int(xml_dom.getAttribute('serial')) 247 if xml_dom.get('serial'): self.serial_number = int(xml_dom.get('serial'))
249 children = xml_dom._get_childNodes() 248 children = xml_dom.getchildren()
250 for l in children: 249 for l in children:
251 action = l.getAttribute("action") 250 action = l.get("action")
252 outline = l.getAttribute("outline") 251 outline = l.get("outline")
253 if (outline == "all"): 252 if (outline == "all"):
254 polyline = [IPoint().make(0,0), IPoint().make(self.width-1, 0), 253 polyline = [IPoint().make(0,0), IPoint().make(self.width-1, 0),
255 IPoint().make(self.width-1, self.height-1), 254 IPoint().make(self.width-1, self.height-1),
256 IPoint().make(0, self.height-1)] 255 IPoint().make(0, self.height-1)]
257 elif (outline == "none"): 256 elif (outline == "none"):
260 self.fog_bmp = None 259 self.fog_bmp = None
261 else: 260 else:
262 polyline = [] 261 polyline = []
263 lastx = None 262 lastx = None
264 lasty = None 263 lasty = None
265 list = l._get_childNodes() 264 list = l.getchildren()
266 for point in list: 265 for point in list:
267 x = point.getAttribute( "x" ) 266 x = point.get( "x" )
268 y = point.getAttribute( "y" ) 267 y = point.get( "y" )
269 if (x != lastx or y != lasty): 268 if (x != lastx or y != lasty):
270 polyline.append(IPoint().make(int(x), int(y))) 269 polyline.append(IPoint().make(int(x), int(y)))
271 lastx = x 270 lastx = x
272 lasty = y 271 lasty = y
273 if (len(polyline) > 1): self.createregn2(polyline, action, "No") 272 if (len(polyline) > 1): self.createregn2(polyline, action, "No")