changeset 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 5a3f8d9181eb
children c54768cffbd4
files orpg/dirpath/dirpath_tools.py orpg/orpg_version.py orpg/tools/orpg_settings.py
diffstat 3 files changed, 25 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/orpg/dirpath/dirpath_tools.py	Mon Aug 17 04:49:17 2009 -0500
+++ b/orpg/dirpath/dirpath_tools.py	Mon Aug 17 06:56:31 2009 -0500
@@ -8,7 +8,6 @@
         def OnInit(self):
             return True
 
-
 #-------------------------------------------------------
 # void load_paths( dir_struct_reference )
 # moved structure loading from dirpath.py by Snowdog 3-8-05
@@ -27,10 +26,8 @@
     dir_struct["nodes"] = dir_struct["template"] + "nodes" + os.sep
     dir_struct["rollers"] = dir_struct["core"] + "dieroller" + os.sep + "rollers" + os.sep
 
-
-    _userbase_dir = _userbase_dir = os.environ['OPENRPG_BASE']
-    _user_dir = _userbase_dir + os.sep + "myfiles" + os.sep
-
+    _userbase_dir = dir_struct["home"]
+    _user_dir = dir_struct["home"] + "myfiles" + os.sep
 
     try:
         os.makedirs(_user_dir)
@@ -38,15 +35,11 @@
         os.makedirs(_user_dir + "logs" + os.sep);
         os.makedirs(_user_dir + "webfiles" + os.sep);
     except OSError, e:
-        if e.errno != errno.EEXIST:
-            raise
+        if e.errno != errno.EEXIST: raise
 
     dir_struct["user"] = _user_dir
-
     dir_struct["logs"] = dir_struct["user"] + "logs" + os.sep
 
-
-
 #-------------------------------------------------------
 # int verify_home_path( directory_name )
 # added by Snowdog 3-8-05
@@ -55,21 +48,18 @@
 def verify_home_path( path ):
     """checks for key ORPG files in the openrpg tree
        and askes for user intervention if their is a problem"""
-
     try:
         #verify that the root dir (as supplied) exists
         if not verify_file(path): return 0
-
+
         #These checks require that 'path' have a separator at the end.
         #Check and temporarily add one if needed
         if (path[(len(path)-len(os.sep)):] != os.sep):
             path = path + os.sep
-
         # These files should always exist at the root orpg dir
         check_files = ["orpg","data","images"]
         for n in range(len(check_files)):
             if not verify_file(path + check_files[n]): return 0
-
     except:
         # an error occured while verifying the directory structure
         # bail out with error signal
@@ -78,8 +68,6 @@
     #all files and directories exist.
     return 1
 
-
-
 #-------------------------------------------------------
 # int verify_file( absolute_path )
 # added by Snowdog 3-8-05
@@ -98,7 +86,8 @@
 # pathname get_user_help()
 # added by Snowdog 3-8-05
 # bug fix (SF #1242456) and updated with bailout code. Snowdog 7-25-05
-#-------------------------------------------------------
+#-------------------------------------------------------
+## This can be removed in the future. TaS '09
 def get_user_located_root():
     """Notify the user of directory problems
     and show directory selection dialog """
@@ -106,16 +95,15 @@
     if WXLOADED:
         app = tmpApp(0)
         app.MainLoop()
-
+
         dir = None
-
         try:
             msg = "OpenRPG cannot locate critical files.\nPlease locate the /System/ directory in the following window"
             alert= wx.MessageDialog(None,msg,"Warning",wx.OK|wx.ICON_ERROR)
             alert.Show()
             if alert.ShowModal() == wx.OK:
                 alert.Destroy()
-            dlg = wx.DirDialog(None, "Locate the openrpg1 directory:",style=wx.DD_DEFAULT_STYLE)
+            dlg = wx.DirDialog(None, "Locate the System directory:",style=wx.DD_DEFAULT_STYLE)
             if dlg.ShowModal() == wx.ID_OK:
                 dir = dlg.GetPath()
             dlg.Destroy()
--- a/orpg/orpg_version.py	Mon Aug 17 04:49:17 2009 -0500
+++ b/orpg/orpg_version.py	Mon Aug 17 06:56:31 2009 -0500
@@ -4,7 +4,7 @@
 #BUILD NUMBER FORMAT: "YYMMDD-##" where ## is the incremental daily build index (if needed)
 DISTRO = "Traipse Dev"
 DIS_VER = "Ornery Orc"
-BUILD = "090817-00"
+BUILD = "090817-02"
 
 # This version is for network capability.
 PROTOCOL_VERSION = "1.2"
--- 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()