comparison orpg/mapper/miniatures_handler.py @ 119:9314d63c0941 alpha

Traipse Alpha 'OpenRPG' {091029-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: Adds Bookmarks (Alpha) with cool Smiley Star and Plus Symbol images! Changes made to the map for increased portability. SnowDog has changes planned in Core, though. Added an initial push to the BCG. Not much to see, just shows off how it is re-writing Main code. Fix to remote admin commands Minor fix to texted based server, works in /System/ folder Some Core changes to gametree to correctly disply Pretty Print, thanks David! Fix to Splitter Nodes not being created. Added images to Plugin Control panel for Autostart feature Fix to massive amounts of images loading; from Core fix to gsclient so with_statement imports Added 'boot' command to remote admin Prep work in Pass tool for remote admin rankings and different passwords, ei, Server, Admin, Moderator, etc. Remote Admin Commands more organized, more prep work. Added Confirmation window for sent nodes. Minor changes to allow for portability to an OpenSUSE linux OS (hopefully without breaking) {091028} 00: Made changes to gametree to start working with Element Tree, mostly from Core Minor changes to Map to start working with Element Tree, from Core Preliminary changes to map efficiency, from FlexiRPG Miniatures Layer pop up box allows users to turn off Mini labels, from FlexiRPG Changes to main.py to start working with Element Tree {091029} 00: Changes made to server to start working with Element Tree. Changes made to Meta Server Lib. Prepping test work for a multi meta network page. Minor bug fixed with mini to gametree Zoom Mouse plugin added. Known Issue: Disconnecting causes an server side error. XML data is not being passed correctly.
author sirebral
date Thu, 29 Oct 2009 20:35:28 -0500
parents 217fb049bd00
children 54446a995007
comparison
equal deleted inserted replaced
118:217fb049bd00 119:9314d63c0941
356 self.deselectAndRefresh() 356 self.deselectAndRefresh()
357 return 357 return
358 elif id == MIN_REMOVE: self.canvas.layers['miniatures'].del_miniature(self.sel_rmin) 358 elif id == MIN_REMOVE: self.canvas.layers['miniatures'].del_miniature(self.sel_rmin)
359 elif id == MIN_TO_GAMETREE: 359 elif id == MIN_TO_GAMETREE:
360 ### Alpha ### implements ElementTree 360 ### Alpha ### implements ElementTree
361 min_xml = self.sel_rmin.toxml(action="new") 361 mini = self.sel_rmin.toxml(action="new")
362 node = Element('nodehandler') 362 node = Element('nodehandler')
363 mini = fromstring(min_xml)
364 node.set('module', 'map_miniature_nodehandler') 363 node.set('module', 'map_miniature_nodehandler')
365 node.set('class', 'map_miniature_handler') 364 node.set('class', 'map_miniature_handler')
366 name = self.sel_rmin.label if self.sel_rmin.label else 'Unnamed Miniature' 365 name = self.sel_rmin.label if self.sel_rmin.label else 'Unnamed Miniature'
367 node.set('name', name) 366 node.set('name', name)
368 node.append(mini) 367 node.append(mini)
496 self.canvas.send_map_data() 495 self.canvas.send_map_data()
497 496
498 def on_miniature(self, evt): 497 def on_miniature(self, evt):
499 session = self.canvas.frame.session 498 session = self.canvas.frame.session
500 if (session.my_role() != session.ROLE_GM) and (session.my_role() != session.ROLE_PLAYER) and (session.use_roles()): 499 if (session.my_role() != session.ROLE_GM) and (session.my_role() != session.ROLE_PLAYER) and (session.use_roles()):
500 print session.my_role()
501 self.infoPost("You must be either a player or GM to use the miniature Layer") 501 self.infoPost("You must be either a player or GM to use the miniature Layer")
502 return 502 return
503 min_url = self.min_url.GetValue() 503 min_url = self.min_url.GetValue()
504 # build url 504 # build url
505 if min_url == "" or min_url == "http://": return 505 if min_url == "" or min_url == "http://": return
769 def infoPost(self, message): 769 def infoPost(self, message):
770 component.get("chat").InfoPost(message) 770 component.get("chat").InfoPost(message)
771 771
772 def role_is_gm_or_player(self): 772 def role_is_gm_or_player(self):
773 session = self.canvas.frame.session 773 session = self.canvas.frame.session
774 if (session.my_role() <> session.ROLE_GM) and (session.my_role() <> session.ROLE_PLAYER) and (session.use_roles()): 774 print session.my_role(), session.ROLE_GM
775 if (session.my_role() != session.ROLE_GM) and (session.my_role() != session.ROLE_PLAYER) and (session.use_roles()):
776 print 'role is gm or player'
775 self.infoPost("You must be either a player or GM to use the miniature Layer") 777 self.infoPost("You must be either a player or GM to use the miniature Layer")
776 return False 778 return False
777 return True 779 return True
778 780
779 def role_is_gm(self): 781 def role_is_gm(self):
780 session = self.canvas.frame.session 782 session = self.canvas.frame.session
781 if (session.my_role() <> session.ROLE_GM) and (session.use_roles()): return False 783 if (session.my_role() != session.ROLE_GM) and (session.use_roles()): return False
782 return True 784 return True
783 785
784 def alreadyDealingWithMenu(self): 786 def alreadyDealingWithMenu(self):
785 return self.lastMenuChoice is not None 787 return self.lastMenuChoice is not None
786 788