annotate orpg/main.py @ 138:1ed2feab0db9 alpha

Traipse Alpha 'OpenRPG' {091021-00} Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc's main goal is to offer more advanced features and enhance the productivity of the user. Update Summary (Cleaning up for Beta) Added Bookmarks Fix to Remote Admin Commands Minor fix to text based Server Fix to Pretty Print, from Core Fix to Splitter Nodes not being created Fix to massive amounts of images loading, from Core Added 'boot' command to remote admin Added confirmation window for sent nodes Minor changes to allow for portability to an OpenSUSE linux OS Miniatures Layer pop up box allows users to turn off Mini labels, from FlexiRPG Zoom Mouse plugin added Images added to Plugin UI Switching to Element Tree Map efficiency, from FlexiRPG Added Status Bar to Update Manager default_manifest.xml renamed to default_upmana.xml Cleaner clode for saved repositories New TrueDebug Class in orpg_log (See documentation for usage) Mercurial's hgweb folder is ported to upmana Pretty important update that can help remove thousands of dead children from your gametree. Children, <forms />, <group_atts />, <horizontal />, <cols />, <rows />, <height />, etc... are all tags now. Check your gametree and look for dead children!! New Gametree Recursion method, mapping, and context sensitivity. !!Alpha Still- Watch out for infinite loops!! New Syntax added for custom PC sheets Tip of the Day added, from Core and community Fixed Whiteboard ID to prevent random line or text deleting. Appended tr_ to ID's to prevent non updated clients from ruining the fix.
author sirebral
date Sat, 21 Nov 2009 03:19:34 -0600
parents 82c47d583493
children 2ffc5de126c8
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:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
24 # Version:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
25 # $Id: main.py,v 1.153 2008/01/24 03:52:03 digitalxero Exp $
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
14
0b8b7e3ed78d Adding fixes from OpenRPG 1.8.0
sirebral
parents: 7
diff changeset
30 __version__ = "$Id: main.py,v 1.154 2009/07/19 03:52:03 madmathlabs 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
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
36
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
37 import wx.py
133
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
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
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
51
115
17b64e9133e9 Traipse Alpha 'OpenRPG' {091012-00}
sirebral
parents: 98
diff changeset
52 #Update Manager# Un remark if you have Mercurial installed
117
0f18d16f3fe7 Traipse Alpha 'OpenRPG' {091012-02}
sirebral
parents: 116
diff changeset
53 import upmana.updatemana
0f18d16f3fe7 Traipse Alpha 'OpenRPG' {091012-02}
sirebral
parents: 116
diff changeset
54 import upmana.manifest as manifest
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
55
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
56 from orpg.dirpath import dir_struct
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
57 from orpg.dieroller.utils import DiceManager
133
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
58 from orpg.tools.settings import settings
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
59 from orpg.tools.validate import validate
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
60 from orpg.tools.passtool import PassTool
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
61 from orpg.tools.orpg_log import logger, crash, debug
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
62 from orpg.tools.metamenus import MenuBarEx
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
63
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
64 from xml.etree.ElementTree import ElementTree, Element, parse
118
217fb049bd00 Traipse Alpha 'OpenRPG' {091028-00}
sirebral
parents: 117
diff changeset
65 from xml.etree.ElementTree import fromstring, tostring
133
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
66 ## Element Tree usage will require users to convert to and from string data quite often until users of older versions update.
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
67 ## This is a problem that users of older versions will need to cross as it is both Core and Traipse that will make the change.
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
68 ## Older versions have a problem with correct XML.
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
69 from orpg.orpg_xml import xml #to be replaced by etree
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
70
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
71
0
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 ## Main Frame
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
74 ####################################
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
75
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
76
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
77 class orpgFrame(wx.Frame):
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
78
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
79 def __init__(self, parent, id, title):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
80 wx.Frame.__init__(self, parent, id, title, wx.Point(100, 100), wx.Size(600,420), style=wx.DEFAULT_FRAME_STYLE)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
81 self.validate = component.get("validate")
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
82 logger.debug("Enter orpgFrame")
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
83 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
84 self._mgr = AUI.AuiManager(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
85
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
86 # Determine which icon format to use
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
87 icon = None
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
88 if wx.Platform == '__WXMSW__': icon = wx.Icon(dir_struct["icon"]+'d20.ico', wx.BITMAP_TYPE_ICO)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
89 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
90 self.SetIcon( icon )
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
91
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
92 # create session
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
93 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
94 "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
95 "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
96 "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
97 "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
98 "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
99 "orpgFrame":self}
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
100 self.settings = component.get('settings') #Arbitrary until settings updated with Core.
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
101 self.session = orpg.networking.mplay_client.mplay_client(self.settings.get("player"), call_backs)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
102 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
103 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
104 self.poll_timer.Start(100)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
105 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
106 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
107
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
108 # create roller manager
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
109 self.DiceManager = DiceManager(settings.get("dieroller"))
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
110 component.add('DiceManager', self.DiceManager)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
111
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
112 #create password manager --SD 8/03
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
113 self.password_manager = component.get('password_manager')
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
114 component.add("session", self.session)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
115 component.add('frame', self)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
116
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
117 # build frame windows
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
118 self.build_menu()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
119 self.build_gui()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
120 self.build_hotkeys()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
121
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
122 logger.debug("GUI Built")
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
123 component.add("chat",self.chat)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
124 component.add("map",self.map)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
125 component.add("alias", self.aliaslib)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
126
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
127 logger.debug("openrpg components all added")
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
128 self.tree.load_tree(settings.get("gametree"))
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
129 logger.debug("Tree Loaded")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
130 self.players.size_cols()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
131
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
132 #Load the Plugins This has to be after the chat component has been added
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
133 component.add('pluginmenu', self.pluginMenu)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
134 self.pluginsFrame.Start()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
135 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
136 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
137
138
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
138 tipotday_start = settings.get('tipotday_start')
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
139 try: tipotday_start = int(tipotday_start)
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
140 except TypeError: tipotday_start = 0
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
141
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
142
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
143 self.TipOfTheDay = wx.CreateFileTipProvider(dir_struct['data']+'tips.txt', tipotday_start)
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
144
116
d078a8cdc1e4 Traipse Alpha 'OpenRPG' {091012-01}
sirebral
parents: 115
diff changeset
145 #Load Update Manager
d078a8cdc1e4 Traipse Alpha 'OpenRPG' {091012-01}
sirebral
parents: 115
diff changeset
146 component.add('updatemana', self.updateMana)
d078a8cdc1e4 Traipse Alpha 'OpenRPG' {091012-01}
sirebral
parents: 115
diff changeset
147 logger.debug("update manager reloaded")
d078a8cdc1e4 Traipse Alpha 'OpenRPG' {091012-01}
sirebral
parents: 115
diff changeset
148 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
149
115
17b64e9133e9 Traipse Alpha 'OpenRPG' {091012-00}
sirebral
parents: 98
diff changeset
150 #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
151 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
152 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
153 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
154
138
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
155 def ShowTipOfTheDay(self):
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
156 if wx.ShowTip(self, self.TipOfTheDay, settings.get('tipotday_enabled') != '0'):
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
157 settings.change('tipotday_enabled', '1')
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
158 else: settings.change('tipotday_enabled', '0')
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
159 settings.change('tipotday_start', str(self.TipOfTheDay.CurrentTip))
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
160
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
161 def post_show_init(self):
138
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
162 """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
163 self.players.size_cols()
138
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
164 try:
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
165 if settings.get('tipotday_enabled').lower() != '0': self.ShowTipOfTheDay()
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
166 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
167
138
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
168
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
169 def add_setting(self, setting):
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
170 if setting == 'Tip of the Day':
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
171 settings.add_tab('General', 'Tip of the Day', 'grid')
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
172 settings.add('Tip of the Day', 'tipotday_start', '0', 'int', 'Current Tip of the Day')
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
173 settings.add('Tip of the Day', 'tipotday_enabled', '1', '0|1', 'Show Tip of the Day on startup')
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
174 logger.info('New Settings added', True)
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
175 self.TraipseSuiteWarn('debug')
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
176
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
177 def get_activeplugins(self):
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
178 try: tmp = self.pluginsFrame.get_activeplugins()
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
179 except: tmp = {}
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
180 return tmp
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
181
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
182 def get_startplugins(self):
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
183 try: tmp = self.pluginsFrame.get_startplugins()
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
184 except: tmp = {}
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
185 return tmp
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
186
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
187 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
188 try:
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
189 msg = ["DEBUG: password response= ",
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
190 str(signal),
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
191 " (T:",
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
192 str(type),
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
193 " #",
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
194 str(id),
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
195 ")"]
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
196 logger.debug("".join(msg))
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
197 id = int(id)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
198 type = str(type)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
199 data = str(data)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
200 signal = str(signal)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
201 if signal == "fail":
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
202 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
203 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
204 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
205 else: pass
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
206 except: traceback.print_exc()
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
207
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
208
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
209 def build_menu(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
210 menu = \
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
211 [[
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
212 ['&OpenRPG'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
213 [' &Settings\tCtrl-S'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
214 [' -'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
215 [' Tab Styles'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
216 [' Slanted'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
217 [' Colorful', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
218 [' Black and White', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
219 [' Aqua', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
220 [' Custom', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
221 [' Flat'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
222 [' Black and White', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
223 [' Aqua', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
224 [' Custom', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
225 [' NewMap'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
226 [' -'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
227 [' &Exit']
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
228 ],
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 ['&Game Server'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
231 [' &Browse Servers\tCtrl-B'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
232 [' -'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
233 [' Server Heartbeat', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
234 [' -'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
235 [' &Start Server']
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
236 ],
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 ['&Tools'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
239 [' Logging Level'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
240 [' Debug', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
241 [' Note', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
242 [' Info', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
243 [' General', "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 [' Password Manager', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
246 [' -'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
247 [' Sound Toolbar', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
248 [' Dice Bar\tCtrl-D', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
249 [' Map Bar', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
250 [' Status Bar\tCtrl-T', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
251 ],
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 ['&Help'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
254 [' &About'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
255 [' Online User Guide'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
256 [' Change Log'],
138
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
257 [' Report a Bug'],
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
258 [' Tip of the Day']
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
259 ]]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
260
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
261 self.mainmenu = MenuBarEx(self, menu)
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
262 if settings.get('Heartbeat') == '1':
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
263 self.mainmenu.SetMenuState("GameServerServerHeartbeat", True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
264
133
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
265 self.mainmenu.SetMenuState('ToolsPasswordManager', True if settings.get('PWMannager') == 'On' else False)
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
266 tabtheme = settings.get('TabTheme') #This change is stable. TaS.
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
267 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedColorful", tabtheme == 'slanted&colorful')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
268 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
269 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
270 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
271 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
272 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedCustom", tabtheme == 'customslant')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
273 self.mainmenu.SetMenuState("OpenRPGTabStylesFlatCustom", tabtheme == 'customflat')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
274
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
275 lvl = int(settings.get('LoggingLevel'))
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
276 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
277 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
278 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
279 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
280
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
281 self.pluginMenu = wx.Menu()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
282 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
283 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
284
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
285 self.pluginMenu.AppendItem(item)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
286 self.pluginMenu.AppendSeparator()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
287 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
288
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
289 # 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
290 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
291 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
292
133
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
293 #Update Manager
116
d078a8cdc1e4 Traipse Alpha 'OpenRPG' {091012-01}
sirebral
parents: 115
diff changeset
294 mana = wx.MenuItem(self.traipseSuite, wx.ID_ANY, "Update Manager", "Update Manager")
d078a8cdc1e4 Traipse Alpha 'OpenRPG' {091012-01}
sirebral
parents: 115
diff changeset
295 self.Bind(wx.EVT_MENU, self.OnMB_UpdateManagerPanel, mana)
d078a8cdc1e4 Traipse Alpha 'OpenRPG' {091012-01}
sirebral
parents: 115
diff changeset
296 self.traipseSuite.AppendItem(mana)
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
297
86
bdbeafcb2ef4 Traipse Alpha 'OpenRPG' {090917-00}
sirebral
parents: 79
diff changeset
298 self.debugConsole = wx.MenuItem(self.traipseSuite, -1, "Debug Console", "Debug Console")
bdbeafcb2ef4 Traipse Alpha 'OpenRPG' {090917-00}
sirebral
parents: 79
diff changeset
299 self.Bind(wx.EVT_MENU, self.OnMB_DebugConsole, self.debugConsole)
bdbeafcb2ef4 Traipse Alpha 'OpenRPG' {090917-00}
sirebral
parents: 79
diff changeset
300 self.traipseSuite.AppendItem(self.debugConsole)
95
af6bf998f425 Traipse Alpha 'OpenRPG' {090919-00}
sirebral
parents: 90
diff changeset
301
af6bf998f425 Traipse Alpha 'OpenRPG' {090919-00}
sirebral
parents: 90
diff changeset
302 def TraipseSuiteWarn(self, menuitem):
af6bf998f425 Traipse Alpha 'OpenRPG' {090919-00}
sirebral
parents: 90
diff changeset
303 ### Beta ### Allows for the reuse of the 'Attention' menu.
af6bf998f425 Traipse Alpha 'OpenRPG' {090919-00}
sirebral
parents: 90
diff changeset
304 ### component.get('frame').TraipseSuiteWarn('item') ### Portable
134
82c47d583493 Traipse Alpha 'OpenRPG' {091010-01}
sirebral
parents: 133
diff changeset
305 self.mainmenu.Remove(8)
82c47d583493 Traipse Alpha 'OpenRPG' {091010-01}
sirebral
parents: 133
diff changeset
306 self.mainmenu.Insert(8, self.traipseSuite, "&Traipse Suite!")
82c47d583493 Traipse Alpha 'OpenRPG' {091010-01}
sirebral
parents: 133
diff changeset
307 #self.mainmenu.Replace(8, self.traipseSuite, '&Traipse Suite!')
95
af6bf998f425 Traipse Alpha 'OpenRPG' {090919-00}
sirebral
parents: 90
diff changeset
308 if menuitem == 'debug':
96
65c1604e7949 Traipse Alpha 'OpenRPG' {090924-00}
sirebral
parents: 95
diff changeset
309 if self.debugger.IsShown() == True:
65c1604e7949 Traipse Alpha 'OpenRPG' {090924-00}
sirebral
parents: 95
diff changeset
310 self.mainmenu.Replace(8, self.traipseSuite, '&Traipse Suite')
65c1604e7949 Traipse Alpha 'OpenRPG' {090924-00}
sirebral
parents: 95
diff changeset
311 else:
65c1604e7949 Traipse Alpha 'OpenRPG' {090924-00}
sirebral
parents: 95
diff changeset
312 self.debugConsole.SetBitmap(wx.Bitmap(dir_struct["icon"] + 'spotlight.png'))
65c1604e7949 Traipse Alpha 'OpenRPG' {090924-00}
sirebral
parents: 95
diff changeset
313 self.traipseSuite.RemoveItem(self.debugConsole)
65c1604e7949 Traipse Alpha 'OpenRPG' {090924-00}
sirebral
parents: 95
diff changeset
314 self.traipseSuite.AppendItem(self.debugConsole)
65c1604e7949 Traipse Alpha 'OpenRPG' {090924-00}
sirebral
parents: 95
diff changeset
315
65c1604e7949 Traipse Alpha 'OpenRPG' {090924-00}
sirebral
parents: 95
diff changeset
316 def TraipseSuiteWarnCleanup(self, menuitem):
65c1604e7949 Traipse Alpha 'OpenRPG' {090924-00}
sirebral
parents: 95
diff changeset
317 ### Beta ### Allows for portable cleanup of the 'Attention' menu.
65c1604e7949 Traipse Alpha 'OpenRPG' {090924-00}
sirebral
parents: 95
diff changeset
318 ### component.get('frame').TraipseSuiteWarnCleanup('item') ### Portable
134
82c47d583493 Traipse Alpha 'OpenRPG' {091010-01}
sirebral
parents: 133
diff changeset
319 self.mainmenu.Remove(8)
82c47d583493 Traipse Alpha 'OpenRPG' {091010-01}
sirebral
parents: 133
diff changeset
320 self.mainmenu.Insert(8, self.traipseSuite, "&Traipse Suite")
82c47d583493 Traipse Alpha 'OpenRPG' {091010-01}
sirebral
parents: 133
diff changeset
321 #self.mainmenu.Replace(8, self.traipseSuite, '&Traipse Suite')
96
65c1604e7949 Traipse Alpha 'OpenRPG' {090924-00}
sirebral
parents: 95
diff changeset
322 if menuitem == 'debug':
95
af6bf998f425 Traipse Alpha 'OpenRPG' {090919-00}
sirebral
parents: 90
diff changeset
323 self.traipseSuite.RemoveItem(self.debugConsole)
96
65c1604e7949 Traipse Alpha 'OpenRPG' {090924-00}
sirebral
parents: 95
diff changeset
324 self.debugConsole.SetBitmap(wx.Bitmap(dir_struct["icon"] + 'clear.gif'))
95
af6bf998f425 Traipse Alpha 'OpenRPG' {090919-00}
sirebral
parents: 90
diff changeset
325 self.traipseSuite.AppendItem(self.debugConsole)
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
326
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
327
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
328 #################################
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
329 ## All Menu Events
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
330 #################################
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
331 #Tab Styles Menus
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
332
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
333 def SetTabStyles(self, *args, **kwargs):
26
65c5cb9be59c This patch fixes the known issue with users not being able to set their name
sirebral
parents: 19
diff changeset
334
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
335 tabtheme = settings.get('TabTheme') #This change is stable. TaS.
26
65c5cb9be59c This patch fixes the known issue with users not being able to set their name
sirebral
parents: 19
diff changeset
336 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedColorful", tabtheme == 'slanted&colorful')
65c5cb9be59c This patch fixes the known issue with users not being able to set their name
sirebral
parents: 19
diff changeset
337 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
338 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
339 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
340 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
341 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
342 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
343
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
344 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
345 else:
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
346 try: newstyle = args[1]
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
347 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
348 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
349 else:
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
350 try: menu = args[0]
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
351 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
352
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
353 if kwargs.has_key('graidentTo'): graidentTo = kwargs['graidentTo']
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
354 else: graidentTo = None
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
355 if kwargs.has_key('graidentFrom'): graidentFrom = kwargs['graidentFrom']
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
356 else: graidentFrom = None
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
357 if kwargs.has_key('textColor'): textColor = kwargs['textColor']
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
358 else: textColor = None
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 current tabbed window list and remove those that have been closed
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
361 tabbedwindows = component.get("tabbedWindows")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
362 new = []
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
363 for wnd in tabbedwindows:
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
364 try: style = wnd.GetWindowStyleFlag(); new.append(wnd)
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
365 except: pass
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
366 tabbedwindows = new
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
367 component.add("tabbedWindows", tabbedwindows)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
368
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
369 #Run though the new list and set the proper styles
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
370 tabbg = settings.get('TabBackgroundGradient')
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
371 (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
372
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
373 for wnd in tabbedwindows:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
374 style = wnd.GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
375 # remove old tabs style
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
376 mirror = ~(FNB.FNB_VC71 | FNB.FNB_VC8 | FNB.FNB_FANCY_TABS | FNB.FNB_COLORFUL_TABS)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
377 style &= mirror
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
378 style |= newstyle
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
379 wnd.SetWindowStyleFlag(style)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
380 wnd.SetTabAreaColour(wx.Color(red, green, blue))
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
381 if graidentTo != None: wnd.SetGradientColourTo(graidentTo)
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
382 if graidentFrom != None: wnd.SetGradientColourFrom(graidentFrom)
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
383 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
384 wnd.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
385
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
386
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
387 def OnMB_OpenRPGNewMap(self):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
388 pass #Not Implemented yet!
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
389
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
390
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
391 def OnMB_OpenRPGTabStylesSlantedColorful(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
392 if self.mainmenu.GetMenuState("OpenRPGTabStylesSlantedColorful"):
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
393 settings.change('TabTheme', 'slanted&colorful')
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
394 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
395 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
396
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
397
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
398 def OnMB_OpenRPGTabStylesSlantedBlackandWhite(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
399 if self.mainmenu.GetMenuState("OpenRPGTabStylesSlantedBlackandWhite"):
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
400 settings.change('TabTheme', 'slanted&bw')
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
401 self.SetTabStyles("OpenRPGTabStylesSlantedBlackandWhite",
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
402 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
403 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
404
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
405
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
406 def OnMB_OpenRPGTabStylesSlantedAqua(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
407 if self.mainmenu.GetMenuState("OpenRPGTabStylesSlantedAqua"):
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
408 settings.change('TabTheme', 'slanted&aqua')
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
409 self.SetTabStyles("OpenRPGTabStylesSlantedAqua", FNB.FNB_VC8,
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
410 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
411 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
412
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
413
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
414 def OnMB_OpenRPGTabStylesSlantedCustom(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
415 if self.mainmenu.GetMenuState("OpenRPGTabStylesSlantedCustom"):
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
416 settings.change('TabTheme', 'customslant')
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
417 gfrom = settings.get('TabGradientFrom')
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
418 (fred, fgreen, fblue) = self.rgb.rgb_tuple(gfrom)
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
419 gto = settings.get('TabGradientTo')
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
420 (tored, togreen, toblue) = self.rgb.rgb_tuple(gto)
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
421 tabtext = settings.get('TabTextColor')
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
422 (tred, tgreen, tblue) = self.rgb.rgb_tuple(tabtext)
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
423 tabbg = settings.get('TabBackgroundGradient')
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
424 (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
425 self.SetTabStyles("OpenRPGTabStylesSlantedCustom", FNB.FNB_VC8,
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
426 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
427 textColor=wx.Color(tred, tgreen, tblue))
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
428 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
429
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
430
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
431 def OnMB_OpenRPGTabStylesFlatBlackandWhite(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
432 if self.mainmenu.GetMenuState("OpenRPGTabStylesFlatBlackandWhite"):
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
433 settings.change('TabTheme', 'flat&bw')
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
434 self.SetTabStyles("OpenRPGTabStylesFlatBlackandWhite", FNB.FNB_FANCY_TABS,
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
435 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
436 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
437
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
438
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
439 def OnMB_OpenRPGTabStylesFlatAqua(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
440 if self.mainmenu.GetMenuState("OpenRPGTabStylesFlatAqua"):
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
441 settings.change('TabTheme', 'flat&aqua')
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
442 self.SetTabStyles("OpenRPGTabStylesFlatAqua", FNB.FNB_FANCY_TABS,
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
443 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
444 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
445
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
446
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
447 def OnMB_OpenRPGTabStylesFlatCustom(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
448 if self.mainmenu.GetMenuState("OpenRPGTabStylesFlatCustom"):
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
449 settings.change('TabTheme', 'customflat')
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
450 gfrom = settings.get('TabGradientFrom')
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
451 (fred, fgreen, fblue) = self.rgb.rgb_tuple(gfrom)
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
452 gto = settings.get('TabGradientTo')
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
453 (tored, togreen, toblue) = self.rgb.rgb_tuple(gto)
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
454 tabtext = settings.get('TabTextColor')
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
455 (tred, tgreen, tblue) = self.rgb.rgb_tuple(tabtext)
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
456 tabbg = settings.get('TabBackgroundGradient')
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
457 (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
458 self.SetTabStyles("OpenRPGTabStylesFlatCustom", FNB.FNB_FANCY_TABS,
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
459 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
460 textColor=wx.Color(tred, tgreen, tblue))
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
461 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
462
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
463 #Window Menu
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
464
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
465 def OnMB_WindowsMenu(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
466 menuid = event.GetId()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
467 name = self.mainwindows[menuid]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
468 if name == 'Alias Lib':
60
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
469 if self.aliaslib.IsShown(): self.aliaslib.Hide()
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
470 else: self.aliaslib.Show()
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
471 else:
60
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
472 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
473 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
474 self._mgr.Update()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
475
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
476 #OpenRPG Menu
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
477
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
478 def OnMB_OpenRPGSettings(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
479 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
480 dlg.Centre()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
481 dlg.ShowModal()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
482
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
483 def OnMB_OpenRPGExit(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
484 self.OnCloseWindow(0)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
485
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
486 #Game Server Menu
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
487
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
488 def OnMB_GameServerBrowseServers(self):
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
489 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
490 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
491 self._mgr.Update()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
492
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
493
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
494 def OnMB_GameServerServerHeartbeat(self):
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
495 if self.mainmenu.GetMenuState("GameServerServerHeartbeat"): settings.change('Heartbeat', '1')
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
496 else: settings.change('Heartbeat', '0')
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
497
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
498
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
499 def OnMB_GameServerStartServer(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
500 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
501 # 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
502 start_dialog.Update( 0 )
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
503 # 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
504 # as per reported bug 586227
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
505 if wx.Platform == "__WXMSW__":
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
506 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
507 args = ( sys.executable, arg )
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
508 else:
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
509 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
510 args = (arg,arg)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
511 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
512 start_dialog.Update( 1 )
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
513 start_dialog.Show(False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
514 start_dialog.Destroy()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
515
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
516 # Tools Menu
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
517
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
518 def OnMB_PluginControlPanel(self, evt):
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
519 if self.pluginsFrame.IsShown() == True: self.pluginsFrame.Hide()
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
520 else: self.pluginsFrame.Show()
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
521
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
522
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
523 def OnMB_UpdateManagerPanel(self, evt):
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
524 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
525 else: self.updateMana.Show()
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
526
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
527
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
528 def OnMB_DebugConsole(self, evt):
96
65c1604e7949 Traipse Alpha 'OpenRPG' {090924-00}
sirebral
parents: 95
diff changeset
529 self.TraipseSuiteWarnCleanup('debug') ### Beta ###
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
530 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
531 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
532
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
533
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
534 def OnMB_ToolsLoggingLevelDebug(self):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
535 lvl = logger.log_level
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
536 if self.mainmenu.GetMenuState("ToolsLoggingLevelDebug"): lvl |= ORPG_DEBUG
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
537 else: lvl &= ~ORPG_DEBUG
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
538 logger.log_level = lvl
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
539 settings.set('LoggingLevel', lvl)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
540
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
541
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
542 def OnMB_ToolsLoggingLevelNote(self):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
543 lvl = logger.log_level
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
544 if self.mainmenu.GetMenuState("ToolsLoggingLevelNote"): lvl |= ORPG_DEBUG
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
545 else: lvl &= ~ORPG_DEBUG
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
546 logger.log_level = lvl
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
547 settings.set('LoggingLevel', lvl)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
548
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
549
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
550 def OnMB_ToolsLoggingLevelInfo(self):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
551 lvl = logger.log_level
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
552 if self.mainmenu.GetMenuState("ToolsLoggingLevelInfo"): lvl |= ORPG_INFO
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
553 else: lvl &= ~ORPG_INFO
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
554 logger.log_level = lvl
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
555 settings.set('LoggingLevel', lvl)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
556
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
557
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
558 def OnMB_ToolsLoggingLevelGeneral(self):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
559 lvl = logger.log_level
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
560 if self.mainmenu.GetMenuState("ToolsLoggingLevelGeneral"): lvl |= ORPG_GENERAL
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
561 else: lvl &= ~ORPG_GENERAL
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
562 logger.log_level = lvl
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
563 settings.set('LoggingLevel', lvl)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
564
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
565
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
566 def OnMB_ToolsPasswordManager(self):
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
567 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
568 else: self.password_manager.Disable()
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
569
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
570
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
571 def OnMB_ToolsStatusBar(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
572 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
573 self.mainmenu.SetMenuState("ToolsStatusBar", False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
574 self._mgr.GetPane("Status Window").Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
575 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
576 self.mainmenu.SetMenuState("ToolsStatusBar", True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
577 self._mgr.GetPane("Status Window").Show()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
578 self._mgr.Update()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
579
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
580
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
581 def OnMB_ToolsSoundToolbar(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
582 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
583 self.mainmenu.SetMenuState("ToolsSoundToolbar", False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
584 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
585 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
586 self.mainmenu.SetMenuState("ToolsSoundToolbar", True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
587 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
588 self._mgr.Update()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
589
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
590
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
591 def OnMB_ToolsDiceBar(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
592 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
593 self.mainmenu.SetMenuState("ToolsDiceBar", False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
594 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
595 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
596 self.mainmenu.SetMenuState("ToolsDiceBar", True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
597 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
598 self._mgr.Update()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
599
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
600
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
601 def OnMB_ToolsMapBar(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
602 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
603 self.mainmenu.SetMenuState("ToolsMapBar", False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
604 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
605 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
606 self.mainmenu.SetMenuState("ToolsMapBar", True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
607 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
608 self._mgr.Update()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
609
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
610 #Help Menu #Needs a custom Dialog because it is ugly on Windows
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
611
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
612 def OnMB_HelpAbout(self):
98
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
613 if self.AboutORPG.IsShown() == True: self.AboutORPG.Hide()
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
614 else: self.AboutORPG.Show()
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
615
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
616
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
617 def OnMB_HelpOnlineUserGuide(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
618 wb = webbrowser.get()
96
65c1604e7949 Traipse Alpha 'OpenRPG' {090924-00}
sirebral
parents: 95
diff changeset
619 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
620
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
621
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
622 def OnMB_HelpChangeLog(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
623 wb = webbrowser.get()
96
65c1604e7949 Traipse Alpha 'OpenRPG' {090924-00}
sirebral
parents: 95
diff changeset
624 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
625
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
626
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
627 def OnMB_HelpReportaBug(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
628 wb = webbrowser.get()
4
c0da99091e1d Check out the new About Dialog.
sirebral
parents: 0
diff changeset
629 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
630
138
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
631 def OnMB_HelpTipoftheDay(self):
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
632 self.ShowTipOfTheDay()
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
633
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
634
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
635 #################################
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
636 ## Build the GUI
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
637 #################################
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
638
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
639 def build_gui(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
640 self.Freeze()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
641 self.validate.config_file("layout.xml","default_layout.xml")
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
642
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
643 layout = parse(dir_struct["user"] + "layout.xml")
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
644 xml_dom = layout.getroot()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
645
60
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
646 self.windowsmenu = wx.Menu()
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
647 self.mainwindows = {}
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
648
98
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
649 # About Window
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
650 self.AboutORPG = AboutORPG(self)
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
651
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
652 #Plugins Window
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
653 self.pluginsFrame = pluginUI.PluginFrame(self)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
654 component.add("plugins", self.get_activeplugins())
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
655 component.add("startplugs", self.get_startplugins())
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
656 logger.debug("Menu Created")
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
657 h = int(xml_dom.get("height"))
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
658 w = int(xml_dom.get("width"))
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
659 posx = int(xml_dom.get("posx"))
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
660 posy = int(xml_dom.get("posy"))
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
661 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
662 self.SetDimensions(posx, posy, w, h)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
663 logger.debug("Dimensions Set")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
664
116
d078a8cdc1e4 Traipse Alpha 'OpenRPG' {091012-01}
sirebral
parents: 115
diff changeset
665 # Update Manager
d078a8cdc1e4 Traipse Alpha 'OpenRPG' {091012-01}
sirebral
parents: 115
diff changeset
666 self.manifest = manifest.ManifestChanges()
d078a8cdc1e4 Traipse Alpha 'OpenRPG' {091012-01}
sirebral
parents: 115
diff changeset
667 self.updateMana = upmana.updatemana.updaterFrame(self,
d078a8cdc1e4 Traipse Alpha 'OpenRPG' {091012-01}
sirebral
parents: 115
diff changeset
668 "OpenRPG Update Manager Beta 0.8", component, self.manifest, True)
d078a8cdc1e4 Traipse Alpha 'OpenRPG' {091012-01}
sirebral
parents: 115
diff changeset
669 logger.debug("Menu Created")
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
670 h = int(xml_dom.get("height"))
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
671 w = int(xml_dom.get("width"))
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
672 posx = int(xml_dom.get("posx"))
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
673 posy = int(xml_dom.get("posy"))
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
674 maximized = int(xml_dom.get("maximized"))
116
d078a8cdc1e4 Traipse Alpha 'OpenRPG' {091012-01}
sirebral
parents: 115
diff changeset
675 self.SetDimensions(posx, posy, w, h)
d078a8cdc1e4 Traipse Alpha 'OpenRPG' {091012-01}
sirebral
parents: 115
diff changeset
676 logger.debug("Dimensions Set")
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
677
98
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
678 # 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
679 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
680 logger.debug("Menu Created")
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
681 h = int(xml_dom.get("height"))
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
682 w = int(xml_dom.get("width"))
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
683 posx = int(xml_dom.get("posx"))
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
684 posy = int(xml_dom.get("posy"))
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
685 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
686 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
687 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
688
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
689 # Sound Manager
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
690 self.sound_player = orpg.tools.orpg_sound.orpgSound(self)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
691 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
692 wndinfo = AUI.AuiPaneInfo()
60
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
693 menuid = wx.NewId()
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
694 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
695 wndinfo.DestroyOnClose(False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
696 wndinfo.Name("Sound Control Toolbar")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
697 wndinfo.Caption("Sound Control Toolbar")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
698 wndinfo.Float()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
699 wndinfo.ToolbarPane()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
700 wndinfo.Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
701 self._mgr.AddPane(self.sound_player, wndinfo)
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
702 children = xml_dom.getchildren()
59
5aff3ef1ae46 New dev branch for Ornery Orc. Adds CSS styling to chat messages. Updates
sirebral
parents: 54
diff changeset
703 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
704
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
705 # status window
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
706 self.status = status_bar(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
707 wndinfo = AUI.AuiPaneInfo()
60
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
708 menuid = wx.NewId()
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
709 self.mainwindows[menuid] = "Status Window"
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
710 wndinfo.DestroyOnClose(False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
711 wndinfo.Name("Status Window")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
712 wndinfo.Caption("Status Window")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
713 wndinfo.Float()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
714 wndinfo.ToolbarPane()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
715 wndinfo.Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
716 self._mgr.AddPane(self.status, wndinfo)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
717 logger.debug("Status Window Created")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
718
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
719 # Create and show the floating dice toolbar
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
720 self.dieToolBar = orpg.tools.toolBars.DiceToolBar(self, callBack = self.chat.ParsePost)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
721 wndinfo = AUI.AuiPaneInfo()
60
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
722 menuid = wx.NewId()
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
723 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
724 wndinfo.DestroyOnClose(False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
725 wndinfo.Name("Dice Tool Bar")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
726 wndinfo.Caption("Dice Tool Bar")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
727 wndinfo.Float()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
728 wndinfo.ToolbarPane()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
729 wndinfo.Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
730 self._mgr.AddPane(self.dieToolBar, wndinfo)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
731 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
732
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
733 #Create the Map tool bar
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
734 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
735 wndinfo = AUI.AuiPaneInfo()
60
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
736 menuid = wx.NewId()
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
737 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
738 wndinfo.DestroyOnClose(False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
739 wndinfo.Name("Map Tool Bar")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
740 wndinfo.Caption("Map Tool Bar")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
741 wndinfo.Float()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
742 wndinfo.ToolbarPane()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
743 wndinfo.Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
744 self._mgr.AddPane(self.mapToolBar, wndinfo)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
745 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
746
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
747 #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
748 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
749 wndinfo = AUI.AuiPaneInfo()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
750 wndinfo.DestroyOnClose(False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
751 wndinfo.Name("Browse Server Window")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
752 wndinfo.Caption("Game Server")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
753 wndinfo.Float()
90
d1aff41c031b Traipse Alpha 'OpenRPG' {090919-00}
sirebral
parents: 86
diff changeset
754 wndinfo.FloatingPosition((50,50))
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
755 wndinfo.Dockable(False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
756 wndinfo.MinSize(wx.Size(640,480))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
757 wndinfo.Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
758 self._mgr.AddPane(self.gs, wndinfo)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
759 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
760
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
761 #Create the Alias Lib Window
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
762 self.aliaslib = orpg.tools.aliaslib.AliasLib()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
763 self.aliaslib.Hide()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
764 logger.debug("Alias Window Created")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
765 menuid = wx.NewId()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
766 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
767 self.windowsmenu.Check(menuid, False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
768 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
769 self.mainwindows[menuid] = "Alias Lib"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
770 self.mainmenu.Insert(3, self.windowsmenu, 'Windows')
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
771 logger.debug("Windows Menu Done")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
772 self._mgr.Update()
59
5aff3ef1ae46 New dev branch for Ornery Orc. Adds CSS styling to chat messages. Updates
sirebral
parents: 54
diff changeset
773 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
774 else: self.Bind(AUI.EVT_AUI_PANECLOSE, self.onPaneClose)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
775 logger.debug("AUI Bindings Done")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
776
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
777 #Load the layout if one exists
133
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
778 layout = xml_dom.find("DockLayout")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
779 try:
133
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
780 self._mgr.LoadPerspective(layout.text)
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
781 except: pass
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
782 logger.debug("Perspective Loaded")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
783 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
784 self._mgr.Update()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
785 self.Maximize(maximized)
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
786 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
787 self.Thaw()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
788
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
789
138
1ed2feab0db9 Traipse Alpha 'OpenRPG' {091021-00}
sirebral
parents: 134
diff changeset
790 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
791 # if container window loop through childern and do a recursive call
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
792 temp_wnd = orpgTabberWnd(parent_wnd, style=FNB.FNB_ALLOW_FOREIGN_DND)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
793
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
794 children = xml_dom.getchildren()
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
795 for c in children:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
796 wnd = self.build_window(c,temp_wnd)
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
797 name = c.get("name")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
798 temp_wnd.AddPage(wnd, name, False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
799 return temp_wnd
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
800
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
801
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
802 def build_window(self, xml_dom, parent_wnd):
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
803 name = xml_dom.tag
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
804 if name == "DockLayout" or name == "dock": return
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
805 dirc = xml_dom.get("direction") #should NOT use dir, it is a built in function.
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
806 pos = xml_dom.get("pos")
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
807 height = xml_dom.get("height")
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
808 width = xml_dom.get("width")
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
809 cap = xml_dom.get("caption")
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
810 dockable = xml_dom.get("dockable")
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
811 layer = xml_dom.get("layer")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
812
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
813 try: layer = int(layer); dockable = int(dockable)
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
814 except: layer = 0; dockable = 1
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
815
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
816 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
817 elif name == "map":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
818 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
819 self.map = temp_wnd
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
820 elif name == "tree":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
821 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
822 self.tree = temp_wnd
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
823 if settings.get('ColorTree') == '1':
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
824 self.tree.SetBackgroundColour(settings.get('bgcolor'))
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
825 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
826 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
827 self.tree.SetBackgroundColour('white')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
828 self.tree.SetForegroundColour('black')
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 elif name == "chat":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
831 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
832 self.chattabs = temp_wnd
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
833 self.chat = temp_wnd.MainChatPanel
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
834
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
835 elif name == "player":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
836 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
837 self.players = temp_wnd
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
838 if settings.get('ColorTree') == '1':
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
839 self.players.SetBackgroundColour(settings.get('bgcolor'))
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
840 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
841 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
842 self.players.SetBackgroundColour('white')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
843 self.players.SetForegroundColour('black')
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
844
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
845 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
846 menuid = wx.NewId()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
847 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
848 self.windowsmenu.Check(menuid, True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
849 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
850 self.mainwindows[menuid] = cap
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
851 wndinfo = AUI.AuiPaneInfo()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
852 wndinfo.DestroyOnClose(False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
853 wndinfo.Name(cap)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
854 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
855 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
856 wndinfo.Layer(int(layer))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
857 wndinfo.Caption(cap)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
858
14
0b8b7e3ed78d Adding fixes from OpenRPG 1.8.0
sirebral
parents: 7
diff changeset
859 # Lambda here should work! (future dev)
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
860 if dirc.lower() == 'top': wndinfo.Top()
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
861 elif dirc.lower() == 'bottom': wndinfo.Bottom()
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
862 elif dirc.lower() == 'left': wndinfo.Left()
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
863 elif dirc.lower() == 'right': wndinfo.Right()
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
864 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
865
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
866 if dockable != 1:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
867 wndinfo.Dockable(False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
868 wndinfo.Floatable(False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
869 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
870 wndinfo.Position(int(pos))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
871 wndinfo.Show()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
872 self._mgr.AddPane(temp_wnd, wndinfo)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
873 return temp_wnd
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
874
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
875
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
876 def onPaneClose(self, evt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
877 pane = evt.GetPane()
60
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
878 #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
879 #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
880 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
881 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
882 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
883 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
884 else:
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
885 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
886 #print pane.name, wname, wndid
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
887 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
888 evt.Skip()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
889 self._mgr.Update()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
890
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
891
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
892 def saveLayout(self):
126
e7f990be5075 Traipse Alpha 'OpenRPG' {091002-00}
sirebral
parents: 124
diff changeset
893 filename = dir_struct["user"] + "layout.xml"
133
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
894 layout = parse(filename)
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
895 xml_dom = layout.getroot()
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
896 (x_size,y_size) = self.GetClientSize()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
897 (x_pos,y_pos) = self.GetPositionTuple()
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
898 if self.IsMaximized(): max = 1
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
899 else: max = 0
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
900 xml_dom.set("height", str(y_size))
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
901 xml_dom.set("width", str(x_size))
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
902 xml_dom.set("posx", str(x_pos))
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
903 xml_dom.set("posy", str(y_pos))
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
904 xml_dom.set("maximized", str(max))
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
905 try:
133
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
906 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
907 except:
126
e7f990be5075 Traipse Alpha 'OpenRPG' {091002-00}
sirebral
parents: 124
diff changeset
908 elem = Element('DockLayout')
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
909 elem.set("DO_NO_EDIT","True")
126
e7f990be5075 Traipse Alpha 'OpenRPG' {091002-00}
sirebral
parents: 124
diff changeset
910 elem.text = str(self._mgr.SavePerspective())
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
911 xml_dom.append(elem)
133
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
912
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
913 layout.write(filename)
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
914 """
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
915 temp_file = open(filename, "w")
126
e7f990be5075 Traipse Alpha 'OpenRPG' {091002-00}
sirebral
parents: 124
diff changeset
916 temp_file.write(tostring(xml_dom))
133
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
917 temp_file.close()"""
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
918
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
919
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
920 def build_hotkeys(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
921 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
922 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
923
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
924
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
925 def start_timer(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
926 self.poll_timer.Start(100)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
927 s = component.get('settings')
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
928 if s.get("Heartbeat") == "1":
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
929 self.ping_timer.Start(1000*60)
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
930 logger.debug("starting heartbeat...", True)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
931
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
932
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
933 def kill_mplay_session(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
934 self.game_name = ""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
935 self.session.start_disconnect()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
936
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
937
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
938 def quit_game(self, evt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
939 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
940 if dlg.ShowModal() == wx.ID_YES:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
941 self.session.exitCondition.notifyAll()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
942 dlg.Destroy()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
943 self.kill_mplay_session()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
944
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
945
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
946 def on_status_event(self, evt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
947 id = evt.get_id()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
948 status = evt.get_data()
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
949 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
950
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
951
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
952 def on_player_event(self, evt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
953 id = evt.get_id()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
954 player = evt.get_data()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
955 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
956 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
957 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
958 self.players.add_player(player)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
959 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
960 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
961 self.players.del_player(player)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
962 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
963 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
964 self.players.update_player(player)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
965 self.players.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
966
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
967
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
968 def on_group_event(self, evt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
969 id = evt.get_id()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
970 data = evt.get_data()
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
971 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
972 elif id == orpg.networking.mplay_client.GROUP_DEL:
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
973 # 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
974 self.gs.del_room(data)
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
975 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
976
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
977
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
978 def on_receive(self, data, player):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
979 # see if we are ignoring this user
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
980 (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
981 for m in ignore_id:
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
982 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
983
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
984 # ok we are not ignoring this message
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
985 #recvSound = "RecvSound" # this will be the default sound. Whisper will change this below
133
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
986
118
217fb049bd00 Traipse Alpha 'OpenRPG' {091028-00}
sirebral
parents: 117
diff changeset
987 ### Alpha ###
217fb049bd00 Traipse Alpha 'OpenRPG' {091028-00}
sirebral
parents: 117
diff changeset
988 etreeEl = Element('msg')
217fb049bd00 Traipse Alpha 'OpenRPG' {091028-00}
sirebral
parents: 117
diff changeset
989 try: etreeEl.append(fromstring(data))
217fb049bd00 Traipse Alpha 'OpenRPG' {091028-00}
sirebral
parents: 117
diff changeset
990 except: etreeEl.text = data
217fb049bd00 Traipse Alpha 'OpenRPG' {091028-00}
sirebral
parents: 117
diff changeset
991 ### Remove after Element Tree is integrated further ###
133
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
992 if player: display_name = self.chat.chat_display_name(player)
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
993 else: display_name = "Server Administrator"
118
217fb049bd00 Traipse Alpha 'OpenRPG' {091028-00}
sirebral
parents: 117
diff changeset
994
133
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
995 if etreeEl.text: self.chat.Post(etreeEl.text)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
996
118
217fb049bd00 Traipse Alpha 'OpenRPG' {091028-00}
sirebral
parents: 117
diff changeset
997 for child in etreeEl.getchildren():
217fb049bd00 Traipse Alpha 'OpenRPG' {091028-00}
sirebral
parents: 117
diff changeset
998 if child.tag == 'tree':
217fb049bd00 Traipse Alpha 'OpenRPG' {091028-00}
sirebral
parents: 117
diff changeset
999 ### Alpha ### Allows users to decide if they want the node or not.
133
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
1000 dlg = wx.MessageDialog(None, display_name + ' is trying to send you a tree node. Accept?', 'Question',
118
217fb049bd00 Traipse Alpha 'OpenRPG' {091028-00}
sirebral
parents: 117
diff changeset
1001 wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
217fb049bd00 Traipse Alpha 'OpenRPG' {091028-00}
sirebral
parents: 117
diff changeset
1002 if dlg.ShowModal() == wx.ID_YES:
217fb049bd00 Traipse Alpha 'OpenRPG' {091028-00}
sirebral
parents: 117
diff changeset
1003 dlg.Destroy()
133
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
1004 debug(child)
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
1005 self.tree.on_receive_data(tostring(child)) #Removed player object because it was unused.
118
217fb049bd00 Traipse Alpha 'OpenRPG' {091028-00}
sirebral
parents: 117
diff changeset
1006 self.chat.InfoPost(display_name + " has sent you a tree node...")
217fb049bd00 Traipse Alpha 'OpenRPG' {091028-00}
sirebral
parents: 117
diff changeset
1007 elif child.tag == 'map':
217fb049bd00 Traipse Alpha 'OpenRPG' {091028-00}
sirebral
parents: 117
diff changeset
1008 #TODO: Fix map to accepts elements
217fb049bd00 Traipse Alpha 'OpenRPG' {091028-00}
sirebral
parents: 117
diff changeset
1009 self.map.new_data(tostring(child))
217fb049bd00 Traipse Alpha 'OpenRPG' {091028-00}
sirebral
parents: 117
diff changeset
1010 elif child.tag == 'chat':
133
37d26a98883f Traipse Alpha 'OpenRPG' {091010-00}
sirebral
parents: 126
diff changeset
1011 msg = orpg.chat.chat_msg.chat_msg(tostring(child))
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
1012 self.chat.post_incoming_msg(msg, player)
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
1013
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1014 def on_mplay_event(self, evt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1015 id = evt.get_id()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1016 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
1017 self.chat.InfoPost("Game connected!")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1018 self.gs.set_connected(1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1019 self.password_manager.ClearPassword("ALL")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1020
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1021 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
1022 self.poll_timer.Stop()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1023 self.ping_timer.Stop()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1024 self.chat.SystemPost("Game disconnected!")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1025 self.players.reset()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1026 self.gs.set_connected(0)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1027 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
1028
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1029 ####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
1030 elif id == orpg.networking.mplay_client.MPLAY_DISCONNECTING:
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1031 settings = component.get('settings')
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
1032 custom_msg = settings.get("dcmsg")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1033 custom_msg=custom_msg[:80]
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1034 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
1035 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
1036 #####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
1037
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
1038 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
1039 group = evt.get_data()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1040 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
1041 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
1042 self.players.reset()
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
1043 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
1044 self.chat.SystemPost("Room access denied!")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1045
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
1046
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1047 def OnCloseWindow(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1048 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
1049 if dlg.ShowModal() == wx.ID_YES:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1050 dlg.Destroy()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1051 self.closed_confirmed()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1052
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
1053
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1054 def closed_confirmed(self):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1055 self.activeplugins = component.get('plugins')
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1056 self.aliaslib.OnMB_FileSave(None)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1057
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1058 #following lines added by mDuo13
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1059 #########plugin_disabled()#########
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1060 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
1061 plugin = self.activeplugins[plugin_fname]
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1062 try: plugin.plugin_disabled()
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1063 except Exception, e:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1064 traceback.print_exc()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1065 #end mDuo13 added code
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1066 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
1067 try: settings.save()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1068 except Exception:
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1069 logger.general("[WARNING] Error saving 'settings' component", True)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1070
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1071 try: self.map.pre_exit_cleanup()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1072 except Exception:
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1073 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
1074
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1075 try:
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
1076 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
1077 if (save_tree != "0") and (save_tree != "False") and (save_tree != "NO"):
119
9314d63c0941 Traipse Alpha 'OpenRPG' {091029-00}
sirebral
parents: 118
diff changeset
1078 self.tree.save_tree(settings.get("gametree"))
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1079 except Exception:
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1080 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
1081
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1082 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
1083
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1084 try:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1085 #Kill all the damn timers
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1086 self.sound_player.timer.Stop()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1087 del self.sound_player.timer
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1088 except Exception:
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1089 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
1090
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1091 try:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1092 self.poll_timer.Stop()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1093 self.ping_timer.Stop()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1094 self.chat.parent.chat_timer.Stop()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1095 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
1096 self.map.canvas.image_timer.Stop()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1097 self.status.timer.Stop()
14
0b8b7e3ed78d Adding fixes from OpenRPG 1.8.0
sirebral
parents: 7
diff changeset
1098 del self.ping_timer; del self.poll_timer; del self.chat.parent.chat_timer
0b8b7e3ed78d Adding fixes from OpenRPG 1.8.0
sirebral
parents: 7
diff changeset
1099 del self.map.canvas.zoom_display_timer; del self.map.canvas.image_timer; del self.status.timer
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1100 except Exception:
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1101 logger.general("some timer didn't die properly.", True)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1102
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1103 self._mgr.UnInit()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1104 mainapp = wx.GetApp()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1105 mainapp.ExitMainLoop()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1106 self.Destroy()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1107
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1108 try:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1109 if self.server_pipe != None:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1110 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
1111 dlg.Update(2)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1112 dlg.Show(True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1113 self.server_pipe.write("\nkill\n")
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1114 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
1115 time.sleep(5)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1116 self.server_stop()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1117 self.server_pipe.close()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1118 self.std_out.close()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1119 self.server_thread.exit()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1120 dlg.Destroy()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1121 logger.general("Server killed:", True)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1122 except Exception:
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1123 pass
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1124
98
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1125 ########################################
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1126 ## About Dialog class
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1127 ########################################
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1128 class AboutORPG(wx.Frame):
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1129 def __init__(self, parent):
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1130 super(AboutORPG, self).__init__(parent, -1, "About 'Traipse' OpenRPG")
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1131 icon = None
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1132 icon = wx.Icon(dir_struct["icon"]+'d20.ico', wx.BITMAP_TYPE_ICO)
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1133 self.SetIcon( icon )
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1134 sizer = wx.GridBagSizer(hgap=1, vgap=1)
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1135 height = 425; width = 350
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1136 self.About = wx.TextCtrl(self, -1, size=wx.DefaultSize, style=wx.TE_MULTILINE | wx.TE_READONLY)
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1137 img = wx.Image(dir_struct['icon']+'splash.gif', wx.BITMAP_TYPE_ANY).ConvertToBitmap()
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1138 image = wx.StaticBitmap(self, -1, img, size=wx.DefaultSize)
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1139 sizer.Add(image, (0,0), flag=wx.ALIGN_CENTER_HORIZONTAL|wx.ALL|wx.ADJUST_MINSIZE)
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1140 sizer.Add(self.About, (1,0), flag=wx.EXPAND)
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1141 self.SetSizer(sizer)
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1142 self.SetAutoLayout(True)
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1143 self.SetSize((width, height))
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1144 sizer.AddGrowableCol(0)
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1145 sizer.AddGrowableCol(1)
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1146 sizer.AddGrowableRow(1)
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1147 self.Bind(wx.EVT_CLOSE, self.Min)
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1148 self.Min(None)
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1149
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1150 description = "OpenRPG is a Virtual Game Table that allows users to connect via a network and play table "
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1151 description += "top games with friends. 'Traipse' is an OpenRPG distro that is easy to setup and provides superb "
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1152 description += "functionality. OpenRPG is originally designed by Chris Davis."
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1153
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1154 license = "OpenRPG is free software; you can redistribute it and/or modify it "
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1155 license += "under the terms of the GNU General Public License as published by the Free Software Foundation; "
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1156 license += "either version 2 of the License, or (at your option) any later version.\n\n"
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1157 license += "OpenRPG and Traipse 'OpenRPG' is distributed in the hope that it will be useful, but WITHOUT ANY "
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1158 license += "WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. "
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1159 license += "See the GNU General Public License for more details. You should have received a copy of "
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1160 license += "the GNU General Public License along with Traipse 'OpenRPG'; if not, write to "
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1161 license += "the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA \n\n"
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1162 license += "'Traipse' and the 'Traipse' Logo are trademarks of Mad Mathematics Laboratories."
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1163
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1164 self.About.AppendText(description+'\n\n')
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1165 self.About.AppendText(license+'\n\n')
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1166 self.About.AppendText('OpenRPG Developers:\n')
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1167 orpg_devs = ['Thomas Baleno', 'Andrew Bennett', 'Lex Berezhny', 'Ted Berg',
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1168 'Bernhard Bergbauer', 'Chris Blocher', 'David Byron', 'Ben Collins-Sussman', 'Robin Cook', 'Greg Copeland',
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1169 'Chris Davis', 'Michael Edwards', 'Andrew Ettinger', 'Todd Faris', 'Dj Gilcrease',
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1170 'Christopher Hickman', 'Paul Hosking', 'Brian Manning', 'Scott Mackay', 'Jesse McConnell',
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1171 'Brian Osman', 'Rome Reginelli', 'Christopher Rouse', 'Dave Sanders', 'Tyler Starke', 'Mark Tarrabain']
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1172 for dev in orpg_devs:
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1173 self.About.AppendText(dev+'\n')
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1174
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1175 def Min(self, evt):
95b5281e8d34 Traipse Alpha 'OpenRPG' {090925-00}
sirebral
parents: 96
diff changeset
1176 self.Hide()
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1177
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1178 ########################################
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1179 ## Application class
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1180 ########################################
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1181 class orpgSplashScreen(wx.SplashScreen):
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
1182
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1183 def __init__(self, parent, bitmapfile, duration, callback):
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1184 wx.SplashScreen.__init__(self, wx.Bitmap(bitmapfile),
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1185 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
1186 self.callback = callback
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1187 self.closing = False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1188 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
1189
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1190 class orpgApp(wx.App):
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
1191
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1192 def OnInit(self):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1193 component.add('log', logger)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1194 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
1195 component.add('settings', settings)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1196 component.add('validate', validate)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1197 component.add("tabbedWindows", [])
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1198
126
e7f990be5075 Traipse Alpha 'OpenRPG' {091002-00}
sirebral
parents: 124
diff changeset
1199 #Update Manager
116
d078a8cdc1e4 Traipse Alpha 'OpenRPG' {091012-01}
sirebral
parents: 115
diff changeset
1200 self.manifest = manifest.ManifestChanges()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1201
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1202 self.called = False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1203 wx.InitAllImageHandlers()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1204 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
1205 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
1206 self._crust = None
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1207 wx.Yield()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1208 return True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1209
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
1210
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1211 def OnKeyPress(self, evt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1212 #Event handler
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1213 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
1214 else: evt.Skip()
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1215
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
1216
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1217 def ShowShell(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1218 #Show the PyCrust window.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1219 if not self._crust:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1220 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
1221 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
1222 win = wx.FindWindowAtPointer()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1223 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
1224 self._crust.Show()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1225
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
1226
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1227 def AfterSplash(self,evt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1228 if not self.called:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1229 self.splash.Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1230 self.called = True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1231 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
1232 self.frame.Raise()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1233 self.frame.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1234 self.frame.Show(True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1235 self.SetTopWindow(self.frame)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1236 #self.frame.show_dlgs()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1237 self.frame.post_show_init()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1238 wx.CallAfter(self.splash.Close)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1239 return True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1240
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
1241
14
0b8b7e3ed78d Adding fixes from OpenRPG 1.8.0
sirebral
parents: 7
diff changeset
1242 def OnExit_CleanUp(self):
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
1243 logger.debug("Preforming cleanup\n")
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1244 try: del os.environ["OPENRPG_BASE"]
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1245 except: pass
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1246 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
1247 except: pass
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1248 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
1249 except: pass
14
0b8b7e3ed78d Adding fixes from OpenRPG 1.8.0
sirebral
parents: 7
diff changeset
1250
124
8827271fbe1b Traipse Alpha 'OpenRPG' {091001-01}
sirebral
parents: 119
diff changeset
1251
14
0b8b7e3ed78d Adding fixes from OpenRPG 1.8.0
sirebral
parents: 7
diff changeset
1252 def OnExit(self):
0b8b7e3ed78d Adding fixes from OpenRPG 1.8.0
sirebral
parents: 7
diff changeset
1253 self.OnExit_CleanUp()
5
5a2c95067daf This update causes the software to remove approot.py and approot.pyc
sirebral
parents: 4
diff changeset
1254 #Exit
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
1255 logger.debug("Main Application Exit\n\n")