Mercurial > traipse_dev
annotate orpg/main.py @ 228:24769389a7ba alpha
Traipse Alpha 'OpenRPG' {100612-01}
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 (Preparing to close updates)
New Features:
New to Map, can re-order Grid, Miniatures, and Whiteboard layer draw order
Fixes:
Fix to InterParse that was causing an Infernal Loop with Namespace Internal
Fix to XML data, removed old Minidom and switched to Element Tree
Fix to Server that was causing eternal attempt to find a Server ID, in Register Rooms thread
Fix to metaservers.xml file not being created
author | sirebral |
---|---|
date | Sat, 12 Jun 2010 04:38:29 -0500 |
parents | 29cf1a17ca16 |
children | cc7629ab526d |
rev | line source |
---|---|
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1 #!/usr/bin/env python |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
2 # Copyright (C) 2000-2001 The OpenRPG Project |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
3 # |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
4 # openrpg-dev@lists.sourceforge.net |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
5 # |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
6 # This program is free software; you can redistribute it and/or modify |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
7 # it under the terms of the GNU General Public License as published by |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
8 # the Free Software Foundation; either version 2 of the License, or |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
9 # (at your option) any later version. |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
10 # |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
11 # This program is distributed in the hope that it will be useful, |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
14 # GNU General Public License for more details. |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
15 # |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
16 # You should have received a copy of the GNU General Public License |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
17 # along with this program; if not, write to the Free Software |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
18 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
19 # -- |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
20 # |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
21 # File: main.py |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
22 # Author: Chris Davis |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
23 # Maintainer: |
195 | 24 # Version: Traipse 'Ornery-Orc' |
25 # $Id: main.py,v Traipse 'Ornery-Orc' prof.ebral Exp $ | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
26 # |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
27 # Description: This is the main entry point of the oprg application |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
28 # |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
29 |
195 | 30 __version__ = "$Id: main.py,v Traipse 'Ornery-Orc' prof.ebral Exp $" |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
31 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
32 from orpg.orpg_wx import * |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
33 from orpg.orpgCore import * |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
34 from orpg_version import * |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
35 from orpg.orpg_windows import * |
66 | 36 |
74 | 37 import wx.py |
133 | 38 |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
39 import orpg.player_list |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
40 import orpg.tools.pluginui as pluginUI |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
41 import orpg.tools.aliaslib |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
42 import orpg.tools.toolBars |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
43 import orpg.tools.orpg_sound |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
44 import orpg.tools.rgbhex |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
45 import orpg.gametree.gametree |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
46 import orpg.chat.chatwnd |
71
449a8900f9ac
Code refining almost completed, for this round. Some included files are still in need of some clean up, but this is test worthy.
sirebral
parents:
68
diff
changeset
|
47 import orpg.networking.gsclient |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
48 import orpg.networking.mplay_client |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
49 import orpg.mapper.map |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
50 import orpg.mapper.images |
66 | 51 |
167 | 52 import orpg.dieroller.utils |
117 | 53 import upmana.updatemana |
195 | 54 from upmana.manifest import manifest |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
55 |
74 | 56 from orpg.dirpath import dir_struct |
133 | 57 from orpg.tools.settings import settings |
66 | 58 from orpg.tools.validate import validate |
59 from orpg.tools.passtool import PassTool | |
124 | 60 from orpg.tools.orpg_log import logger, crash, debug |
66 | 61 from orpg.tools.metamenus import MenuBarEx |
195 | 62 from orpg.tools.InterParse import Parse |
66 | 63 |
124 | 64 from xml.etree.ElementTree import ElementTree, Element, parse |
118 | 65 from xml.etree.ElementTree import fromstring, tostring |
228 | 66 #from orpg.orpg_xml import xml #to be replaced by etree |
66 | 67 |
68 | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
69 #################################### |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
70 ## Main Frame |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
71 #################################### |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
72 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
73 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
74 class orpgFrame(wx.Frame): |
195 | 75 |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
76 def __init__(self, parent, id, title): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
77 wx.Frame.__init__(self, parent, id, title, wx.Point(100, 100), wx.Size(600,420), style=wx.DEFAULT_FRAME_STYLE) |
66 | 78 self.validate = component.get("validate") |
74 | 79 logger.debug("Enter orpgFrame") |
80 self.rgb = orpg.tools.rgbhex.RGBHex() | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
81 self._mgr = AUI.AuiManager(self) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
82 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
83 # Determine which icon format to use |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
84 icon = None |
66 | 85 if wx.Platform == '__WXMSW__': icon = wx.Icon(dir_struct["icon"]+'d20.ico', wx.BITMAP_TYPE_ICO) |
86 else: icon = wx.Icon(dir_struct["icon"]+"d20.xpm", wx.BITMAP_TYPE_XPM) | |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
87 self.SetIcon( icon ) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
88 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
89 # create session |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
90 call_backs = {"on_receive":self.on_receive, |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
91 "on_mplay_event":self.on_mplay_event, |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
92 "on_group_event":self.on_group_event, |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
93 "on_player_event":self.on_player_event, |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
94 "on_status_event":self.on_status_event, |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
95 "on_password_signal":self.on_password_signal, |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
96 "orpgFrame":self} |
141 | 97 self.session = orpg.networking.mplay_client.mplay_client(settings.get("player"), call_backs) |
161 | 98 component.add("session", self.session) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
99 self.poll_timer = wx.Timer(self, wx.NewId()) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
100 self.Bind(wx.EVT_TIMER, self.session.poll, self.poll_timer) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
101 self.poll_timer.Start(100) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
102 self.ping_timer = wx.Timer(self, wx.NewId()) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
103 self.Bind(wx.EVT_TIMER, self.session.update, self.ping_timer) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
104 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
105 # create roller manager |
167 | 106 self.DiceManager = orpg.dieroller.utils.roller_manager() |
107 self.DiceManager.setRoller(settings.get("dieroller")) | |
66 | 108 component.add('DiceManager', self.DiceManager) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
109 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
110 #create password manager --SD 8/03 |
66 | 111 self.password_manager = component.get('password_manager') |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
112 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
113 # build frame windows |
161 | 114 component.add('frame', self) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
115 self.build_menu() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
116 self.build_gui() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
117 self.build_hotkeys() |
66 | 118 logger.debug("GUI Built") |
74 | 119 logger.debug("openrpg components all added") |
119 | 120 self.tree.load_tree(settings.get("gametree")) |
66 | 121 logger.debug("Tree Loaded") |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
122 self.players.size_cols() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
123 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
124 #Load the Plugins This has to be after the chat component has been added |
66 | 125 component.add('pluginmenu', self.pluginMenu) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
126 self.pluginsFrame.Start() |
66 | 127 logger.debug("plugins reloaded and startup plugins launched") |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
128 self.Bind(wx.EVT_CLOSE, self.OnCloseWindow) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
129 |
138 | 130 tipotday_start = settings.get('tipotday_start') |
131 try: tipotday_start = int(tipotday_start) | |
132 except TypeError: tipotday_start = 0 | |
133 | |
134 self.TipOfTheDay = wx.CreateFileTipProvider(dir_struct['data']+'tips.txt', tipotday_start) | |
116 | 135 #Load Update Manager |
136 component.add('updatemana', self.updateMana) | |
137 logger.debug("update manager reloaded") | |
138 self.Bind(wx.EVT_CLOSE, self.OnCloseWindow) | |
49
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
26
diff
changeset
|
139 |
115 | 140 #Load Debug Console |
79
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
74
diff
changeset
|
141 component.add('debugconsole', self.debugger) |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
74
diff
changeset
|
142 logger.debug("debugger window") |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
74
diff
changeset
|
143 self.Bind(wx.EVT_CLOSE, self.OnCloseWindow) |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
74
diff
changeset
|
144 |
138 | 145 def ShowTipOfTheDay(self): |
146 if wx.ShowTip(self, self.TipOfTheDay, settings.get('tipotday_enabled') != '0'): | |
147 settings.change('tipotday_enabled', '1') | |
148 else: settings.change('tipotday_enabled', '0') | |
149 settings.change('tipotday_start', str(self.TipOfTheDay.CurrentTip)) | |
124 | 150 |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
151 def post_show_init(self): |
138 | 152 """Some Actions need to be done after the main frame is drawn""" |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
153 self.players.size_cols() |
138 | 154 try: |
155 if settings.get('tipotday_enabled').lower() != '0': self.ShowTipOfTheDay() | |
156 except: self.add_setting('Tip of the Day') | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
157 |
138 | 158 def add_setting(self, setting): |
159 if setting == 'Tip of the Day': | |
160 settings.add_tab('General', 'Tip of the Day', 'grid') | |
161 settings.add('Tip of the Day', 'tipotday_start', '0', 'int', 'Current Tip of the Day') | |
162 settings.add('Tip of the Day', 'tipotday_enabled', '1', '0|1', 'Show Tip of the Day on startup') | |
163 logger.info('New Settings added', True) | |
164 self.TraipseSuiteWarn('debug') | |
228 | 165 if setting == 'Meta Servers': |
166 settings.add('Networking', 'MetaServers', 'metaservers.xml', '.xml file', 'Contains a list of Meta Servers') | |
167 logger.info('New Settings added', True) | |
168 self.validate.config_file("metaservers.xml","default_metaservers.xml") | |
169 self.TraipseSuiteWarn('debug') | |
138 | 170 |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
171 def get_activeplugins(self): |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
172 try: tmp = self.pluginsFrame.get_activeplugins() |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
173 except: tmp = {} |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
174 return tmp |
124 | 175 |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
176 def get_startplugins(self): |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
177 try: tmp = self.pluginsFrame.get_startplugins() |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
178 except: tmp = {} |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
179 return tmp |
124 | 180 |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
181 def on_password_signal(self,signal,type,id,data): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
182 try: |
66 | 183 msg = ["DEBUG: password response= ", |
184 str(signal), | |
185 " (T:", | |
186 str(type), | |
187 " #", | |
188 str(id), | |
189 ")"] | |
190 logger.debug("".join(msg)) | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
191 id = int(id) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
192 type = str(type) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
193 data = str(data) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
194 signal = str(signal) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
195 if signal == "fail": |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
196 if type == "server": self.password_manager.ClearPassword("server", 0) |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
197 elif type == "admin": self.password_manager.ClearPassword("admin", int(id)) |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
198 elif type == "room": self.password_manager.ClearPassword("room", int(id)) |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
199 else: pass |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
200 except: traceback.print_exc() |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
201 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
202 def build_menu(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
203 menu = \ |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
204 [[ |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
205 ['&OpenRPG'], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
206 [' &Settings\tCtrl-S'], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
207 [' -'], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
208 [' Tab Styles'], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
209 [' Slanted'], |
228 | 210 #[' Colorful', "check"], |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
211 [' Black and White', "check"], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
212 [' Aqua', "check"], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
213 [' Custom', "check"], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
214 [' Flat'], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
215 [' Black and White', "check"], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
216 [' Aqua', "check"], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
217 [' Custom', "check"], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
218 [' NewMap'], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
219 [' -'], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
220 [' &Exit'] |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
221 ], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
222 [ |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
223 ['&Game Server'], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
224 [' &Browse Servers\tCtrl-B'], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
225 [' -'], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
226 [' Server Heartbeat', "check"], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
227 [' -'], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
228 [' &Start Server'] |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
229 ], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
230 [ |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
231 ['&Tools'], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
232 [' Logging Level'], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
233 [' Debug', "check"], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
234 [' Note', "check"], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
235 [' Info', "check"], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
236 [' General', "check"], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
237 [' -'], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
238 [' Password Manager', "check"], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
239 [' -'], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
240 [' Sound Toolbar', "check"], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
241 [' Dice Bar\tCtrl-D', "check"], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
242 [' Map Bar', "check"], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
243 [' Status Bar\tCtrl-T', "check"], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
244 ], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
245 [ |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
246 ['&Help'], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
247 [' &About'], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
248 [' Online User Guide'], |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
249 [' Change Log'], |
138 | 250 [' Report a Bug'], |
251 [' Tip of the Day'] | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
252 ]] |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
253 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
254 self.mainmenu = MenuBarEx(self, menu) |
119 | 255 if settings.get('Heartbeat') == '1': |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
256 self.mainmenu.SetMenuState("GameServerServerHeartbeat", True) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
257 |
133 | 258 self.mainmenu.SetMenuState('ToolsPasswordManager', True if settings.get('PWMannager') == 'On' else False) |
119 | 259 tabtheme = settings.get('TabTheme') #This change is stable. TaS. |
228 | 260 if tabtheme == 'slanted&colorful': tabtheme = 'customflat'; settings.change('TabTheme', 'customflat') |
261 #self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedColorful", tabtheme == 'slanted&colorful') | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
262 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedBlackandWhite", tabtheme == 'slanted&bw') |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
263 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedAqua", tabtheme == 'slanted&aqua') |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
264 self.mainmenu.SetMenuState("OpenRPGTabStylesFlatBlackandWhite", tabtheme == 'flat&bw') |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
265 self.mainmenu.SetMenuState("OpenRPGTabStylesFlatAqua", tabtheme == 'flat&aqua') |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
266 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedCustom", tabtheme == 'customslant') |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
267 self.mainmenu.SetMenuState("OpenRPGTabStylesFlatCustom", tabtheme == 'customflat') |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
268 |
119 | 269 lvl = int(settings.get('LoggingLevel')) |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
270 if lvl & ORPG_DEBUG: self.mainmenu.SetMenuState("ToolsLoggingLevelDebug", True) |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
271 if lvl & ORPG_DEBUG: self.mainmenu.SetMenuState("ToolsLoggingLevelNote", True) |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
272 if lvl & ORPG_INFO: self.mainmenu.SetMenuState("ToolsLoggingLevelInfo", True) |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
273 if lvl & ORPG_GENERAL: self.mainmenu.SetMenuState("ToolsLoggingLevelGeneral", True) |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
274 |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
275 self.pluginMenu = wx.Menu() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
276 item = wx.MenuItem(self.pluginMenu, wx.ID_ANY, "Control Panel", "Control Panel") |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
277 self.Bind(wx.EVT_MENU, self.OnMB_PluginControlPanel, item) |
49
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
26
diff
changeset
|
278 |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
279 self.pluginMenu.AppendItem(item) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
280 self.pluginMenu.AppendSeparator() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
281 self.mainmenu.Insert(2, self.pluginMenu, "&Plugins") |
49
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
26
diff
changeset
|
282 |
79
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
74
diff
changeset
|
283 # Traipse Suite of Additions. |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
74
diff
changeset
|
284 self.traipseSuite = wx.Menu() |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
74
diff
changeset
|
285 self.mainmenu.Insert(5, self.traipseSuite, "&Traipse Suite") |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
74
diff
changeset
|
286 |
133 | 287 #Update Manager |
116 | 288 mana = wx.MenuItem(self.traipseSuite, wx.ID_ANY, "Update Manager", "Update Manager") |
289 self.Bind(wx.EVT_MENU, self.OnMB_UpdateManagerPanel, mana) | |
290 self.traipseSuite.AppendItem(mana) | |
49
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
26
diff
changeset
|
291 |
86 | 292 self.debugConsole = wx.MenuItem(self.traipseSuite, -1, "Debug Console", "Debug Console") |
293 self.Bind(wx.EVT_MENU, self.OnMB_DebugConsole, self.debugConsole) | |
294 self.traipseSuite.AppendItem(self.debugConsole) | |
95 | 295 |
296 def TraipseSuiteWarn(self, menuitem): | |
141 | 297 ### Allows for the reuse of the 'Attention' menu. |
95 | 298 ### component.get('frame').TraipseSuiteWarn('item') ### Portable |
134 | 299 self.mainmenu.Remove(8) |
300 self.mainmenu.Insert(8, self.traipseSuite, "&Traipse Suite!") | |
95 | 301 if menuitem == 'debug': |
96 | 302 if self.debugger.IsShown() == True: |
195 | 303 self.mainmenu.Remove(8) |
304 self.mainmenu.Insert(8, self.traipseSuite, "&Traipse Suite") | |
96 | 305 else: |
306 self.debugConsole.SetBitmap(wx.Bitmap(dir_struct["icon"] + 'spotlight.png')) | |
307 self.traipseSuite.RemoveItem(self.debugConsole) | |
308 self.traipseSuite.AppendItem(self.debugConsole) | |
309 | |
310 def TraipseSuiteWarnCleanup(self, menuitem): | |
141 | 311 ### Allows for portable cleanup of the 'Attention' menu. |
96 | 312 ### component.get('frame').TraipseSuiteWarnCleanup('item') ### Portable |
134 | 313 self.mainmenu.Remove(8) |
314 self.mainmenu.Insert(8, self.traipseSuite, "&Traipse Suite") | |
96 | 315 if menuitem == 'debug': |
95 | 316 self.traipseSuite.RemoveItem(self.debugConsole) |
96 | 317 self.debugConsole.SetBitmap(wx.Bitmap(dir_struct["icon"] + 'clear.gif')) |
95 | 318 self.traipseSuite.AppendItem(self.debugConsole) |
49
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
26
diff
changeset
|
319 |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
320 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
321 ################################# |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
322 ## All Menu Events |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
323 ################################# |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
324 #Tab Styles Menus |
124 | 325 |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
326 def SetTabStyles(self, *args, **kwargs): |
119 | 327 tabtheme = settings.get('TabTheme') #This change is stable. TaS. |
228 | 328 #self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedColorful", tabtheme == 'slanted&colorful') |
26
65c5cb9be59c
This patch fixes the known issue with users not being able to set their name
sirebral
parents:
19
diff
changeset
|
329 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedBlackandWhite", tabtheme == 'slanted&bw') |
65c5cb9be59c
This patch fixes the known issue with users not being able to set their name
sirebral
parents:
19
diff
changeset
|
330 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedAqua", tabtheme == 'slanted&aqua') |
65c5cb9be59c
This patch fixes the known issue with users not being able to set their name
sirebral
parents:
19
diff
changeset
|
331 self.mainmenu.SetMenuState("OpenRPGTabStylesFlatBlackandWhite", tabtheme == 'flat&bw') |
65c5cb9be59c
This patch fixes the known issue with users not being able to set their name
sirebral
parents:
19
diff
changeset
|
332 self.mainmenu.SetMenuState("OpenRPGTabStylesFlatAqua", tabtheme == 'flat&aqua') |
65c5cb9be59c
This patch fixes the known issue with users not being able to set their name
sirebral
parents:
19
diff
changeset
|
333 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedCustom", tabtheme == 'customslant') |
65c5cb9be59c
This patch fixes the known issue with users not being able to set their name
sirebral
parents:
19
diff
changeset
|
334 self.mainmenu.SetMenuState("OpenRPGTabStylesFlatCustom", tabtheme == 'customflat') |
65c5cb9be59c
This patch fixes the known issue with users not being able to set their name
sirebral
parents:
19
diff
changeset
|
335 |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
336 if kwargs.has_key('style'): newstyle = kwargs['style'] |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
337 else: |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
338 try: newstyle = args[1] |
74 | 339 except: logger.general('Invalid Syntax for orpgFrame->SetTabStyles(self, *args, **kwargs)'); return |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
340 if kwargs.has_key('menu'): menu = kwargs['menu'] |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
341 else: |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
342 try: menu = args[0] |
74 | 343 except: logger.general('Invalid Syntax for orpgFrame->SetTabStyles(self, *args, **kwargs)'); return |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
344 if kwargs.has_key('graidentTo'): graidentTo = kwargs['graidentTo'] |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
345 else: graidentTo = None |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
346 if kwargs.has_key('graidentFrom'): graidentFrom = kwargs['graidentFrom'] |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
347 else: graidentFrom = None |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
348 if kwargs.has_key('textColor'): textColor = kwargs['textColor'] |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
349 else: textColor = None |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
350 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
351 #Run though the current tabbed window list and remove those that have been closed |
66 | 352 tabbedwindows = component.get("tabbedWindows") |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
353 new = [] |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
354 for wnd in tabbedwindows: |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
355 try: style = wnd.GetWindowStyleFlag(); new.append(wnd) |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
356 except: pass |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
357 tabbedwindows = new |
66 | 358 component.add("tabbedWindows", tabbedwindows) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
359 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
360 #Run though the new list and set the proper styles |
119 | 361 tabbg = settings.get('TabBackgroundGradient') |
74 | 362 (red, green, blue) = self.rgb.rgb_tuple(tabbg) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
363 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
364 for wnd in tabbedwindows: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
365 style = wnd.GetWindowStyleFlag() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
366 # remove old tabs style |
228 | 367 mirror = ~(FNB.FNB_VC71 | FNB.FNB_VC8 | FNB.FNB_FANCY_TABS ) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
368 style &= mirror |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
369 style |= newstyle |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
370 wnd.SetWindowStyleFlag(style) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
371 wnd.SetTabAreaColour(wx.Color(red, green, blue)) |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
372 if graidentTo != None: wnd.SetGradientColourTo(graidentTo) |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
373 if graidentFrom != None: wnd.SetGradientColourFrom(graidentFrom) |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
374 if textColor != None: wnd.SetNonActiveTabTextColour(textColor) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
375 wnd.Refresh() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
376 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
377 def OnMB_OpenRPGNewMap(self): |
66 | 378 pass #Not Implemented yet! |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
379 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
380 def OnMB_OpenRPGTabStylesSlantedColorful(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
381 if self.mainmenu.GetMenuState("OpenRPGTabStylesSlantedColorful"): |
119 | 382 settings.change('TabTheme', 'slanted&colorful') |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
383 self.SetTabStyles("OpenRPGTabStylesSlantedColorful", FNB.FNB_VC8|FNB.FNB_COLORFUL_TABS) |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
384 else: self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedColorful", True) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
385 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
386 def OnMB_OpenRPGTabStylesSlantedBlackandWhite(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
387 if self.mainmenu.GetMenuState("OpenRPGTabStylesSlantedBlackandWhite"): |
119 | 388 settings.change('TabTheme', 'slanted&bw') |
66 | 389 self.SetTabStyles("OpenRPGTabStylesSlantedBlackandWhite", |
390 FNB.FNB_VC8, graidentTo=wx.WHITE, graidentFrom=wx.WHITE, textColor=wx.BLACK) | |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
391 else: self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedBlackandWhite", True) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
392 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
393 def OnMB_OpenRPGTabStylesSlantedAqua(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
394 if self.mainmenu.GetMenuState("OpenRPGTabStylesSlantedAqua"): |
119 | 395 settings.change('TabTheme', 'slanted&aqua') |
66 | 396 self.SetTabStyles("OpenRPGTabStylesSlantedAqua", FNB.FNB_VC8, |
397 graidentTo=wx.Color(0, 128, 255), graidentFrom=wx.WHITE, textColor=wx.BLACK) | |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
398 else: self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedAqua", True) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
399 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
400 def OnMB_OpenRPGTabStylesSlantedCustom(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
401 if self.mainmenu.GetMenuState("OpenRPGTabStylesSlantedCustom"): |
119 | 402 settings.change('TabTheme', 'customslant') |
403 gfrom = settings.get('TabGradientFrom') | |
74 | 404 (fred, fgreen, fblue) = self.rgb.rgb_tuple(gfrom) |
119 | 405 gto = settings.get('TabGradientTo') |
74 | 406 (tored, togreen, toblue) = self.rgb.rgb_tuple(gto) |
119 | 407 tabtext = settings.get('TabTextColor') |
74 | 408 (tred, tgreen, tblue) = self.rgb.rgb_tuple(tabtext) |
119 | 409 tabbg = settings.get('TabBackgroundGradient') |
74 | 410 (red, green, blue) = self.rgb.rgb_tuple(tabbg) |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
411 self.SetTabStyles("OpenRPGTabStylesSlantedCustom", FNB.FNB_VC8, |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
412 graidentTo=wx.Color(tored, togreen, toblue), graidentFrom=wx.Color(fred, fgreen, fblue), |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
413 textColor=wx.Color(tred, tgreen, tblue)) |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
414 else: self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedCustom", True) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
415 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
416 def OnMB_OpenRPGTabStylesFlatBlackandWhite(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
417 if self.mainmenu.GetMenuState("OpenRPGTabStylesFlatBlackandWhite"): |
119 | 418 settings.change('TabTheme', 'flat&bw') |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
419 self.SetTabStyles("OpenRPGTabStylesFlatBlackandWhite", FNB.FNB_FANCY_TABS, |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
420 graidentTo=wx.WHITE, graidentFrom=wx.WHITE, textColor=wx.BLACK) |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
421 else: self.mainmenu.SetMenuState("OpenRPGTabStylesFlatBlackandWhite", True) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
422 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
423 def OnMB_OpenRPGTabStylesFlatAqua(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
424 if self.mainmenu.GetMenuState("OpenRPGTabStylesFlatAqua"): |
119 | 425 settings.change('TabTheme', 'flat&aqua') |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
426 self.SetTabStyles("OpenRPGTabStylesFlatAqua", FNB.FNB_FANCY_TABS, |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
427 graidentTo=wx.Color(0, 128, 255), graidentFrom=wx.WHITE, textColor=wx.BLACK) |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
428 else: self.mainmenu.SetMenuState("OpenRPGTabStylesFlatAqua", True) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
429 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
430 def OnMB_OpenRPGTabStylesFlatCustom(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
431 if self.mainmenu.GetMenuState("OpenRPGTabStylesFlatCustom"): |
119 | 432 settings.change('TabTheme', 'customflat') |
433 gfrom = settings.get('TabGradientFrom') | |
74 | 434 (fred, fgreen, fblue) = self.rgb.rgb_tuple(gfrom) |
119 | 435 gto = settings.get('TabGradientTo') |
74 | 436 (tored, togreen, toblue) = self.rgb.rgb_tuple(gto) |
119 | 437 tabtext = settings.get('TabTextColor') |
74 | 438 (tred, tgreen, tblue) = self.rgb.rgb_tuple(tabtext) |
119 | 439 tabbg = settings.get('TabBackgroundGradient') |
74 | 440 (red, green, blue) = self.rgb.rgb_tuple(tabbg) |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
441 self.SetTabStyles("OpenRPGTabStylesFlatCustom", FNB.FNB_FANCY_TABS, |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
442 graidentTo=wx.Color(tored, togreen, toblue), graidentFrom=wx.Color(fred, fgreen, fblue), |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
443 textColor=wx.Color(tred, tgreen, tblue)) |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
444 else: self.mainmenu.SetMenuState("OpenRPGTabStylesFlatCustom", True) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
445 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
446 #Window Menu |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
447 def OnMB_WindowsMenu(self, event): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
448 menuid = event.GetId() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
449 name = self.mainwindows[menuid] |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
450 if name == 'Alias Lib': |
60
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
451 if self.aliaslib.IsShown(): self.aliaslib.Hide() |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
452 else: self.aliaslib.Show() |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
453 else: |
60
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
454 if self._mgr.GetPane(name).IsShown(): self._mgr.GetPane(name).Hide() |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
455 else: self._mgr.GetPane(name).Show() |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
456 self._mgr.Update() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
457 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
458 #OpenRPG Menu |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
459 def OnMB_OpenRPGSettings(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
460 dlg = orpg.tools.orpg_settings.orpgSettingsWnd(self) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
461 dlg.Centre() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
462 dlg.ShowModal() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
463 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
464 def OnMB_OpenRPGExit(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
465 self.OnCloseWindow(0) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
466 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
467 #Game Server Menu |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
468 def OnMB_GameServerBrowseServers(self): |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
469 if self._mgr.GetPane("Browse Server Window").IsShown() == True: self._mgr.GetPane("Browse Server Window").Hide() |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
470 else: self._mgr.GetPane("Browse Server Window").Show() |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
471 self._mgr.Update() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
472 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
473 def OnMB_GameServerServerHeartbeat(self): |
119 | 474 if self.mainmenu.GetMenuState("GameServerServerHeartbeat"): settings.change('Heartbeat', '1') |
475 else: settings.change('Heartbeat', '0') | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
476 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
477 def OnMB_GameServerStartServer(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
478 start_dialog = wx.ProgressDialog( "Server Loading", "Server Loading, Please Wait...", 1, self ) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
479 # Spawn the new process and close the stdout handle from it |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
480 start_dialog.Update( 0 ) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
481 # Adjusted following code to work with win32, can't test for Unix |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
482 # as per reported bug 586227 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
483 if wx.Platform == "__WXMSW__": |
66 | 484 arg = '\"' + os.path.normpath(dir_struct["home"] + 'start_server_gui.py') + '\"' |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
485 args = ( sys.executable, arg ) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
486 else: |
66 | 487 arg = dir_struct["home"] + 'start_server_gui.py' |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
488 args = (arg,arg) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
489 os.spawnv( os.P_NOWAIT, sys.executable, args ) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
490 start_dialog.Update( 1 ) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
491 start_dialog.Show(False) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
492 start_dialog.Destroy() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
493 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
494 # Tools Menu |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
495 def OnMB_PluginControlPanel(self, evt): |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
496 if self.pluginsFrame.IsShown() == True: self.pluginsFrame.Hide() |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
497 else: self.pluginsFrame.Show() |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
498 |
49
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
26
diff
changeset
|
499 def OnMB_UpdateManagerPanel(self, evt): |
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
26
diff
changeset
|
500 if self.updateMana.IsShown() == True: self.updateMana.Hide() |
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
26
diff
changeset
|
501 else: self.updateMana.Show() |
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
26
diff
changeset
|
502 |
79
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
74
diff
changeset
|
503 def OnMB_DebugConsole(self, evt): |
195 | 504 self.TraipseSuiteWarnCleanup('debug') |
79
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
74
diff
changeset
|
505 if self.debugger.IsShown() == True: self.debugger.Hide() |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
74
diff
changeset
|
506 else: self.debugger.Show() |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
74
diff
changeset
|
507 |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
508 def OnMB_ToolsLoggingLevelDebug(self): |
66 | 509 lvl = logger.log_level |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
510 if self.mainmenu.GetMenuState("ToolsLoggingLevelDebug"): lvl |= ORPG_DEBUG |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
511 else: lvl &= ~ORPG_DEBUG |
66 | 512 logger.log_level = lvl |
195 | 513 settings.change('LoggingLevel', lvl) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
514 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
515 def OnMB_ToolsLoggingLevelNote(self): |
66 | 516 lvl = logger.log_level |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
517 if self.mainmenu.GetMenuState("ToolsLoggingLevelNote"): lvl |= ORPG_DEBUG |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
518 else: lvl &= ~ORPG_DEBUG |
66 | 519 logger.log_level = lvl |
195 | 520 settings.change('LoggingLevel', lvl) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
521 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
522 def OnMB_ToolsLoggingLevelInfo(self): |
66 | 523 lvl = logger.log_level |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
524 if self.mainmenu.GetMenuState("ToolsLoggingLevelInfo"): lvl |= ORPG_INFO |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
525 else: lvl &= ~ORPG_INFO |
66 | 526 logger.log_level = lvl |
195 | 527 settings.change('LoggingLevel', lvl) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
528 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
529 def OnMB_ToolsLoggingLevelGeneral(self): |
66 | 530 lvl = logger.log_level |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
531 if self.mainmenu.GetMenuState("ToolsLoggingLevelGeneral"): lvl |= ORPG_GENERAL |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
532 else: lvl &= ~ORPG_GENERAL |
66 | 533 logger.log_level = lvl |
195 | 534 settings.change('LoggingLevel', lvl) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
535 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
536 def OnMB_ToolsPasswordManager(self): |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
537 if self.mainmenu.GetMenuState("ToolsPasswordManager"): self.password_manager.Enable() |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
538 else: self.password_manager.Disable() |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
539 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
540 def OnMB_ToolsStatusBar(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
541 if self._mgr.GetPane("Status Window").IsShown() == True: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
542 self.mainmenu.SetMenuState("ToolsStatusBar", False) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
543 self._mgr.GetPane("Status Window").Hide() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
544 else: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
545 self.mainmenu.SetMenuState("ToolsStatusBar", True) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
546 self._mgr.GetPane("Status Window").Show() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
547 self._mgr.Update() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
548 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
549 def OnMB_ToolsSoundToolbar(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
550 if self._mgr.GetPane("Sound Control Toolbar").IsShown() == True: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
551 self.mainmenu.SetMenuState("ToolsSoundToolbar", False) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
552 self._mgr.GetPane("Sound Control Toolbar").Hide() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
553 else: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
554 self.mainmenu.SetMenuState("ToolsSoundToolbar", True) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
555 self._mgr.GetPane("Sound Control Toolbar").Show() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
556 self._mgr.Update() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
557 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
558 def OnMB_ToolsDiceBar(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
559 if self._mgr.GetPane("Dice Tool Bar").IsShown() == True: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
560 self.mainmenu.SetMenuState("ToolsDiceBar", False) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
561 self._mgr.GetPane("Dice Tool Bar").Hide() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
562 else: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
563 self.mainmenu.SetMenuState("ToolsDiceBar", True) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
564 self._mgr.GetPane("Dice Tool Bar").Show() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
565 self._mgr.Update() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
566 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
567 def OnMB_ToolsMapBar(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
568 if self._mgr.GetPane("Map Tool Bar").IsShown() == True: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
569 self.mainmenu.SetMenuState("ToolsMapBar", False) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
570 self._mgr.GetPane("Map Tool Bar").Hide() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
571 else: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
572 self.mainmenu.SetMenuState("ToolsMapBar", True) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
573 self._mgr.GetPane("Map Tool Bar").Show() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
574 self._mgr.Update() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
575 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
576 def OnMB_HelpAbout(self): |
98 | 577 if self.AboutORPG.IsShown() == True: self.AboutORPG.Hide() |
578 else: self.AboutORPG.Show() | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
579 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
580 def OnMB_HelpOnlineUserGuide(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
581 wb = webbrowser.get() |
96 | 582 wb.open("http://www.assembla.com/wiki/show/traipse/User_Manual") |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
583 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
584 def OnMB_HelpChangeLog(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
585 wb = webbrowser.get() |
96 | 586 wb.open("http://www.assembla.com/spaces/milestones/index/traipse?spaces_tool_id=Milestones") |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
587 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
588 def OnMB_HelpReportaBug(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
589 wb = webbrowser.get() |
4 | 590 wb.open("http://www.assembla.com/spaces/tickets/index/traipse_dev?spaces_tool_id=Tickets") |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
591 |
138 | 592 def OnMB_HelpTipoftheDay(self): |
593 self.ShowTipOfTheDay() | |
594 | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
595 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
596 ################################# |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
597 ## Build the GUI |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
598 ################################# |
124 | 599 |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
600 def build_gui(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
601 self.Freeze() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
602 self.validate.config_file("layout.xml","default_layout.xml") |
66 | 603 |
124 | 604 layout = parse(dir_struct["user"] + "layout.xml") |
605 xml_dom = layout.getroot() | |
66 | 606 |
60
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
607 self.windowsmenu = wx.Menu() |
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
608 self.mainwindows = {} |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
609 |
98 | 610 # About Window |
611 self.AboutORPG = AboutORPG(self) | |
612 | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
613 #Plugins Window |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
614 self.pluginsFrame = pluginUI.PluginFrame(self) |
66 | 615 component.add("plugins", self.get_activeplugins()) |
616 component.add("startplugs", self.get_startplugins()) | |
74 | 617 logger.debug("Menu Created") |
124 | 618 h = int(xml_dom.get("height")) |
619 w = int(xml_dom.get("width")) | |
620 posx = int(xml_dom.get("posx")) | |
621 posy = int(xml_dom.get("posy")) | |
622 maximized = int(xml_dom.get("maximized")) | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
623 self.SetDimensions(posx, posy, w, h) |
66 | 624 logger.debug("Dimensions Set") |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
625 |
116 | 626 # Update Manager |
141 | 627 #self.manifest = manifest.ManifestChanges() |
116 | 628 self.updateMana = upmana.updatemana.updaterFrame(self, |
210 | 629 "OpenRPG Update Manager 1.2", component, manifest, True) |
182 | 630 component.add('upmana-win', self.updateMana) |
116 | 631 logger.debug("Menu Created") |
124 | 632 h = int(xml_dom.get("height")) |
633 w = int(xml_dom.get("width")) | |
634 posx = int(xml_dom.get("posx")) | |
635 posy = int(xml_dom.get("posy")) | |
636 maximized = int(xml_dom.get("maximized")) | |
116 | 637 self.SetDimensions(posx, posy, w, h) |
638 logger.debug("Dimensions Set") | |
49
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
26
diff
changeset
|
639 |
98 | 640 # Debug Console |
79
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
74
diff
changeset
|
641 self.debugger = orpg.tools.orpg_log.DebugConsole(self) |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
74
diff
changeset
|
642 logger.debug("Menu Created") |
124 | 643 h = int(xml_dom.get("height")) |
644 w = int(xml_dom.get("width")) | |
645 posx = int(xml_dom.get("posx")) | |
646 posy = int(xml_dom.get("posy")) | |
647 maximized = int(xml_dom.get("maximized")) | |
79
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
74
diff
changeset
|
648 self.SetDimensions(posx, posy, w, h) |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
74
diff
changeset
|
649 logger.debug("Dimensions Set") |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
74
diff
changeset
|
650 |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
651 # Sound Manager |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
652 self.sound_player = orpg.tools.orpg_sound.orpgSound(self) |
66 | 653 component.add("sound", self.sound_player) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
654 wndinfo = AUI.AuiPaneInfo() |
60
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
655 menuid = wx.NewId() |
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
656 self.mainwindows[menuid] = "Sound Control Toolbar" |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
657 wndinfo.DestroyOnClose(False) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
658 wndinfo.Name("Sound Control Toolbar") |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
659 wndinfo.Caption("Sound Control Toolbar") |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
660 wndinfo.Float() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
661 wndinfo.ToolbarPane() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
662 wndinfo.Hide() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
663 self._mgr.AddPane(self.sound_player, wndinfo) |
124 | 664 children = xml_dom.getchildren() |
59
5aff3ef1ae46
New dev branch for Ornery Orc. Adds CSS styling to chat messages. Updates
sirebral
parents:
54
diff
changeset
|
665 for c in children: self.build_window(c, self) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
666 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
667 # status window |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
668 self.status = status_bar(self) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
669 wndinfo = AUI.AuiPaneInfo() |
60
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
670 menuid = wx.NewId() |
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
671 self.mainwindows[menuid] = "Status Window" |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
672 wndinfo.DestroyOnClose(False) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
673 wndinfo.Name("Status Window") |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
674 wndinfo.Caption("Status Window") |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
675 wndinfo.Float() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
676 wndinfo.ToolbarPane() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
677 wndinfo.Hide() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
678 self._mgr.AddPane(self.status, wndinfo) |
66 | 679 logger.debug("Status Window Created") |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
680 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
681 # Create and show the floating dice toolbar |
195 | 682 self.dieToolBar = orpg.tools.toolBars.DiceToolBar(self, callBack = Parse.Post) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
683 wndinfo = AUI.AuiPaneInfo() |
60
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
684 menuid = wx.NewId() |
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
685 self.mainwindows[menuid] = "Dice Tool Bar" |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
686 wndinfo.DestroyOnClose(False) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
687 wndinfo.Name("Dice Tool Bar") |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
688 wndinfo.Caption("Dice Tool Bar") |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
689 wndinfo.Float() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
690 wndinfo.ToolbarPane() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
691 wndinfo.Hide() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
692 self._mgr.AddPane(self.dieToolBar, wndinfo) |
66 | 693 logger.debug("Dice Tool Bar Created") |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
694 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
695 #Create the Map tool bar |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
696 self.mapToolBar = orpg.tools.toolBars.MapToolBar(self, callBack = self.map.MapBar) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
697 wndinfo = AUI.AuiPaneInfo() |
60
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
698 menuid = wx.NewId() |
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
699 self.mainwindows[menuid] = "Map Tool Bar" |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
700 wndinfo.DestroyOnClose(False) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
701 wndinfo.Name("Map Tool Bar") |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
702 wndinfo.Caption("Map Tool Bar") |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
703 wndinfo.Float() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
704 wndinfo.ToolbarPane() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
705 wndinfo.Hide() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
706 self._mgr.AddPane(self.mapToolBar, wndinfo) |
66 | 707 logger.debug("Map Tool Bar Created") |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
708 |
74 | 709 #Create the Browse Server Window #Turn into frame, as with others. |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
710 self.gs = orpg.networking.gsclient.game_server_panel(self) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
711 wndinfo = AUI.AuiPaneInfo() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
712 wndinfo.DestroyOnClose(False) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
713 wndinfo.Name("Browse Server Window") |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
714 wndinfo.Caption("Game Server") |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
715 wndinfo.Float() |
90 | 716 wndinfo.FloatingPosition((50,50)) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
717 wndinfo.Dockable(False) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
718 wndinfo.MinSize(wx.Size(640,480)) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
719 wndinfo.Hide() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
720 self._mgr.AddPane(self.gs, wndinfo) |
66 | 721 logger.debug("Game Server Window Created") |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
722 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
723 #Create the Alias Lib Window |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
724 self.aliaslib = orpg.tools.aliaslib.AliasLib() |
161 | 725 component.add("alias", self.aliaslib) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
726 self.aliaslib.Hide() |
66 | 727 logger.debug("Alias Window Created") |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
728 menuid = wx.NewId() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
729 self.windowsmenu.Append(menuid, "Alias Lib", kind=wx.ITEM_CHECK) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
730 self.windowsmenu.Check(menuid, False) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
731 self.Bind(wx.EVT_MENU, self.OnMB_WindowsMenu, id=menuid) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
732 self.mainwindows[menuid] = "Alias Lib" |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
733 self.mainmenu.Insert(3, self.windowsmenu, 'Windows') |
66 | 734 logger.debug("Windows Menu Done") |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
735 self._mgr.Update() |
59
5aff3ef1ae46
New dev branch for Ornery Orc. Adds CSS styling to chat messages. Updates
sirebral
parents:
54
diff
changeset
|
736 if wx.VERSION_STRING > "2.8": self.Bind(AUI.EVT_AUI_PANE_CLOSE, self.onPaneClose) |
5aff3ef1ae46
New dev branch for Ornery Orc. Adds CSS styling to chat messages. Updates
sirebral
parents:
54
diff
changeset
|
737 else: self.Bind(AUI.EVT_AUI_PANECLOSE, self.onPaneClose) |
66 | 738 logger.debug("AUI Bindings Done") |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
739 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
740 #Load the layout if one exists |
161 | 741 try: |
742 layout = xml_dom.find("DockLayout") | |
743 self._mgr.LoadPerspective(layout.text) | |
744 logger.debug("Perspective Loaded") | |
745 except: pass | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
746 self._mgr.GetPane("Browse Server Window").Hide() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
747 self._mgr.Update() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
748 self.Maximize(maximized) |
74 | 749 logger.debug("GUI is all created") |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
750 self.Thaw() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
751 |
138 | 752 def do_tab_window(self, xml_dom, parent_wnd): |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
753 # if container window loop through childern and do a recursive call |
228 | 754 temp_wnd = orpgTabberWnd(parent_wnd) |
66 | 755 |
124 | 756 children = xml_dom.getchildren() |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
757 for c in children: |
228 | 758 wnd = self.build_window(c, temp_wnd) |
124 | 759 name = c.get("name") |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
760 temp_wnd.AddPage(wnd, name, False) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
761 return temp_wnd |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
762 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
763 def build_window(self, xml_dom, parent_wnd): |
124 | 764 name = xml_dom.tag |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
765 if name == "DockLayout" or name == "dock": return |
124 | 766 dirc = xml_dom.get("direction") #should NOT use dir, it is a built in function. |
767 pos = xml_dom.get("pos") | |
768 height = xml_dom.get("height") | |
769 width = xml_dom.get("width") | |
770 cap = xml_dom.get("caption") | |
771 dockable = xml_dom.get("dockable") | |
772 layer = xml_dom.get("layer") | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
773 |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
774 try: layer = int(layer); dockable = int(dockable) |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
775 except: layer = 0; dockable = 1 |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
776 |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
777 if name == "tab": temp_wnd = self.do_tab_window(xml_dom, parent_wnd) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
778 elif name == "map": |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
779 temp_wnd = orpg.mapper.map.map_wnd(parent_wnd, -1) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
780 self.map = temp_wnd |
161 | 781 component.add("map",self.map) |
782 | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
783 elif name == "tree": |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
784 temp_wnd = orpg.gametree.gametree.game_tree(parent_wnd, -1) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
785 self.tree = temp_wnd |
119 | 786 if settings.get('ColorTree') == '1': |
787 self.tree.SetBackgroundColour(settings.get('bgcolor')) | |
788 self.tree.SetForegroundColour(settings.get('textcolor')) | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
789 else: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
790 self.tree.SetBackgroundColour('white') |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
791 self.tree.SetForegroundColour('black') |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
792 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
793 elif name == "chat": |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
794 temp_wnd = orpg.chat.chatwnd.chat_notebook(parent_wnd, wx.DefaultSize) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
795 self.chattabs = temp_wnd |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
796 self.chat = temp_wnd.MainChatPanel |
196 | 797 component.add("chat", self.chat) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
798 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
799 elif name == "player": |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
800 temp_wnd = orpg.player_list.player_list(parent_wnd) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
801 self.players = temp_wnd |
119 | 802 if settings.get('ColorTree') == '1': |
803 self.players.SetBackgroundColour(settings.get('bgcolor')) | |
804 self.players.SetForegroundColour(settings.get('textcolor')) | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
805 else: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
806 self.players.SetBackgroundColour('white') |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
807 self.players.SetForegroundColour('black') |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
808 |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
809 if parent_wnd != self: return temp_wnd |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
810 menuid = wx.NewId() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
811 self.windowsmenu.Append(menuid, cap, kind=wx.ITEM_CHECK) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
812 self.windowsmenu.Check(menuid, True) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
813 self.Bind(wx.EVT_MENU, self.OnMB_WindowsMenu, id=menuid) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
814 self.mainwindows[menuid] = cap |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
815 wndinfo = AUI.AuiPaneInfo() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
816 wndinfo.DestroyOnClose(False) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
817 wndinfo.Name(cap) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
818 wndinfo.FloatingSize(wx.Size(int(width), int(height))) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
819 wndinfo.BestSize(wx.Size(int(width), int(height))) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
820 wndinfo.Layer(int(layer)) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
821 wndinfo.Caption(cap) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
822 |
14 | 823 # Lambda here should work! (future dev) |
74 | 824 if dirc.lower() == 'top': wndinfo.Top() |
825 elif dirc.lower() == 'bottom': wndinfo.Bottom() | |
826 elif dirc.lower() == 'left': wndinfo.Left() | |
827 elif dirc.lower() == 'right': wndinfo.Right() | |
828 elif dirc.lower() == 'center': wndinfo.Center(); wndinfo.CaptionVisible(False) | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
829 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
830 if dockable != 1: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
831 wndinfo.Dockable(False) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
832 wndinfo.Floatable(False) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
833 if pos != '' or pos != '0' or pos != None: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
834 wndinfo.Position(int(pos)) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
835 wndinfo.Show() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
836 self._mgr.AddPane(temp_wnd, wndinfo) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
837 return temp_wnd |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
838 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
839 def onPaneClose(self, evt): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
840 pane = evt.GetPane() |
60
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
841 #Arbitrary If ELIF fix. Items had incorrect ID's set. Finding correct ID will fix it for the iteration. |
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
842 #Adding ID also fixed docking. Go figure. |
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
843 if pane.name == 'Sound Control Toolbar': self.mainmenu.SetMenuState('ToolsSoundToolbar', False) |
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
844 elif pane.name == 'Status Window': self.mainmenu.SetMenuState('ToolsStatusBar', False) |
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
845 elif pane.name == 'Dice Tool Bar': self.mainmenu.SetMenuState('ToolsDiceBar', False) |
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
846 elif pane.name == 'Map Tool Bar': self.mainmenu.SetMenuState('ToolsMapBar', False) |
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
847 else: |
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
848 for wndid, wname in self.mainwindows.iteritems(): |
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
849 if pane.name == wname: self.windowsmenu.Check(wndid, False); break |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
850 evt.Skip() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
851 self._mgr.Update() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
852 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
853 def saveLayout(self): |
126 | 854 filename = dir_struct["user"] + "layout.xml" |
133 | 855 layout = parse(filename) |
124 | 856 xml_dom = layout.getroot() |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
857 (x_size,y_size) = self.GetClientSize() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
858 (x_pos,y_pos) = self.GetPositionTuple() |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
859 if self.IsMaximized(): max = 1 |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
860 else: max = 0 |
124 | 861 xml_dom.set("height", str(y_size)) |
862 xml_dom.set("width", str(x_size)) | |
863 xml_dom.set("posx", str(x_pos)) | |
864 xml_dom.set("posy", str(y_pos)) | |
865 xml_dom.set("maximized", str(max)) | |
161 | 866 try: xml_dom.find("DockLayout").text = str(self._mgr.SavePerspective()) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
867 except: |
126 | 868 elem = Element('DockLayout') |
124 | 869 elem.set("DO_NO_EDIT","True") |
126 | 870 elem.text = str(self._mgr.SavePerspective()) |
124 | 871 xml_dom.append(elem) |
133 | 872 layout.write(filename) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
873 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
874 def build_hotkeys(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
875 self.mainmenu.accel.xaccel.extend(self.chat.get_hot_keys()) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
876 self.mainmenu.accel.xaccel.extend(self.map.get_hot_keys()) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
877 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
878 def start_timer(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
879 self.poll_timer.Start(100) |
141 | 880 if settings.get("Heartbeat") == "1": |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
881 self.ping_timer.Start(1000*60) |
74 | 882 logger.debug("starting heartbeat...", True) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
883 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
884 def kill_mplay_session(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
885 self.game_name = "" |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
886 self.session.start_disconnect() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
887 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
888 def quit_game(self, evt): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
889 dlg = wx.MessageDialog(self,"Exit gaming session?","Game Session",wx.YES_NO) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
890 if dlg.ShowModal() == wx.ID_YES: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
891 self.session.exitCondition.notifyAll() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
892 dlg.Destroy() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
893 self.kill_mplay_session() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
894 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
895 def on_status_event(self, evt): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
896 id = evt.get_id() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
897 status = evt.get_data() |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
898 if id == orpg.networking.mplay_client.STATUS_SET_URL: self.status.set_url(status) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
899 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
900 def on_player_event(self, evt): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
901 id = evt.get_id() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
902 player = evt.get_data() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
903 display_name = self.chat.chat_display_name(player) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
904 time_str = time.strftime("%H:%M", time.localtime()) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
905 if id == orpg.networking.mplay_client.PLAYER_NEW: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
906 self.players.add_player(player) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
907 self.chat.InfoPost(display_name + " (enter): " + time_str) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
908 elif id == orpg.networking.mplay_client.PLAYER_DEL: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
909 self.players.del_player(player) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
910 self.chat.InfoPost(display_name + " (exit): " + time_str) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
911 elif id == orpg.networking.mplay_client.PLAYER_UPDATE: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
912 self.players.update_player(player) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
913 self.players.Refresh() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
914 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
915 def on_group_event(self, evt): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
916 id = evt.get_id() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
917 data = evt.get_data() |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
918 if id == orpg.networking.mplay_client.GROUP_NEW: self.gs.add_room(data) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
919 elif id == orpg.networking.mplay_client.GROUP_DEL: |
124 | 920 # self.password_manager.RemoveGroupData(data) #Removed for debugging. |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
921 self.gs.del_room(data) |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
922 elif id == orpg.networking.mplay_client.GROUP_UPDATE: self.gs.update_room(data) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
923 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
924 def on_receive(self, data, player): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
925 # see if we are ignoring this user |
124 | 926 (ignore_id, ignore_name) = self.session.get_ignore_list() |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
927 for m in ignore_id: |
66 | 928 if m == player[2]: logger.debug("ignoring message from player:" + player[0], True); return |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
929 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
930 # ok we are not ignoring this message |
74 | 931 #recvSound = "RecvSound" # this will be the default sound. Whisper will change this below |
133 | 932 |
118 | 933 etreeEl = Element('msg') |
934 try: etreeEl.append(fromstring(data)) | |
935 except: etreeEl.text = data | |
936 | |
224 | 937 display_name = self.chat.chat_display_name(player) |
938 if etreeEl.text:self.chat.Post(display_name+etreeEl.text) | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
939 |
118 | 940 for child in etreeEl.getchildren(): |
941 if child.tag == 'tree': | |
182 | 942 dlg = wx.MessageDialog(None, component.strip_html(display_name) + ' is trying to send you a tree node. Accept?', 'Question', |
118 | 943 wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION) |
944 if dlg.ShowModal() == wx.ID_YES: | |
945 dlg.Destroy() | |
141 | 946 self.tree.on_receive_data(tostring(child)) |
118 | 947 self.chat.InfoPost(display_name + " has sent you a tree node...") |
948 elif child.tag == 'map': | |
949 #TODO: Fix map to accepts elements | |
950 self.map.new_data(tostring(child)) | |
951 elif child.tag == 'chat': | |
133 | 952 msg = orpg.chat.chat_msg.chat_msg(tostring(child)) |
124 | 953 self.chat.post_incoming_msg(msg, player) |
954 | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
955 def on_mplay_event(self, evt): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
956 id = evt.get_id() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
957 if id == orpg.networking.mplay_client.MPLAY_CONNECTED: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
958 self.chat.InfoPost("Game connected!") |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
959 self.gs.set_connected(1) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
960 self.password_manager.ClearPassword("ALL") |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
961 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
962 elif id == orpg.networking.mplay_client.MPLAY_DISCONNECTED: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
963 self.poll_timer.Stop() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
964 self.ping_timer.Stop() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
965 self.chat.SystemPost("Game disconnected!") |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
966 self.players.reset() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
967 self.gs.set_connected(0) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
968 self.status.set_connect_status("Not Connected") |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
969 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
970 ####Begin changes for Custom Exit Message by mDuo13###### |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
971 elif id == orpg.networking.mplay_client.MPLAY_DISCONNECTING: |
119 | 972 custom_msg = settings.get("dcmsg") |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
973 custom_msg=custom_msg[:80] |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
974 if custom_msg[:3]=="/me": self.chat.send_chat_message(custom_msg[3:], 3) |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
975 else: self.chat.system_message(custom_msg) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
976 #####End Changes for Custom Exit Message by mDuo13 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
977 |
119 | 978 elif id == orpg.networking.mplay_client.MPLAY_GROUP_CHANGE: |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
979 group = evt.get_data() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
980 self.chat.InfoPost("Moving to room '"+group[1]+"'..") |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
981 if self.gs : self.gs.set_cur_room_text(group[1]) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
982 self.players.reset() |
119 | 983 elif id == orpg.networking.mplay_client.MPLAY_GROUP_CHANGE_F: |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
984 self.chat.SystemPost("Room access denied!") |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
985 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
986 def OnCloseWindow(self, event): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
987 dlg = wx.MessageDialog(self, "Quit OpenRPG?", "OpenRPG", wx.YES_NO) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
988 if dlg.ShowModal() == wx.ID_YES: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
989 dlg.Destroy() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
990 self.closed_confirmed() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
991 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
992 def closed_confirmed(self): |
66 | 993 self.activeplugins = component.get('plugins') |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
994 self.aliaslib.OnMB_FileSave(None) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
995 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
996 #following lines added by mDuo13 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
997 #########plugin_disabled()######### |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
998 for plugin_fname in self.activeplugins.keys(): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
999 plugin = self.activeplugins[plugin_fname] |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
1000 try: plugin.plugin_disabled() |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1001 except Exception, e: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1002 traceback.print_exc() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1003 #end mDuo13 added code |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1004 self.saveLayout() |
71
449a8900f9ac
Code refining almost completed, for this round. Some included files are still in need of some clean up, but this is test worthy.
sirebral
parents:
68
diff
changeset
|
1005 try: settings.save() |
66 | 1006 except Exception: |
1007 logger.general("[WARNING] Error saving 'settings' component", True) | |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
1008 try: self.map.pre_exit_cleanup() |
66 | 1009 except Exception: |
1010 logger.general("[WARNING] Map error pre_exit_cleanup()", True) | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1011 try: |
119 | 1012 save_tree = string.upper(settings.get("SaveGameTreeOnExit")) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1013 if (save_tree != "0") and (save_tree != "False") and (save_tree != "NO"): |
119 | 1014 self.tree.save_tree(settings.get("gametree")) |
66 | 1015 except Exception: |
1016 logger.general("[WARNING] Error saving gametree", True) | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1017 |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
1018 if self.session.get_status() == orpg.networking.mplay_client.MPLAY_CONNECTED: self.kill_mplay_session() |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1019 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1020 try: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1021 #Kill all the damn timers |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1022 self.sound_player.timer.Stop() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1023 del self.sound_player.timer |
66 | 1024 except Exception: |
1025 logger.general("sound didn't die properly.", True) | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1026 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1027 try: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1028 self.poll_timer.Stop() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1029 self.ping_timer.Stop() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1030 self.chat.parent.chat_timer.Stop() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1031 self.map.canvas.zoom_display_timer.Stop() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1032 self.map.canvas.image_timer.Stop() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1033 self.status.timer.Stop() |
14 | 1034 del self.ping_timer; del self.poll_timer; del self.chat.parent.chat_timer |
1035 del self.map.canvas.zoom_display_timer; del self.map.canvas.image_timer; del self.status.timer | |
66 | 1036 except Exception: |
1037 logger.general("some timer didn't die properly.", True) | |
1038 | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1039 self._mgr.UnInit() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1040 mainapp = wx.GetApp() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1041 mainapp.ExitMainLoop() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1042 self.Destroy() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1043 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1044 try: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1045 if self.server_pipe != None: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1046 dlg = wx.ProgressDialog("Exit","Stoping server",2,self) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1047 dlg.Update(2) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1048 dlg.Show(True) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1049 self.server_pipe.write("\nkill\n") |
66 | 1050 logger.general("Killing Server process:", True) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1051 time.sleep(5) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1052 self.server_stop() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1053 self.server_pipe.close() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1054 self.std_out.close() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1055 self.server_thread.exit() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1056 dlg.Destroy() |
66 | 1057 logger.general("Server killed:", True) |
1058 except Exception: | |
1059 pass | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1060 |
98 | 1061 ######################################## |
1062 ## About Dialog class | |
1063 ######################################## | |
1064 class AboutORPG(wx.Frame): | |
151 | 1065 def __init__(self, parent, description=''): |
98 | 1066 super(AboutORPG, self).__init__(parent, -1, "About 'Traipse' OpenRPG") |
1067 icon = None | |
1068 icon = wx.Icon(dir_struct["icon"]+'d20.ico', wx.BITMAP_TYPE_ICO) | |
1069 self.SetIcon( icon ) | |
1070 sizer = wx.GridBagSizer(hgap=1, vgap=1) | |
1071 height = 425; width = 350 | |
1072 self.About = wx.TextCtrl(self, -1, size=wx.DefaultSize, style=wx.TE_MULTILINE | wx.TE_READONLY) | |
1073 img = wx.Image(dir_struct['icon']+'splash.gif', wx.BITMAP_TYPE_ANY).ConvertToBitmap() | |
1074 image = wx.StaticBitmap(self, -1, img, size=wx.DefaultSize) | |
1075 sizer.Add(image, (0,0), flag=wx.ALIGN_CENTER_HORIZONTAL|wx.ALL|wx.ADJUST_MINSIZE) | |
1076 sizer.Add(self.About, (1,0), flag=wx.EXPAND) | |
1077 self.SetSizer(sizer) | |
1078 self.SetAutoLayout(True) | |
1079 self.SetSize((width, height)) | |
1080 sizer.AddGrowableCol(0) | |
1081 sizer.AddGrowableCol(1) | |
1082 sizer.AddGrowableRow(1) | |
1083 self.Bind(wx.EVT_CLOSE, self.Min) | |
1084 self.Min(None) | |
1085 | |
151 | 1086 description += "OpenRPG is a Virtual Game Table that allows users to connect via a network and play table " |
98 | 1087 description += "top games with friends. 'Traipse' is an OpenRPG distro that is easy to setup and provides superb " |
1088 description += "functionality. OpenRPG is originally designed by Chris Davis." | |
1089 | |
1090 license = "OpenRPG is free software; you can redistribute it and/or modify it " | |
1091 license += "under the terms of the GNU General Public License as published by the Free Software Foundation; " | |
1092 license += "either version 2 of the License, or (at your option) any later version.\n\n" | |
1093 license += "OpenRPG and Traipse 'OpenRPG' is distributed in the hope that it will be useful, but WITHOUT ANY " | |
1094 license += "WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. " | |
1095 license += "See the GNU General Public License for more details. You should have received a copy of " | |
1096 license += "the GNU General Public License along with Traipse 'OpenRPG'; if not, write to " | |
1097 license += "the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA \n\n" | |
1098 license += "'Traipse' and the 'Traipse' Logo are trademarks of Mad Mathematics Laboratories." | |
1099 | |
1100 self.About.AppendText(description+'\n\n') | |
1101 self.About.AppendText(license+'\n\n') | |
1102 self.About.AppendText('OpenRPG Developers:\n') | |
1103 orpg_devs = ['Thomas Baleno', 'Andrew Bennett', 'Lex Berezhny', 'Ted Berg', | |
1104 'Bernhard Bergbauer', 'Chris Blocher', 'David Byron', 'Ben Collins-Sussman', 'Robin Cook', 'Greg Copeland', | |
1105 'Chris Davis', 'Michael Edwards', 'Andrew Ettinger', 'Todd Faris', 'Dj Gilcrease', | |
1106 'Christopher Hickman', 'Paul Hosking', 'Brian Manning', 'Scott Mackay', 'Jesse McConnell', | |
195 | 1107 'Brian Osman', 'Rome Reginelli', 'Christopher Rouse', 'Dave Sanders', 'Tyler Starke', 'Mark Tarrabain', |
1108 'David Vrabel'] | |
98 | 1109 for dev in orpg_devs: |
1110 self.About.AppendText(dev+'\n') | |
1111 | |
1112 def Min(self, evt): | |
1113 self.Hide() | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1114 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1115 ######################################## |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1116 ## Application class |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1117 ######################################## |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1118 class orpgSplashScreen(wx.SplashScreen): |
124 | 1119 |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1120 def __init__(self, parent, bitmapfile, duration, callback): |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
1121 wx.SplashScreen.__init__(self, wx.Bitmap(bitmapfile), |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
1122 wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT, duration, None, -1) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1123 self.callback = callback |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1124 self.closing = False |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1125 self.Bind(wx.EVT_CLOSE, self.callback) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1126 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1127 class orpgApp(wx.App): |
124 | 1128 |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1129 def OnInit(self): |
66 | 1130 component.add('log', logger) |
228 | 1131 #component.add('xml', xml) |
71
449a8900f9ac
Code refining almost completed, for this round. Some included files are still in need of some clean up, but this is test worthy.
sirebral
parents:
68
diff
changeset
|
1132 component.add('settings', settings) |
66 | 1133 component.add('validate', validate) |
1134 component.add("tabbedWindows", []) | |
1135 | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1136 self.called = False |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1137 wx.InitAllImageHandlers() |
66 | 1138 self.splash = orpgSplashScreen(None, dir_struct["icon"] + 'splash13.jpg', 3000, self.AfterSplash) |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1139 self.Bind(wx.EVT_KEY_DOWN, self.OnKeyPress) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1140 self._crust = None |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1141 wx.Yield() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1142 return True |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1143 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1144 def OnKeyPress(self, evt): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1145 #Event handler |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
1146 if evt.AltDown() and evt.CmdDown() and evt.KeyCode == ord('I'): self.ShowShell() |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
1147 else: evt.Skip() |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1148 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1149 def ShowShell(self): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1150 #Show the PyCrust window. |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1151 if not self._crust: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1152 self._crust = wx.py.crust.CrustFrame(self.GetTopWindow()) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1153 self._crust.shell.interp.locals['app'] = self |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1154 win = wx.FindWindowAtPointer() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1155 self._crust.shell.interp.locals['win'] = win |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1156 self._crust.Show() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1157 |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1158 def AfterSplash(self,evt): |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1159 if not self.called: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1160 self.splash.Hide() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1161 self.called = True |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1162 self.frame = orpgFrame(None, wx.ID_ANY, MENU_TITLE) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1163 self.frame.Raise() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1164 self.frame.Refresh() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1165 self.frame.Show(True) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1166 self.SetTopWindow(self.frame) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1167 #self.frame.show_dlgs() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1168 self.frame.post_show_init() |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1169 wx.CallAfter(self.splash.Close) |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1170 return True |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1171 |
14 | 1172 def OnExit_CleanUp(self): |
74 | 1173 logger.debug("Preforming cleanup\n") |
19
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
1174 try: del os.environ["OPENRPG_BASE"] |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
1175 except: pass |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
1176 try: os.remove(os.environ["OPENRPG_BASE"] + os.sep + 'orpg' + os.sep + 'dirpath' + os.sep + 'approot.py') |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
1177 except: pass |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
1178 try: os.remove(os.environ["OPENRPG_BASE"] + os.sep + 'orpg' + os.sep + 'dirpath' + os.sep + 'approot.pyc') |
78407d627cba
Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents:
14
diff
changeset
|
1179 except: pass |
14 | 1180 |
1181 def OnExit(self): | |
1182 self.OnExit_CleanUp() | |
5
5a2c95067daf
This update causes the software to remove approot.py and approot.pyc
sirebral
parents:
4
diff
changeset
|
1183 #Exit |
74 | 1184 logger.debug("Main Application Exit\n\n") |