diff orpg/tools/orpg_settings.py @ 65:4840657c23c5 ornery-dev

Traipse Dev 'OpenRPG' {090817-02} 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: Update to Settings Menu. When user changes font or font size the chat window will now update without needing a restart. Change to dirpath/dir_struct file. No longer creates OPENRPG_BASE environment key.
author sirebral
date Mon, 17 Aug 2009 06:56:31 -0500
parents 65c5cb9be59c
children c54768cffbd4
line wrap: on
line diff
--- a/orpg/tools/orpg_settings.py	Mon Aug 17 04:49:17 2009 -0500
+++ b/orpg/tools/orpg_settings.py	Mon Aug 17 06:56:31 2009 -0500
@@ -78,7 +78,8 @@
     def add_setting(self, tab, setting, value, options, help):
         if len(self.xml_dom.getElementsByTagName(setting)) > 0: return False
         tabs = self.xml_dom.getElementsByTagName("tab")
-        newsetting = self.xml.parseXml('<' + setting + ' value="' + value + '" options="' + options + '" help="' + help + '" />')._get_documentElement()
+        newsetting = self.xml.parseXml('<' + setting + ' value="' + value + '" options="' + 
+                                        options + '" help="' + help + '" />')._get_documentElement()
         for i in xrange(0, len(tabs)):
             if tabs[i].getAttribute("name") == tab and tabs[i].getAttribute("type") == 'grid':
                 tabs[i].appendChild(newsetting)
@@ -125,7 +126,9 @@
             if child._get_tagName() == 'tab' and child.hasChildNodes():
                 self.proccessChildren(child, dom.getAttribute("name"))
             else:
-                self.add_setting(dom.getAttribute("name"), child._get_tagName(), child.getAttribute("value"), child.getAttribute("options"), child.getAttribute("help"))
+                self.add_setting(dom.getAttribute("name"), child._get_tagName(), 
+                                child.getAttribute("value"), child.getAttribute("options"), 
+                                child.getAttribute("help"))
 
     def save(self):
         temp_file = open(self.filename, "w")
@@ -134,7 +137,9 @@
 
 class orpgSettingsWnd(wx.Dialog):
     def __init__(self, parent):
-        wx.Dialog.__init__(self,parent,-1,"OpenRPG Preferences",wx.DefaultPosition,size = wx.Size(-1,-1), style=wx.RESIZE_BORDER | wx.SYSTEM_MENU | wx.CAPTION)
+        wx.Dialog.__init__(self,parent,-1,"OpenRPG Preferences", 
+                            wx.DefaultPosition,size = wx.Size(-1,-1), 
+                            style=wx.RESIZE_BORDER | wx.SYSTEM_MENU | wx.CAPTION)
         self.Freeze()
         self.validate = open_rpg.get_component("validate")
         self.settings = open_rpg.get_component("settings")
@@ -226,6 +231,14 @@
             self.settings.set_setting(self.changes[i][0], self.changes[i][1])
             top_frame = open_rpg.get_component('frame')
 
+            if self.changes[i][0] == 'defaultfontsize' or self.changes[i][0] == 'defaultfont':
+                self.chat.chatwnd.SetDefaultFontAndSize(self.settings.get_setting('defaultfont'), 
+                                                        self.settings.get_setting('defaultfontsize'))
+                self.chat.InfoPost("Font is now " + 
+                                    self.settings.get_setting('defaultfont') + " point size " + 
+                                    self.settings.get_setting('defaultfontsize'))
+                self.chat.chatwnd.scroll_down()
+
             if self.changes[i][0] == 'bgcolor' or self.changes[i][0] == 'textcolor':
                 self.chat.chatwnd.SetPage(self.chat.ResetPage())
                 self.chat.chatwnd.scroll_down()