diff orpg/main.py @ 27:51428d30c59e ornery-orc

Traipse 'OpenRPG' {091003-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 menu changes to draw attention to important updates, errors, or other events. Traipse URL is now included in the repos tab and is set as default. Fixes Copy for Windows and Linux (finally!!) users. Fixes incomplete update to Grid and List nodes. Fixes incomplete update to Chat Commands. Fixes problems with Remote Image Upload. Fixes Drop and Drag of Minis to Map. CherryPy can now use any image in the webfiles/ folder and sub-folders. CherryPy can now Drop and Drag Minis to the Map. Minor changes to Update Manager's GUI. Expert recommendation warning added to Revision Update. Step down compatibility with open_rpg & component added to orpgCore. Fixes CherryPit misspelling. Makes Traipse Suite 'Attention' item portable, and executes it on 'Critical' debug notices. Adds incomplete Shift + Enter to Text Entry, currently creates a 'Critical' warning. New default Lobby Map, designed for Traipse. Feel free to change it. Updates to Server GUI: * Admin can Ban from Backend. * Admin can Modify Ban List and Un Ban users. * Server GUI finds your Lobby Name * New users default as Lurker unless a Role is set Cleaner TraipseSuiteAttention portability and clean up in Main. Die Roll Commands addition from Core code allowing Math Ordering with ()'s New About Dialog. A more uniform About Dialog. Corrects image loading of duplicate images.
author sirebral
date Sat, 03 Oct 2009 18:49:37 -0500
parents 97265586402b
children ff154cf3350c
line wrap: on
line diff
--- a/orpg/main.py	Thu Aug 27 01:28:11 2009 -0500
+++ b/orpg/main.py	Sat Oct 03 18:49:37 2009 -0500
@@ -268,9 +268,30 @@
         self.Bind(wx.EVT_MENU, self.OnMB_UpdateManagerPanel, mana)
         self.traipseSuite.AppendItem(mana)
 
-        debugger = wx.MenuItem(self.traipseSuite, -1, "Debug Console", "Debug Console")
-        self.Bind(wx.EVT_MENU, self.OnMB_DebugConsole, debugger)
-        self.traipseSuite.AppendItem(debugger)
+        self.debugConsole = wx.MenuItem(self.traipseSuite, -1, "Debug Console", "Debug Console")
+        self.Bind(wx.EVT_MENU, self.OnMB_DebugConsole, self.debugConsole)
+        self.traipseSuite.AppendItem(self.debugConsole)
+
+    def TraipseSuiteWarn(self, menuitem):
+        ### Beta ### Allows for the reuse of the 'Attention' menu.
+        ### component.get('frame').TraipseSuiteWarn('item') ### Portable
+        self.mainmenu.Replace(8, self.traipseSuite, '&Traipse Suite!')
+        if menuitem == 'debug':
+            if self.debugger.IsShown() == True:
+                self.mainmenu.Replace(8, self.traipseSuite, '&Traipse Suite')
+            else:
+                self.debugConsole.SetBitmap(wx.Bitmap(dir_struct["icon"] + 'spotlight.png'))
+                self.traipseSuite.RemoveItem(self.debugConsole)
+                self.traipseSuite.AppendItem(self.debugConsole)
+
+    def TraipseSuiteWarnCleanup(self, menuitem):
+        ### Beta ### Allows for portable cleanup of the 'Attention' menu.
+        ### component.get('frame').TraipseSuiteWarnCleanup('item') ### Portable
+        self.mainmenu.Replace(8, self.traipseSuite, '&Traipse Suite')
+        if menuitem == 'debug':
+            self.traipseSuite.RemoveItem(self.debugConsole)
+            self.debugConsole.SetBitmap(wx.Bitmap(dir_struct["icon"] + 'clear.gif'))
+            self.traipseSuite.AppendItem(self.debugConsole)
        
 
     #################################
@@ -474,6 +495,7 @@
 
     @debugging
     def OnMB_DebugConsole(self, evt):
+        self.TraipseSuiteWarnCleanup('debug') ### Beta ###
         if self.debugger.IsShown() == True: self.debugger.Hide()
         else: self.debugger.Show()
 
@@ -557,47 +579,18 @@
     #Help Menu #Needs a custom Dialog because it is ugly on Windows
     @debugging
     def OnMB_HelpAbout(self):
-
-        description = "OpenRPG is a Virtual Game Table that allows users to connect via a network and play table\n"
-        description += "top games with friends.  'Traipse' is an OpenRPG distro that is easy to setup and provides superb \n"
-        description += "functionality.  OpenRPG is originally designed by Chris Davis. \n"
-
-        license = "OpenRPG is free software; you can redistribute it and/or modify it "
-        license += "under the terms of the GNU General Public License as published by the Free Software Foundation; \n"
-        license += "either version 2 of the License, or (at your option) any later version.\n\n"
-        license += "OpenRPG and Traipse 'OpenRPG' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; \n"
-        license += "without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  \n"
-        license += "See the GNU General Public License for more details. You should have received a copy of \n"
-        license += "the GNU General Public License along with Traipse 'OpenRPG'; if not, write to \n"
-        license += "the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n\n"
-        license += "'Traipse' and the 'Traipse' Logo are trademarks of Mad Mathematics Laboratories."
-
-        info = wx.AboutDialogInfo()
-        info.SetIcon(wx.Icon(dir_struct["icon"]+'splash.gif', wx.BITMAP_TYPE_GIF))
-        info.SetName('Traipse')
-        info.SetVersion('OpenRPG ' + VERSION)
-        info.SetDescription(description)
-        info.SetCopyright('(C) Copyright 2009 Mad Math Labs')
-        info.SetWebSite('http://www.openrpg.com')
-        info.SetLicence(license)
-        orpg_devs = ['Thomas Baleno', 'Andrew Bennett', 'Lex Berezhny', 'Ted Berg',
-		'Bernhard Bergbauer', 'Chris Blocher', 'David Byron', 'Ben Collins-Sussman', 'Robin Cook', 'Greg Copeland',
-		'Chris Davis', 'Michael Edwards', 'Andrew Ettinger', 'Todd Faris', 'Dj Gilcrease',
-        'Christopher Hickman', 'Paul Hosking', 'Brian Manning', 'Scott Mackay', 'Jesse McConnell', 
-		'Brian Osman', 'Rome Reginelli', 'Christopher Rouse', 'Dave Sanders', 'Tyler Starke', 'Mark Tarrabain']
-        for dev in orpg_devs:
-            info.AddDeveloper(dev)
-        wx.AboutBox(info)
+        if self.AboutORPG.IsShown() == True: self.AboutORPG.Hide()
+        else: self.AboutORPG.Show()
 
     @debugging
     def OnMB_HelpOnlineUserGuide(self):
         wb = webbrowser.get()
-        wb.open("https://www.assembla.com/wiki/show/traipse/User_Manual")
+        wb.open("http://www.assembla.com/wiki/show/traipse/User_Manual")
 
     @debugging
     def OnMB_HelpChangeLog(self):
         wb = webbrowser.get()
-        wb.open("http://www.assembla.com/spaces/milestones/index/traipse_dev?spaces_tool_id=Milestones")
+        wb.open("http://www.assembla.com/spaces/milestones/index/traipse?spaces_tool_id=Milestones")
 
     @debugging
     def OnMB_HelpReportaBug(self):
@@ -629,6 +622,9 @@
         self.windowsmenu = wx.Menu()
         self.mainwindows = {}
 
+        # About Window
+        self.AboutORPG = AboutORPG(self)
+
         #Plugins Window
         self.pluginsFrame = pluginUI.PluginFrame(self)
         component.add("plugins", self.get_activeplugins())
@@ -642,7 +638,7 @@
         self.SetDimensions(posx, posy, w, h)
         logger.debug("Dimensions Set")
 
-        #Update Manager
+        # Update Manager
         self.manifest = manifest.ManifestChanges()
         self.updateMana = upmana.updatemana.updaterFrame(self, 
             "OpenRPG Update Manager Beta 0.8", component, self.manifest, True)
@@ -655,8 +651,7 @@
         self.SetDimensions(posx, posy, w, h)
         logger.debug("Dimensions Set")
 
-        #Update Manager
-        self.manifest = manifest.ManifestChanges()
+        # Debug Console
         self.debugger = orpg.tools.orpg_log.DebugConsole(self)
         logger.debug("Menu Created")
         h = int(xml_dom.getAttribute("height"))
@@ -732,6 +727,7 @@
         wndinfo.Name("Browse Server Window")
         wndinfo.Caption("Game Server")
         wndinfo.Float()
+        wndinfo.FloatingPosition((50,50))
         wndinfo.Dockable(False)
         wndinfo.MinSize(wx.Size(640,480))
         wndinfo.Hide()
@@ -1149,6 +1145,58 @@
         except Exception:
             pass
 
+########################################
+## About Dialog class
+########################################
+class AboutORPG(wx.Frame):
+    def __init__(self, parent):
+        super(AboutORPG, self).__init__(parent, -1, "About 'Traipse' OpenRPG")
+        icon = None
+        icon = wx.Icon(dir_struct["icon"]+'d20.ico', wx.BITMAP_TYPE_ICO)
+        self.SetIcon( icon )
+        sizer = wx.GridBagSizer(hgap=1, vgap=1)
+        height = 425; width = 350
+        self.About = wx.TextCtrl(self, -1, size=wx.DefaultSize, style=wx.TE_MULTILINE | wx.TE_READONLY)
+        img = wx.Image(dir_struct['icon']+'splash.gif', wx.BITMAP_TYPE_ANY).ConvertToBitmap()
+        image = wx.StaticBitmap(self, -1, img, size=wx.DefaultSize)
+        sizer.Add(image, (0,0), flag=wx.ALIGN_CENTER_HORIZONTAL|wx.ALL|wx.ADJUST_MINSIZE)
+        sizer.Add(self.About, (1,0), flag=wx.EXPAND)
+        self.SetSizer(sizer)
+        self.SetAutoLayout(True)
+        self.SetSize((width, height))
+        sizer.AddGrowableCol(0)
+        sizer.AddGrowableCol(1)
+        sizer.AddGrowableRow(1)
+        self.Bind(wx.EVT_CLOSE, self.Min) 
+        self.Min(None)
+
+        description = "OpenRPG is a Virtual Game Table that allows users to connect via a network and play table "
+        description += "top games with friends.  'Traipse' is an OpenRPG distro that is easy to setup and provides superb "
+        description += "functionality.  OpenRPG is originally designed by Chris Davis."
+
+        license = "OpenRPG is free software; you can redistribute it and/or modify it "
+        license += "under the terms of the GNU General Public License as published by the Free Software Foundation; "
+        license += "either version 2 of the License, or (at your option) any later version.\n\n"
+        license += "OpenRPG and Traipse 'OpenRPG' is distributed in the hope that it will be useful, but WITHOUT ANY "
+        license += "WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. "
+        license += "See the GNU General Public License for more details. You should have received a copy of "
+        license += "the GNU General Public License along with Traipse 'OpenRPG'; if not, write to "
+        license += "the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA \n\n"
+        license += "'Traipse' and the 'Traipse' Logo are trademarks of Mad Mathematics Laboratories."
+
+        self.About.AppendText(description+'\n\n')
+        self.About.AppendText(license+'\n\n')
+        self.About.AppendText('OpenRPG Developers:\n')
+        orpg_devs = ['Thomas Baleno', 'Andrew Bennett', 'Lex Berezhny', 'Ted Berg',
+		'Bernhard Bergbauer', 'Chris Blocher', 'David Byron', 'Ben Collins-Sussman', 'Robin Cook', 'Greg Copeland',
+		'Chris Davis', 'Michael Edwards', 'Andrew Ettinger', 'Todd Faris', 'Dj Gilcrease',
+        'Christopher Hickman', 'Paul Hosking', 'Brian Manning', 'Scott Mackay', 'Jesse McConnell', 
+		'Brian Osman', 'Rome Reginelli', 'Christopher Rouse', 'Dave Sanders', 'Tyler Starke', 'Mark Tarrabain']
+        for dev in orpg_devs:
+            self.About.AppendText(dev+'\n')
+
+    def Min(self, evt):
+        self.Hide()
 
 ########################################
 ## Application class