comparison orpg/gametree/gametree.py @ 140:e842a5f1b775 beta

Traipse Beta 'OpenRPG' {091123-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 (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 Recursion method, mapping, and context sensitivity. !Infinite Loops return error instead of freezing the software! New Syntax added for custom PC sheets Tip of the Day added, from Core and community Fixed Whiteboard ID to prevent random line or text deleting. Modified ID's to prevent non updated clients from ruining the fix.
author sirebral
date Mon, 23 Nov 2009 03:36:26 -0600
parents dcf4fbe09b70
children 6081bdc2b8d5
comparison
equal deleted inserted replaced
135:dcf4fbe09b70 140:e842a5f1b775
107 self.Bind(wx.EVT_CHAR, self.on_char) 107 self.Bind(wx.EVT_CHAR, self.on_char)
108 self.Bind(wx.EVT_KEY_UP, self.on_key_up) 108 self.Bind(wx.EVT_KEY_UP, self.on_key_up)
109 self.id = 1 109 self.id = 1
110 self.dragging = False 110 self.dragging = False
111 self.last_save_dir = dir_struct["user"] 111 self.last_save_dir = dir_struct["user"]
112 self.tree_map = [] 112 self.tree_map = {}
113 113
114 #Create tree from default if it does not exist 114 #Create tree from default if it does not exist
115 validate.config_file("tree.xml","default_tree.xml") 115 validate.config_file("tree.xml","default_tree.xml")
116 component.add("tree", self) 116 component.add("tree", self)
117 117
407 item = self.GetSelection() 407 item = self.GetSelection()
408 obj = self.GetPyData(item) 408 obj = self.GetPyData(item)
409 type = f.GetFilterIndex() 409 type = f.GetFilterIndex()
410 with open(f.GetPath(),"w") as f: 410 with open(f.GetPath(),"w") as f:
411 data = "<html><head><title>"+obj.xml.get("name")+"</title></head>" 411 data = "<html><head><title>"+obj.xml.get("name")+"</title></head>"
412 data += "<body bgcolor=\"#FFFFFF\" >"+obj.tohtml()+"</body></html>" 412 data += "<body bgcolor='#FFFFFF' >"+obj.tohtml()+"</body></html>"
413 for tag in ("</tr>","</td>","</th>","</table>","</html>","</body>"): 413 for tag in ("</tr>","</td>","</th>","</table>","</html>","</body>"):
414 data = data.replace(tag,tag+"\n") 414 data = data.replace(tag,tag+"\n")
415 f.write(data) 415 f.write(data)
416 self.last_save_dir, throwaway = os.path.split( f.GetPath() ) 416 self.last_save_dir, throwaway = os.path.split( f.GetPath() )
417 f.Destroy() 417 f.Destroy()
477 def on_wizard(self, evt): 477 def on_wizard(self, evt):
478 item = self.GetSelection() 478 item = self.GetSelection()
479 obj = self.GetPyData(item) 479 obj = self.GetPyData(item)
480 name = "New " + obj.xml_root.get("name") 480 name = "New " + obj.xml_root.get("name")
481 icon = obj.xml_root.get("icon") 481 icon = obj.xml_root.get("icon")
482 xml_data = "<nodehandler name=\""+name+"\" icon=\"" + icon + "\" module=\"core\" class=\"node_loader\" >" 482 xml_data = "<nodehandler name='"+name+"' icon='" + icon + "' module='core' class='node_loader' >"
483 xml_data += xml.toxml(obj) 483 xml_data += xml.toxml(obj)
484 xml_data += "</nodehandler>" 484 xml_data += "</nodehandler>"
485 self.insert_xml(xml_data) 485 self.insert_xml(xml_data)
486 logger.debug(xml_data) 486 logger.debug(xml_data)
487 487
685 test = self.GetItemParent(test) 685 test = self.GetItemParent(test)
686 family_tree.append(parent) 686 family_tree.append(parent)
687 return family_tree 687 return family_tree
688 688
689 def load_xml(self, xml_element, parent_node, prev_node=None): 689 def load_xml(self, xml_element, parent_node, prev_node=None):
690 if parent_node == self.root:
691 self.tree_map[xml_element.get('name')] = {}
692 self.tree_map[xml_element.get('name')]['node'] = xml_element
690 if parent_node != self.root: 693 if parent_node != self.root:
691 ## Loading XML seems to lag on Grids and Images need a cache for load speed ## 694 ## Loading XML seems to lag on Grids and Images need a cache for load speed ##
692 family_tree = self.get_tree_map(parent_node) 695 family_tree = self.get_tree_map(parent_node)
693 family_tree.reverse() 696 family_tree.reverse()
694 map_str = '' #'!@' 697 map_str = '' #'!@'