Mercurial > traipse_dev
comparison orpg/gametree/nodehandlers/core.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 | 12ba14d30baa |
children |
comparison
equal
deleted
inserted
replaced
182:4b2884f29a72 | 227:81d0bfd5e800 |
---|---|
19 # | 19 # |
20 # File: core.py | 20 # File: core.py |
21 # Author: Chris Davis | 21 # Author: Chris Davis |
22 # Maintainer: | 22 # Maintainer: |
23 # Version: | 23 # Version: |
24 # $Id: core.py,v 1.49 2007/12/07 20:39:48 digitalxero Exp $ | 24 # $Id: core.py,v Traipse 'Ornery-Orc' prof.ebral Exp $ |
25 # | 25 # |
26 # Description: The file contains code for the core nodehanlers | 26 # Description: The file contains code for the core nodehanlers |
27 # | 27 # |
28 | 28 |
29 __version__ = "$Id: core.py,v 1.49 2007/12/07 20:39:48 digitalxero Exp $" | 29 __version__ = "$Id: core.py,v Traipse 'Ornery-Orc' prof.ebral Exp $" |
30 | 30 |
31 from nodehandler_version import NODEHANDLER_VERSION | 31 from nodehandler_version import NODEHANDLER_VERSION |
32 from orpg.tools.InterParse import Parse | |
32 | 33 |
33 try: | 34 try: |
34 from orpg.orpg_windows import * | 35 from orpg.orpg_windows import * |
35 from orpg.dirpath import dir_struct | 36 from orpg.dirpath import dir_struct |
36 from orpg.orpgCore import component | 37 from orpg.orpgCore import component |
52 """ Base nodehandler with virtual functions and standard implmentations """ | 53 """ Base nodehandler with virtual functions and standard implmentations """ |
53 def __init__(self,xml,tree_node): | 54 def __init__(self,xml,tree_node): |
54 self.xml = xml | 55 self.xml = xml |
55 self.mytree_node = tree_node | 56 self.mytree_node = tree_node |
56 self.tree = component.get('tree') | 57 self.tree = component.get('tree') |
57 #self.tree = component.get('tree_fs') | |
58 self.frame = component.get('frame') | 58 self.frame = component.get('frame') |
59 self.chat = component.get('chat') | 59 self.chat = component.get('chat') |
60 self.drag = True | 60 self.drag = True |
61 self.myeditor = None # designing | 61 self.myeditor = None # designing |
62 self.myviewer = None # prett print | 62 self.myviewer = None # prett print |
280 return None | 280 return None |
281 | 281 |
282 def get_html_panel(self,parent): | 282 def get_html_panel(self,parent): |
283 html_str = "<html><body bgcolor=\"#FFFFFF\" >"+self.tohtml()+"</body></html>" | 283 html_str = "<html><body bgcolor=\"#FFFFFF\" >"+self.tohtml()+"</body></html>" |
284 wnd = wx.html.HtmlWindow(parent,-1) | 284 wnd = wx.html.HtmlWindow(parent,-1) |
285 html_str = self.chat.ParseDice(html_str) | 285 html_str = Parse.Dice(html_str) |
286 wnd.SetPage(html_str) | 286 wnd.SetPage(html_str) |
287 return wnd | 287 return wnd |
288 | 288 |
289 def get_size_constraint(self): | 289 def get_size_constraint(self): |
290 return 0 | 290 return 0 |
343 if ord(c) < 128: u_txt += c | 343 if ord(c) < 128: u_txt += c |
344 else: bad_txt_found = 1 | 344 else: bad_txt_found = 1 |
345 if bad_txt_found: | 345 if bad_txt_found: |
346 wx.MessageBox("Some non 7-bit ASCII characters found and stripped","Warning!") | 346 wx.MessageBox("Some non 7-bit ASCII characters found and stripped","Warning!") |
347 txt = u_txt | 347 txt = u_txt |
348 print txt, self.handler, self.handler.xml | |
348 self.handler.text._set_nodeValue(txt) | 349 self.handler.text._set_nodeValue(txt) |
349 | 350 |
350 | 351 |
351 | 352 |
352 ########################## | 353 ########################## |
384 self.file_node = self.xml[0] | 385 self.file_node = self.xml[0] |
385 self.frame = component.get('frame') | 386 self.frame = component.get('frame') |
386 | 387 |
387 def on_ldclick(self,evt): | 388 def on_ldclick(self,evt): |
388 file_name = self.file_node.get("name") | 389 file_name = self.file_node.get("name") |
389 self.tree.insert_xml(open(orpg.dirpath.dir_struct["nodes"] + file_name,"r").read()) | 390 try: self.tree.insert_xml(open(orpg.dirpath.dir_struct["nodes"] + file_name,"r").read()) |
391 except: wx.MessageBox('Invalid File', 'Error') | |
390 return 1 | 392 return 1 |
391 | 393 |
392 def on_design(self,evt): | 394 def on_design(self,evt): |
393 tlist = ['Title','File Name'] | 395 tlist = ['Title','File Name'] |
394 vlist = [self.xml.get("name"), | 396 vlist = [self.xml.get("name"), |