comparison orpg/gametree/nodehandlers/forms.py @ 176:537a6bbac9bd alpha

Traipse Alpha 'OpenRPG' {100113-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 (Keeping up with Beta) New Features: Added Bookmarks 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 New TrueDebug Class in orpg_log (See documentation for usage) Portable Mercurial Tip of the Day added, from Core and community New Reference Syntax added for custom PC sheets New Child Reference for gametree New Parent Reference for gametree New Gametree Recursion method, mapping, context sensitivity, and effeciency.. New Features node with bonus nodes and Node Referencing help added Dieroller structure from Core Added 7th Sea die roller method; ie [7k3] = [7d10.takeHighest(3).open(10)] New 'Mythos' System die roller added Added new vs. die roller method for WoD; ie [3v3] = [3d10.vs(3)]. Includes support for Mythos roller New EZ_Tree Reference system. Push a button, Traipse the tree, get a reference (Alpha!!) Fixes: Fix to Text based Server Fix to Remote Admin Commands Fix to Pretty Print, from Core Fix to Splitter Nodes not being created Fix to massive amounts of images loading, from Core Fix to Map from gametree not showing to all clients Fix to gametree about menus Fix to Password Manager check on startup Fix to PC Sheets from tool nodes. They now use the tabber_panel Fixed Whiteboard ID to prevent random line or text deleting. Modified ID's to prevent non updated clients from ruining the fix. default_manifest.xml renamed to default_upmana.xml Fix to Update Manager; cleaner clode for saved repositories Fixes made to Settings Panel and no reactive settings when Ok is pressed Fixes to Alternity roller's attack roll. Uses a simple Tuple instead of a Splice Fix to Use panel of Forms and Tabbers. Now longer enters design mode
author sirebral
date Wed, 13 Jan 2010 02:50:22 -0600
parents fd6415b8243e
children ff19dd30064b
comparison
equal deleted inserted replaced
175:fd6415b8243e 176:537a6bbac9bd
262 self.handler.text_elem.text = txt 262 self.handler.text_elem.text = txt
263 263
264 def on_send(self, evt): 264 def on_send(self, evt):
265 txt = self.text.GetValue() 265 txt = self.text.GetValue()
266 txt = self.chat.ParseMap(txt, self.handler.xml) 266 txt = self.chat.ParseMap(txt, self.handler.xml)
267 txt = self.chat.ParseParent(txt, self.handler.xml.get('map'))
267 if not self.handler.is_raw_send(): 268 if not self.handler.is_raw_send():
268 self.chat.ParsePost(self.handler.tohtml(), True, True) 269 self.chat.ParsePost(self.handler.tohtml(), True, True)
269 return 1 270 return 1
270 actionlist = txt.split("\n") 271 actionlist = txt.split("\n")
271 for line in actionlist: 272 for line in actionlist:
338 self.ez_tree = orpg.gametree.gametree 339 self.ez_tree = orpg.gametree.gametree
339 self.temp_wnd = self.ez_tree.game_tree(self.do_tree, self.ez_tree.EZ_REF) 340 self.temp_wnd = self.ez_tree.game_tree(self.do_tree, self.ez_tree.EZ_REF)
340 self.temp_wnd.Bind(wx.EVT_LEFT_DCLICK, self.on_ldclick) 341 self.temp_wnd.Bind(wx.EVT_LEFT_DCLICK, self.on_ldclick)
341 self.temp_wnd.load_tree(settings.get("gametree")) 342 self.temp_wnd.load_tree(settings.get("gametree"))
342 self.do_tree.Show() 343 self.do_tree.Show()
344
345 def get_grid_ref(self, obj, complete):
346 self.temp_wnd.Freeze()
347 self.grid_ref = complete
348 self.mini_grid = wx.Frame(self, -1, 'Mini Grid')
349 self.temp_grid = obj.get_use_panel(self.mini_grid)
350 self.temp_grid.grid.Bind(wx.grid.EVT_GRID_CELL_LEFT_DCLICK, self.on_grid_ldclick)
351 self.mini_grid.Show()
352
353 def on_grid_ldclick(self, evt):
354 complete = self.grid_ref
355 row = str(evt.GetRow()+1)
356 col = str(evt.GetCol()+1)
357 complete = complete[:len(complete)-2] + '::'+'('+row+','+col+')'+complete[len(complete)-2:]
358 self.text.AppendText(complete); self.on_text(evt)
343 359
344 def on_ldclick(self, evt): 360 def on_ldclick(self, evt):
345 self.rename_flag = 0 361 self.rename_flag = 0
346 pt = evt.GetPosition() 362 pt = evt.GetPosition()
347 (item, flag) = self.temp_wnd.HitTest(pt) 363 (item, flag) = self.temp_wnd.HitTest(pt)
372 del end[0], start[0] 388 del end[0], start[0]
373 if len(start) == 0 or len(end) == 0: break 389 if len(start) == 0 or len(end) == 0: break
374 complete = "!!" 390 complete = "!!"
375 for e in end: complete += e +'::' 391 for e in end: complete += e +'::'
376 complete = complete + obj.xml.get('name') + '!!' 392 complete = complete + obj.xml.get('name') + '!!'
377 if do != 'None': self.text.AppendText(complete); self.on_text(evt) 393 if do != 'None':
394 if obj.xml.get('class') == 'rpg_grid_handler':
395 self.get_grid_ref(obj, complete)
396 else: self.text.AppendText(complete); self.on_text(evt)
378 self.do_tree.Destroy() 397 self.do_tree.Destroy()
379 if do == 'None': 398 if do == 'None':
380 wx.MessageBox('Invalid Reference', 'Error') 399 wx.MessageBox('Invalid Reference', 'Error')
381 ##### ##### 400 ##### #####
382 401
389 self.handler.rename(txt) 408 self.handler.rename(txt)
390 if id == F_TEXT: 409 if id == F_TEXT:
391 txt = self.text.GetValue() 410 txt = self.text.GetValue()
392 #txt = strip_text(txt) ##Does not seem to exist. 411 #txt = strip_text(txt) ##Does not seem to exist.
393 self.handler.text_elem.text = txt 412 self.handler.text_elem.text = txt
413 #component.add('tree', component.get('tree_back')) ## Backup
394 414
395 def on_button(self,evt): 415 def on_button(self,evt):
396 self.handler.text_elem.set("multiline",str(bool2int(evt.Checked()))) 416 self.handler.text_elem.set("multiline",str(bool2int(evt.Checked())))
397 417
398 def on_raw_button(self,evt): 418 def on_raw_button(self,evt):
569 return "\n".join(self.get_selections_text()) 589 return "\n".join(self.get_selections_text())
570 590
571 def on_send_to_chat(self, evt): 591 def on_send_to_chat(self, evt):
572 txt = self.get_selected_text() 592 txt = self.get_selected_text()
573 txt = self.chat.ParseMap(txt, self.xml) 593 txt = self.chat.ParseMap(txt, self.xml)
594 txt = self.chat.ParseParent(txt, self.xml.get('map'))
574 if not self.is_raw_send(): 595 if not self.is_raw_send():
575 self.chat.ParsePost(self.tohtml(), True, True) 596 self.chat.ParsePost(self.tohtml(), True, True)
576 return 1 597 return 1
577 actionlist = self.get_selections_text() 598 actionlist = self.get_selections_text()
578 for line in actionlist: 599 for line in actionlist:
579 line = self.chat.ParseMap(line, self.xml) 600 line = self.chat.ParseMap(line, self.xml)
601 line = self.chat.ParseParent(line, self.xml.get('map'))
580 if(line != ""): 602 if(line != ""):
581 if line[0] != "/": ## it's not a slash command 603 if line[0] != "/": ## it's not a slash command
582 self.chat.ParsePost(line, True, True) 604 self.chat.ParsePost(line, True, True)
583 else: 605 else:
584 action = line 606 action = line
762 self.temp_wnd = self.ez_tree.game_tree(self.do_tree, self.ez_tree.EZ_REF) 784 self.temp_wnd = self.ez_tree.game_tree(self.do_tree, self.ez_tree.EZ_REF)
763 self.temp_wnd.Bind(wx.EVT_LEFT_DCLICK, self.on_ldclick) 785 self.temp_wnd.Bind(wx.EVT_LEFT_DCLICK, self.on_ldclick)
764 self.temp_wnd.load_tree(settings.get("gametree")) 786 self.temp_wnd.load_tree(settings.get("gametree"))
765 self.do_tree.Show() 787 self.do_tree.Show()
766 788
789 def get_grid_ref(self, obj, complete):
790 self.temp_wnd.Freeze()
791 self.grid_ref = complete
792 self.mini_grid = wx.Frame(self, -1, 'Mini Grid')
793 self.temp_grid = obj.get_use_panel(self.mini_grid)
794 self.temp_grid.grid.Bind(wx.grid.EVT_GRID_CELL_LEFT_DCLICK, self.on_grid_ldclick)
795 self.mini_grid.Show()
796
797 def on_grid_ldclick(self, evt):
798 complete = self.grid_ref
799 row = str(evt.GetRow()+1)
800 col = str(evt.GetCol()+1)
801 complete = complete[:len(complete)-2] + '::'+'('+row+','+col+')'+complete[len(complete)-2:]
802 self.value_entry.AppendText(complete)
803
767 def on_ldclick(self, evt): 804 def on_ldclick(self, evt):
768 self.rename_flag = 0 805 self.rename_flag = 0
769 pt = evt.GetPosition() 806 pt = evt.GetPosition()
770 (item, flag) = self.temp_wnd.HitTest(pt) 807 (item, flag) = self.temp_wnd.HitTest(pt)
771 if item.IsOk(): 808 if item.IsOk():
772 obj = self.temp_wnd.GetPyData(item) 809 obj = self.temp_wnd.GetPyData(item)
773 self.temp_wnd.SelectItem(item) 810 self.temp_wnd.SelectItem(item)
774 start = self.handler.xml.get('map').split('::') 811 start = self.handler.xml.get('map').split('::')
775 end = obj.xml.get('map').split('::') 812 end = obj.xml.get('map').split('::')
776 if obj.xml.get('class') != 'rpg_grid_handler' or obj.xml.get('class') != 'textctrl_handler': do = 'None' 813 if obj.xml.get('class') not in ['rpg_grid_handler', 'textctrl_handler']: do = 'None'
777 elif end[0] == '' or start[0] != end[0]: do = 'Root' 814 elif end[0] == '' or start[0] != end[0]: do = 'Root'
778 elif start == end: do = 'Child' 815 elif start == end: do = 'Child'
779 elif start != end: do = 'Parent' 816 elif start != end: do = 'Parent'
780 if do == 'Root': 817 if do == 'Root':
781 complete = "!@" 818 complete = "!@"
795 del end[0], start[0] 832 del end[0], start[0]
796 if len(start) == 0 or len(end) == 0: break 833 if len(start) == 0 or len(end) == 0: break
797 complete = "!!" 834 complete = "!!"
798 for e in end: complete += e +'::' 835 for e in end: complete += e +'::'
799 complete = complete + obj.xml.get('name') + '!!' 836 complete = complete + obj.xml.get('name') + '!!'
800 if do != 'None': self.value_entry.AppendText(complete); self.reload_options() 837 if do != 'None':
838 if obj.xml.get('class') == 'rpg_grid_handler':
839 self.get_grid_ref(obj, complete)
840 else: self.value_entry.AppendText(complete); self.reload_options()
801 self.do_tree.Destroy() 841 self.do_tree.Destroy()
802 if do == 'None': 842 if do == 'None':
803 wx.MessageBox('Invalid Reference', 'Error') 843 wx.MessageBox('Invalid Reference', 'Error')
804 ##### ##### 844 ##### #####
805 845