Mercurial > traipse_dev
comparison orpg/mapper/miniatures_handler.py @ 66:c54768cffbd4 ornery-dev
Traipse Dev 'OpenRPG' {090818-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:
*Unstable*
This is the first wave of Code Refinement updates. Includes new material from Core Beta; new debugger material (partially implemented), beginnings of switch to etree, TerminalWriter, and a little more. open_rpg has been renamed to component; functioning now as component.get(), component.add(), component.delete(). This version has known bugs, specifically with the gametree and nodes. I think the XML files where not removed during testing of Core and switching back.
author | sirebral |
---|---|
date | Tue, 18 Aug 2009 06:33:37 -0500 |
parents | 5aff3ef1ae46 |
children | 449a8900f9ac |
comparison
equal
deleted
inserted
replaced
65:4840657c23c5 | 66:c54768cffbd4 |
---|---|
162 dc.SetUserScale(self.canvas.layers['grid'].mapscale,self.canvas.layers['grid'].mapscale) | 162 dc.SetUserScale(self.canvas.layers['grid'].mapscale,self.canvas.layers['grid'].mapscale) |
163 x = dc.DeviceToLogicalX(0) | 163 x = dc.DeviceToLogicalX(0) |
164 y = dc.DeviceToLogicalY(0) | 164 y = dc.DeviceToLogicalY(0) |
165 thread.start_new_thread(self.canvas.layers['miniatures'].upload, (postdata, dlg.GetPath()), {'pos':cmpPoint(x,y)}) | 165 thread.start_new_thread(self.canvas.layers['miniatures'].upload, (postdata, dlg.GetPath()), {'pos':cmpPoint(x,y)}) |
166 else: | 166 else: |
167 try: min_url = open_rpg.get_component("cherrypy") + filename | 167 try: min_url = component.get("cherrypy") + filename |
168 except: return | 168 except: return |
169 min_url = dlg.GetDirectory().replace(orpg.dirpath.dir_struct["user"]+'webfiles' + os.sep, | 169 min_url = dlg.GetDirectory().replace(orpg.dirpath.dir_struct["user"]+'webfiles' + os.sep, |
170 open_rpg.get_component("cherrypy")) + '/' + filename | 170 component.get("cherrypy")) + '/' + filename |
171 # build url | 171 # build url |
172 if min_url == "" or min_url == "http://": return | 172 if min_url == "" or min_url == "http://": return |
173 if min_url[:7] != "http://": min_url = "http://" + min_url | 173 if min_url[:7] != "http://": min_url = "http://" + min_url |
174 # make label | 174 # make label |
175 if self.auto_label and min_url[-4:-3] == '.': | 175 if self.auto_label and min_url[-4:-3] == '.': |
353 min_xml = self.sel_rmin.toxml(action="new") | 353 min_xml = self.sel_rmin.toxml(action="new") |
354 node_begin = "<nodehandler module='map_miniature_nodehandler' class='map_miniature_handler' name='" | 354 node_begin = "<nodehandler module='map_miniature_nodehandler' class='map_miniature_handler' name='" |
355 if self.sel_rmin.label: node_begin += self.sel_rmin.label + "'" | 355 if self.sel_rmin.label: node_begin += self.sel_rmin.label + "'" |
356 else: node_begin += "Unnamed Miniature'" | 356 else: node_begin += "Unnamed Miniature'" |
357 node_begin += ">" | 357 node_begin += ">" |
358 gametree = open_rpg.get_component('tree') | 358 gametree = component.get('tree') |
359 node_xml = node_begin + min_xml + '</nodehandler>' | 359 node_xml = node_begin + min_xml + '</nodehandler>' |
360 #print "Sending this XML to insert_xml:" + node_xml | 360 #print "Sending this XML to insert_xml:" + node_xml |
361 gametree.insert_xml(str(node_xml)) | 361 gametree.insert_xml(str(node_xml)) |
362 elif id == MIN_SHOW_HIDE: | 362 elif id == MIN_SHOW_HIDE: |
363 if self.sel_rmin.hide: self.sel_rmin.hide = 0 | 363 if self.sel_rmin.hide: self.sel_rmin.hide = 0 |
744 | 744 |
745 #################################################################### | 745 #################################################################### |
746 ## helper functions | 746 ## helper functions |
747 | 747 |
748 def infoPost(self, message): | 748 def infoPost(self, message): |
749 open_rpg.get_component("chat").InfoPost(message) | 749 component.get("chat").InfoPost(message) |
750 | 750 |
751 def role_is_gm_or_player(self): | 751 def role_is_gm_or_player(self): |
752 session = self.canvas.frame.session | 752 session = self.canvas.frame.session |
753 if (session.my_role() <> session.ROLE_GM) and (session.my_role() <> session.ROLE_PLAYER) and (session.use_roles()): | 753 if (session.my_role() <> session.ROLE_GM) and (session.my_role() <> session.ROLE_PLAYER) and (session.use_roles()): |
754 self.infoPost("You must be either a player or GM to use the miniature Layer") | 754 self.infoPost("You must be either a player or GM to use the miniature Layer") |