diff orpg/gametree/nodehandlers/forms.py @ 132:fe4dc5817d5e alpha

Traipse Alpha 'OpenRPG' {091005-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 (Cleaning up for 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 Gamtree Recusion method, mapping, and context sensitivity. !!Alpha - Watch out for infinite loops!! Dead Node Children, now that's a O O -v-v- Happy Halloween!
author sirebral
date Thu, 05 Nov 2009 12:15:19 -0600
parents 90d19eb43830
children 2ffc5de126c8
line wrap: on
line diff
--- a/orpg/gametree/nodehandlers/forms.py	Tue Nov 03 21:30:36 2009 -0600
+++ b/orpg/gametree/nodehandlers/forms.py	Thu Nov 05 12:15:19 2009 -0600
@@ -183,12 +183,9 @@
     def __init__(self,xml,tree_node):
         node_handler.__init__(self,xml,tree_node)
         self.text_elem = self.xml.find('text')
-        if self.text_elem.get("send_button") == "":
-            self.text_elem.set("send_button","0")
-        if self.text_elem.get("raw_mode") == "":
-            self.text_elem.set("raw_mode","0")
-        if self.text_elem.get("hide_title") == "":
-            self.text_elem.set("hide_title","0")
+        if self.text_elem.get("send_button") == "": self.text_elem.set("send_button","0")
+        if self.text_elem.get("raw_mode") == "": self.text_elem.set("raw_mode","0")
+        if self.text_elem.get("hide_title") == "": self.text_elem.set("hide_title","0")
 
     def get_design_panel(self,parent):
         return textctrl_edit_panel(parent,self)
@@ -257,24 +254,25 @@
 
         parent.SetSize(self.GetBestSize())
         self.Bind(wx.EVT_TEXT, self.on_text, id=FORM_TEXT_CTRL)
-        self.Bind(wx.EVT_BUTTON, self.on_send, id=FORM_SEND_BUTTON)
-
-    def on_text(self,evt):
+        self.Bind(wx.EVT_BUTTON, self.on_send, id=FORM_SEND_BUTTON)
+
+    def on_text(self, evt):
+        debug()
         txt = self.text.GetValue()
         #txt = strip_text(txt) ##Does not seem to exist.
         self.handler.text_elem.text = txt
 
-    def on_send(self,evt):
-        txt = self.text.GetValue()
+    def on_send(self, evt):
+        txt = self.text.GetValue()
+        txt = self.chat.ParseMap(txt, self.handler.xml)
         if not self.handler.is_raw_send():
-            #self.chat.ParsePost(self.tohtml(),True,True)
-            self.chat.ParsePost(self.handler.tohtml(),True,True)
+            self.chat.ParsePost(self.handler.tohtml(), True, True)
             return 1
         actionlist = txt.split("\n")
         for line in actionlist:
             if(line != ""):
                 if line[0] != "/": ## it's not a slash command
-                    self.chat.ParsePost(line,True,True)
+                    self.chat.ParsePost(line, True, True)
                 else:
                     action = line
                     self.chat.chat_cmds.docmd(action)
@@ -426,7 +424,6 @@
 
 
     # mult selection methods
-
     def get_selections(self):
         opts = []
         for opt in self.options:
@@ -451,7 +448,6 @@
         return opts
 
     # setting selection method
-
     def set_selected_node(self,index,selected=1):
         if self.get_type() != L_CHECK:
             self.clear_selections()
@@ -462,11 +458,9 @@
             opt.set("selected","0")
 
     # misc methods
-
     def get_options(self):
         opts = []
-        for opt in self.options:
-            opts.append(opt.text)
+        for opt in self.options: opts.append(opt.text)
         return opts
 
     def get_option(self,index):
@@ -488,22 +482,17 @@
         self.options[index].text = value
 
     def has_send_button(self):
-        if self.list.get("send_button") == '0':
-            return False
-        else:
-            return True
+        if self.list.get("send_button") == '0': return False
+        else: return True
 
     def get_size_constraint(self):
-        if self.get_type() == L_DROP:
-            return 0
-        else:
-            return 1
+        if self.get_type() == L_DROP: return 0
+        else: return 1
 
     def tohtml(self):
         opts = self.get_selections_text()
         text = ""
-        if not self.is_hide_title():
-            text = "<b>"+self.xml.get("name")+":</b> "
+        if not self.is_hide_title(): text = "<b>"+self.xml.get("name")+":</b> "
         comma = ", "
         text += comma.join(opts)
         return text