annotate orpg/main.py @ 68:3ea7a54284bb ornery-dev

Traipse Dev 'OpenRPG' {090818-02} Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc''s main goal is to offer more advanced features and enhance the productivity of the user. Update Summary: *Stable* This is the first wave of Code Refinement updates. Includes new material from Core Beta; new debugger material (partially implemented), beginnings of switch to etree, TerminalWriter, and a little more. open_rpg has been renamed to component; functioning now as component.get(), component.add(), component.delete(). This version has known bugs, specifically with the gametree and nodes. Fixes nodehandlers to bring the dev back to a stable push. Known issue with a nodehandler and it's sub dialogs. Fixed a mis-spelled import. whoops.
author sirebral
date Tue, 18 Aug 2009 07:38:58 -0500
parents c54768cffbd4
children 449a8900f9ac
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
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
37 from orpg.dirpath import dir_struct
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
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
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
40
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
41 import orpg.tools.pluginui as pluginUI
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
42 import orpg.tools.aliaslib
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
43 import orpg.tools.toolBars
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
44 import orpg.tools.orpg_sound
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
45 import orpg.tools.rgbhex
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
46
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
47 import orpg.gametree.gametree
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
48 import orpg.chat.chatwnd
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
49
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
50 import orpg.networking.mplay_client
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
51 import orpg.networking.gsclient
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
52
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
53 import orpg.mapper.map
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
54 import orpg.mapper.images
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
55
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
56 import upmana.updatemana
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
57 import upmana.manifest as manifest
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
58 import wx.py
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
59
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
60 from orpg.dieroller.utils import roller_manager as DiceManager
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
61 from orpg.tools.orpg_log import logger
68
3ea7a54284bb Traipse Dev 'OpenRPG' {090818-02}
sirebral
parents: 66
diff changeset
62 from orpg.tools.orpg_settings import settings #imported, not used yet
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
63 from orpg.tools.validate import validate
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
64 from orpg.tools.passtool import PassTool
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
65 from orpg.tools.decorators import debugging
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
66 from orpg.tools.metamenus import MenuBarEx
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
67
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
68 #from xml.etree.ElementTree import ElementTree, Element
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
69 #from xml.etree.ElementTree import fromstring, tostring
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
70 from orpg.orpg_xml import xml #to be replaced by etree
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
71
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
72
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
73
0
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 ## Main Frame
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
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
78
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
79 class orpgFrame(wx.Frame):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
80 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
81 def __init__(self, parent, id, title):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
82 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
83 self.orpgLog = component.get('log')
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
84 self.xml = component.get("xml")
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
85 self.validate = component.get("validate")
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
86 self.settings = component.get("settings")
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
87 self.orpgLog.log("Enter orpgFrame", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
88 self.rgbcovert = orpg.tools.rgbhex.RGBHex()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
89 self._mgr = AUI.AuiManager(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
90
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
91 # Determine which icon format to use
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
92 icon = None
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
93 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
94 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
95 self.SetIcon( icon )
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
96
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
97 # create session
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
98 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
99 "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
100 "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
101 "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
102 "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
103 "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
104 "orpgFrame":self}
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
105
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
106 self.session = orpg.networking.mplay_client.mplay_client(self.settings.get_setting("player"), call_backs)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
107 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
108 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
109 self.poll_timer.Start(100)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
110 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
111 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
112
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
113 # create roller manager
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
114 self.DiceManager = DiceManager(self.settings.get_setting("dieroller"))
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
115 component.add('DiceManager', self.DiceManager)
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 #create password manager --SD 8/03
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
118 self.password_manager = component.get('password_manager')
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
119 component.add("session", self.session)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
120 component.add('frame', self)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
121
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
122 # build frame windows
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
123 self.build_menu()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
124 self.build_gui()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
125 self.build_hotkeys()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
126
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
127 logger.debug("GUI Built")
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
128 component.add("chat",self.chat)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
129 component.add("map",self.map)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
130 component.add("alias", self.aliaslib)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
131
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
132 self.orpgLog.log("openrpg components all added", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
133 self.tree.load_tree(self.settings.get_setting("gametree"))
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
134 logger.debug("Tree Loaded")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
135 self.players.size_cols()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
136
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
137 #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
138 component.add('pluginmenu', self.pluginMenu)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
139 self.pluginsFrame.Start()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
140 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
141 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
142
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
143 #Load Update Manager
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
144 component.add('updatemana', self.updateMana)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
145 logger.debug("update manager reloaded")
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
146 self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
147
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
148 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
149 def post_show_init(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
150 """Some Actions need to be done after the main fram is drawn"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
151 self.players.size_cols()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
152
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
153 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
154 def get_activeplugins(self):
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
155 try: tmp = self.pluginsFrame.get_activeplugins()
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
156 except: tmp = {}
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
157 return tmp
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
158
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
159 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
160 def get_startplugins(self):
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
161 try: tmp = self.pluginsFrame.get_startplugins()
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
162 except: tmp = {}
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
163 return tmp
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
164
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
165 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
166 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
167 try:
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
168 msg = ["DEBUG: password response= ",
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
169 str(signal),
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
170 " (T:",
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
171 str(type),
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
172 " #",
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
173 str(id),
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
174 ")"]
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
175 logger.debug("".join(msg))
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
176 id = int(id)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
177 type = str(type)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
178 data = str(data)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
179 signal = str(signal)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
180 if signal == "fail":
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
181 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
182 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
183 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
184 else: pass
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
185 except: traceback.print_exc()
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
186
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
187 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
188 def build_menu(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
189 menu = \
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
190 [[
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
191 ['&OpenRPG'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
192 [' &Settings\tCtrl-S'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
193 [' -'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
194 [' Tab Styles'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
195 [' Slanted'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
196 [' Colorful', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
197 [' Black and White', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
198 [' Aqua', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
199 [' Custom', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
200 [' Flat'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
201 [' Black and White', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
202 [' Aqua', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
203 [' Custom', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
204 [' NewMap'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
205 [' -'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
206 [' &Exit']
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
207 ],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
208 [
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
209 ['&Game Server'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
210 [' &Browse Servers\tCtrl-B'],
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 [' Server Heartbeat', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
213 [' -'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
214 [' &Start Server']
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
215 ],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
216 [
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
217 ['&Tools'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
218 [' Logging Level'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
219 [' Debug', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
220 [' Note', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
221 [' Info', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
222 [' General', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
223 [' -'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
224 [' Password Manager', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
225 [' -'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
226 [' Sound Toolbar', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
227 [' Dice Bar\tCtrl-D', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
228 [' Map Bar', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
229 [' Status Bar\tCtrl-T', "check"],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
230 ],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
231 [
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
232 ['&Help'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
233 [' &About'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
234 [' Online User Guide'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
235 [' Change Log'],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
236 [' Report a Bug']
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
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
239 self.mainmenu = MenuBarEx(self, menu)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
240 if self.settings.get_setting('Heartbeat') == '1':
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
241 self.mainmenu.SetMenuState("GameServerServerHeartbeat", True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
242
26
65c5cb9be59c This patch fixes the known issue with users not being able to set their name
sirebral
parents: 19
diff changeset
243 tabtheme = self.settings.get_setting('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
244 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
245 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
246 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
247 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
248 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
249 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedCustom", tabtheme == 'customslant')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
250 self.mainmenu.SetMenuState("OpenRPGTabStylesFlatCustom", tabtheme == 'customflat')
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 lvl = int(self.settings.get_setting('LoggingLevel'))
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
253 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
254 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
255 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
256 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
257
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
258 self.pluginMenu = wx.Menu()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
259 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
260 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
261
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
262 self.pluginMenu.AppendItem(item)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
263 self.pluginMenu.AppendSeparator()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
264 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
265
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
266 self.updateMana = wx.Menu()
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
267 mana = wx.MenuItem(self.updateMana, wx.ID_ANY, "Update Manager", "Update Manager")
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
268 self.Bind(wx.EVT_MENU, self.OnMB_UpdateManagerPanel, mana)
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
269
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
270 self.updateMana.AppendItem(mana)
54
5d89a6eaf492 WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents: 49
diff changeset
271 self.mainmenu.Insert(5, self.updateMana, "&Update Manager")
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
272
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
273
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
274 #################################
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
275 ## All Menu Events
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
276 #################################
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
277 #Tab Styles Menus
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
278 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
279 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
280
65c5cb9be59c This patch fixes the known issue with users not being able to set their name
sirebral
parents: 19
diff changeset
281 tabtheme = self.settings.get_setting('TabTheme') #This change is stable. TaS.
65c5cb9be59c This patch fixes the known issue with users not being able to set their name
sirebral
parents: 19
diff changeset
282 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
283 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
284 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
285 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
286 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
287 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
288 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
289
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
290 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
291 else:
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
292 try: newstyle = args[1]
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
293 except: self.orpgLog.log('Invalid Syntax for orpgFrame->SetTabStyles(self, *args, **kwargs)', ORPG_GENERAL); return
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
294 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
295 else:
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
296 try: menu = args[0]
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
297 except: self.orpgLog.log('Invalid Syntax for orpgFrame->SetTabStyles(self, *args, **kwargs)', ORPG_GENERAL); return
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
298
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
299 if kwargs.has_key('graidentTo'): graidentTo = kwargs['graidentTo']
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
300 else: graidentTo = None
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
301 if kwargs.has_key('graidentFrom'): graidentFrom = kwargs['graidentFrom']
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
302 else: graidentFrom = None
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
303 if kwargs.has_key('textColor'): textColor = kwargs['textColor']
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
304 else: textColor = None
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
305
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
306 #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
307 tabbedwindows = component.get("tabbedWindows")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
308 rgbc = orpg.tools.rgbhex.RGBHex()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
309 new = []
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
310 for wnd in tabbedwindows:
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
311 try: style = wnd.GetWindowStyleFlag(); new.append(wnd)
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
312 except: pass
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
313 tabbedwindows = new
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
314 component.add("tabbedWindows", tabbedwindows)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
315
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
316 #Run though the new list and set the proper styles
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
317 tabbg = self.settings.get_setting('TabBackgroundGradient')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
318 rgbc = orpg.tools.rgbhex.RGBHex()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
319 (red, green, blue) = rgbc.rgb_tuple(tabbg)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
320
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
321 for wnd in tabbedwindows:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
322 style = wnd.GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
323 # remove old tabs style
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
324 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
325 style &= mirror
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
326 style |= newstyle
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
327 wnd.SetWindowStyleFlag(style)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
328 wnd.SetTabAreaColour(wx.Color(red, green, blue))
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
329 if graidentTo != None: wnd.SetGradientColourTo(graidentTo)
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
330 if graidentFrom != None: wnd.SetGradientColourFrom(graidentFrom)
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
331 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
332 wnd.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
333
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
334 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
335 def OnMB_OpenRPGNewMap(self):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
336 pass #Not Implemented yet!
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
337
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
338 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
339 def OnMB_OpenRPGTabStylesSlantedColorful(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
340 if self.mainmenu.GetMenuState("OpenRPGTabStylesSlantedColorful"):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
341 self.settings.set_setting('TabTheme', 'slanted&colorful')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
342 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
343 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
344
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
345 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
346 def OnMB_OpenRPGTabStylesSlantedBlackandWhite(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
347 if self.mainmenu.GetMenuState("OpenRPGTabStylesSlantedBlackandWhite"):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
348 self.settings.set_setting('TabTheme', 'slanted&bw')
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
349 self.SetTabStyles("OpenRPGTabStylesSlantedBlackandWhite",
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
350 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
351 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
352
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
353 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
354 def OnMB_OpenRPGTabStylesSlantedAqua(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
355 if self.mainmenu.GetMenuState("OpenRPGTabStylesSlantedAqua"):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
356 self.settings.set_setting('TabTheme', 'slanted&aqua')
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
357 self.SetTabStyles("OpenRPGTabStylesSlantedAqua", FNB.FNB_VC8,
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
358 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
359 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
360
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
361 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
362 def OnMB_OpenRPGTabStylesSlantedCustom(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
363 if self.mainmenu.GetMenuState("OpenRPGTabStylesSlantedCustom"):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
364 self.settings.set_setting('TabTheme', 'customslant')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
365 rgbc = orpg.tools.rgbhex.RGBHex()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
366 gfrom = self.settings.get_setting('TabGradientFrom')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
367 (fred, fgreen, fblue) = rgbc.rgb_tuple(gfrom)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
368 gto = self.settings.get_setting('TabGradientTo')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
369 (tored, togreen, toblue) = rgbc.rgb_tuple(gto)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
370 tabtext = self.settings.get_setting('TabTextColor')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
371 (tred, tgreen, tblue) = rgbc.rgb_tuple(tabtext)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
372 tabbg = self.settings.get_setting('TabBackgroundGradient')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
373 (red, green, blue) = rgbc.rgb_tuple(tabbg)
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
374 self.SetTabStyles("OpenRPGTabStylesSlantedCustom", FNB.FNB_VC8,
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
375 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
376 textColor=wx.Color(tred, tgreen, tblue))
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
377 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
378
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
379 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
380 def OnMB_OpenRPGTabStylesFlatBlackandWhite(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
381 if self.mainmenu.GetMenuState("OpenRPGTabStylesFlatBlackandWhite"):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
382 self.settings.set_setting('TabTheme', 'flat&bw')
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
383 self.SetTabStyles("OpenRPGTabStylesFlatBlackandWhite", FNB.FNB_FANCY_TABS,
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
384 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
385 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
386
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
387 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
388 def OnMB_OpenRPGTabStylesFlatAqua(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
389 if self.mainmenu.GetMenuState("OpenRPGTabStylesFlatAqua"):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
390 self.settings.set_setting('TabTheme', 'flat&aqua')
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
391 self.SetTabStyles("OpenRPGTabStylesFlatAqua", FNB.FNB_FANCY_TABS,
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
392 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
393 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
394
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
395 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
396 def OnMB_OpenRPGTabStylesFlatCustom(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
397 if self.mainmenu.GetMenuState("OpenRPGTabStylesFlatCustom"):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
398 self.settings.set_setting('TabTheme', 'customflat')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
399 rgbc = orpg.tools.rgbhex.RGBHex()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
400 gfrom = self.settings.get_setting('TabGradientFrom')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
401 (fred, fgreen, fblue) = rgbc.rgb_tuple(gfrom)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
402 gto = self.settings.get_setting('TabGradientTo')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
403 (tored, togreen, toblue) = rgbc.rgb_tuple(gto)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
404 tabtext = self.settings.get_setting('TabTextColor')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
405 (tred, tgreen, tblue) = rgbc.rgb_tuple(tabtext)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
406 tabbg = self.settings.get_setting('TabBackgroundGradient')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
407 (red, green, blue) = rgbc.rgb_tuple(tabbg)
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
408 self.SetTabStyles("OpenRPGTabStylesFlatCustom", FNB.FNB_FANCY_TABS,
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
409 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
410 textColor=wx.Color(tred, tgreen, tblue))
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
411 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
412
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
413 #Window Menu
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
414 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
415 def OnMB_WindowsMenu(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
416 menuid = event.GetId()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
417 name = self.mainwindows[menuid]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
418 if name == 'Alias Lib':
60
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
419 if self.aliaslib.IsShown(): self.aliaslib.Hide()
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
420 else: self.aliaslib.Show()
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
421 else:
60
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
422 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
423 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
424 self._mgr.Update()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
425
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
426 #OpenRPG Menu
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
427 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
428 def OnMB_OpenRPGSettings(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
429 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
430 dlg.Centre()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
431 dlg.ShowModal()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
432
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
433 def OnMB_OpenRPGExit(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
434 self.OnCloseWindow(0)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
435
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
436 #Game Server Menu
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
437 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
438 def OnMB_GameServerBrowseServers(self):
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
439 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
440 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
441 self._mgr.Update()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
442
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
443 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
444 def OnMB_GameServerServerHeartbeat(self):
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
445 if self.mainmenu.GetMenuState("GameServerServerHeartbeat"): self.settings.set_setting('Heartbeat', '1')
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
446 else: self.settings.set_setting('Heartbeat', '0')
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
447
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
448 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
449 def OnMB_GameServerStartServer(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
450 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
451 # 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
452 start_dialog.Update( 0 )
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
453 # 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
454 # as per reported bug 586227
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
455 if wx.Platform == "__WXMSW__":
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
456 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
457 args = ( sys.executable, arg )
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
458 else:
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
459 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
460 args = (arg,arg)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
461 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
462 start_dialog.Update( 1 )
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
463 start_dialog.Show(False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
464 start_dialog.Destroy()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
465
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
466 # Tools Menu
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
467 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
468 def OnMB_PluginControlPanel(self, evt):
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
469 if self.pluginsFrame.IsShown() == True: self.pluginsFrame.Hide()
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
470 else: self.pluginsFrame.Show()
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
471
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
472 @debugging
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
473 def OnMB_UpdateManagerPanel(self, evt):
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
474 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
475 else: self.updateMana.Show()
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
476
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
477 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
478 def OnMB_ToolsLoggingLevelDebug(self):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
479 lvl = logger.log_level
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
480 if self.mainmenu.GetMenuState("ToolsLoggingLevelDebug"): lvl |= ORPG_DEBUG
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
481 else: lvl &= ~ORPG_DEBUG
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
482 logger.log_level = lvl
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
483 settings.set('LoggingLevel', lvl)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
484
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
485 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
486 def OnMB_ToolsLoggingLevelNote(self):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
487 lvl = logger.log_level
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
488 if self.mainmenu.GetMenuState("ToolsLoggingLevelNote"): lvl |= ORPG_DEBUG
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
489 else: lvl &= ~ORPG_DEBUG
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
490 logger.log_level = lvl
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
491 settings.set('LoggingLevel', lvl)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
492
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
493 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
494 def OnMB_ToolsLoggingLevelInfo(self):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
495 lvl = logger.log_level
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
496 if self.mainmenu.GetMenuState("ToolsLoggingLevelInfo"): lvl |= ORPG_INFO
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
497 else: lvl &= ~ORPG_INFO
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
498 logger.log_level = lvl
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
499 settings.set('LoggingLevel', lvl)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
500
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
501 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
502 def OnMB_ToolsLoggingLevelGeneral(self):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
503 lvl = logger.log_level
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
504 if self.mainmenu.GetMenuState("ToolsLoggingLevelGeneral"): lvl |= ORPG_GENERAL
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
505 else: lvl &= ~ORPG_GENERAL
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
506 logger.log_level = lvl
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
507 settings.set('LoggingLevel', lvl)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
508
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
509 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
510 def OnMB_ToolsPasswordManager(self):
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
511 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
512 else: self.password_manager.Disable()
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
513
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
514 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
515 def OnMB_ToolsStatusBar(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
516 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
517 self.mainmenu.SetMenuState("ToolsStatusBar", False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
518 self._mgr.GetPane("Status Window").Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
519 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
520 self.mainmenu.SetMenuState("ToolsStatusBar", True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
521 self._mgr.GetPane("Status Window").Show()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
522 self._mgr.Update()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
523
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
524 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
525 def OnMB_ToolsSoundToolbar(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
526 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
527 self.mainmenu.SetMenuState("ToolsSoundToolbar", False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
528 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
529 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
530 self.mainmenu.SetMenuState("ToolsSoundToolbar", True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
531 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
532 self._mgr.Update()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
533
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
534 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
535 def OnMB_ToolsDiceBar(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
536 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
537 self.mainmenu.SetMenuState("ToolsDiceBar", False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
538 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
539 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
540 self.mainmenu.SetMenuState("ToolsDiceBar", True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
541 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
542 self._mgr.Update()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
543
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
544 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
545 def OnMB_ToolsMapBar(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
546 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
547 self.mainmenu.SetMenuState("ToolsMapBar", False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
548 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
549 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
550 self.mainmenu.SetMenuState("ToolsMapBar", True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
551 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
552 self._mgr.Update()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
553
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
554 #Help Menu #Needs a custom Dialog because it is ugly on Windows
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
555 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
556 def OnMB_HelpAbout(self):
4
c0da99091e1d Check out the new About Dialog.
sirebral
parents: 0
diff changeset
557
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
558 description = "OpenRPG is a Virtual Game Table that allows users to connect via a network and play table\n"
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
559 description += "top games with friends. 'Traipse' is an OpenRPG distro that is easy to setup and provides superb \n"
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
560 description += "functionality. OpenRPG is originally designed by Chris Davis. \n"
4
c0da99091e1d Check out the new About Dialog.
sirebral
parents: 0
diff changeset
561
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
562 license = "OpenRPG is free software; you can redistribute it and/or modify it "
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
563 license += "under the terms of the GNU General Public License as published by the Free Software Foundation; \n"
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
564 license += "either version 2 of the License, or (at your option) any later version.\n\n"
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
565 license += "OpenRPG and Traipse 'OpenRPG' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; \n"
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
566 license += "without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. \n"
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
567 license += "See the GNU General Public License for more details. You should have received a copy of \n"
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
568 license += "the GNU General Public License along with Traipse 'OpenRPG'; if not, write to \n"
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
569 license += "the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n\n"
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
570 license += "'Traipse' and the 'Traipse' Logo are trademarks of Mad Mathematics Laboratories."
4
c0da99091e1d Check out the new About Dialog.
sirebral
parents: 0
diff changeset
571
c0da99091e1d Check out the new About Dialog.
sirebral
parents: 0
diff changeset
572 info = wx.AboutDialogInfo()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
573 info.SetIcon(wx.Icon(dir_struct["icon"]+'splash.gif', wx.BITMAP_TYPE_GIF))
4
c0da99091e1d Check out the new About Dialog.
sirebral
parents: 0
diff changeset
574 info.SetName('Traipse')
c0da99091e1d Check out the new About Dialog.
sirebral
parents: 0
diff changeset
575 info.SetVersion('OpenRPG ' + VERSION)
c0da99091e1d Check out the new About Dialog.
sirebral
parents: 0
diff changeset
576 info.SetDescription(description)
14
0b8b7e3ed78d Adding fixes from OpenRPG 1.8.0
sirebral
parents: 7
diff changeset
577 info.SetCopyright('(C) Copyright 2009 Mad Math Labs')
4
c0da99091e1d Check out the new About Dialog.
sirebral
parents: 0
diff changeset
578 info.SetWebSite('http://www.openrpg.com')
c0da99091e1d Check out the new About Dialog.
sirebral
parents: 0
diff changeset
579 info.SetLicence(license)
c0da99091e1d Check out the new About Dialog.
sirebral
parents: 0
diff changeset
580 orpg_devs = ['Thomas Baleno', 'Andrew Bennett', 'Lex Berezhny', 'Ted Berg',
c0da99091e1d Check out the new About Dialog.
sirebral
parents: 0
diff changeset
581 'Bernhard Bergbauer', 'Chris Blocher', 'David Byron', 'Ben Collins-Sussman', 'Robin Cook', 'Greg Copeland',
c0da99091e1d Check out the new About Dialog.
sirebral
parents: 0
diff changeset
582 'Chris Davis', 'Michael Edwards', 'Andrew Ettinger', 'Todd Faris', 'Dj Gilcrease',
c0da99091e1d Check out the new About Dialog.
sirebral
parents: 0
diff changeset
583 'Christopher Hickman', 'Paul Hosking', 'Brian Manning', 'Scott Mackay', 'Jesse McConnell',
c0da99091e1d Check out the new About Dialog.
sirebral
parents: 0
diff changeset
584 'Brian Osman', 'Rome Reginelli', 'Christopher Rouse', 'Dave Sanders', 'Tyler Starke', 'Mark Tarrabain']
c0da99091e1d Check out the new About Dialog.
sirebral
parents: 0
diff changeset
585 for dev in orpg_devs:
c0da99091e1d Check out the new About Dialog.
sirebral
parents: 0
diff changeset
586 info.AddDeveloper(dev)
c0da99091e1d Check out the new About Dialog.
sirebral
parents: 0
diff changeset
587 wx.AboutBox(info)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
588
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
589 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
590 def OnMB_HelpOnlineUserGuide(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
591 wb = webbrowser.get()
4
c0da99091e1d Check out the new About Dialog.
sirebral
parents: 0
diff changeset
592 wb.open("https://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
593
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
594 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
595 def OnMB_HelpChangeLog(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
596 wb = webbrowser.get()
4
c0da99091e1d Check out the new About Dialog.
sirebral
parents: 0
diff changeset
597 wb.open("http://www.assembla.com/spaces/milestones/index/traipse_dev?spaces_tool_id=Milestones")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
598
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
599 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
600 def OnMB_HelpReportaBug(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
601 wb = webbrowser.get()
4
c0da99091e1d Check out the new About Dialog.
sirebral
parents: 0
diff changeset
602 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
603
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
604
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
605 #################################
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
606 ## Build the GUI
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
607 #################################
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
608 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
609 def build_gui(self):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
610 self.orpgLog.log("Enter orpgFrame->build_gui()", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
611 self.Freeze()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
612 self.validate.config_file("layout.xml","default_layout.xml")
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
613
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
614 filename = dir_struct["user"] + "layout.xml"
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
615 temp_file = open(filename)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
616 txt = temp_file.read()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
617 xml_dom = self.xml.parseXml(txt)._get_documentElement()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
618 temp_file.close()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
619
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
620 """ Would a component work better?
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
621 etree = ElementTree()
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
622 with open(dir_struct['user'] + 'layout.xml') as f:
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
623 etree.parse(f)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
624
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
625 base = etree.getroot()
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
626 """
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
627
60
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
628 self.windowsmenu = wx.Menu()
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
629 self.mainwindows = {}
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
630
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
631 #Plugins Window
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
632 self.pluginsFrame = pluginUI.PluginFrame(self)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
633 component.add("plugins", self.get_activeplugins())
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
634 component.add("startplugs", self.get_startplugins())
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
635 self.orpgLog.log("Menu Created", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
636 h = int(xml_dom.getAttribute("height"))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
637 w = int(xml_dom.getAttribute("width"))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
638 posx = int(xml_dom.getAttribute("posx"))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
639 posy = int(xml_dom.getAttribute("posy"))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
640 maximized = int(xml_dom.getAttribute("maximized"))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
641 self.SetDimensions(posx, posy, w, h)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
642 logger.debug("Dimensions Set")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
643
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
644 #Update Manager
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
645 self.manifest = manifest.ManifestChanges()
59
5aff3ef1ae46 New dev branch for Ornery Orc. Adds CSS styling to chat messages. Updates
sirebral
parents: 54
diff changeset
646 self.updateMana = upmana.updatemana.updaterFrame(self,
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
647 "OpenRPG Update Manager Beta 0.7.2", component, self.manifest, True)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
648 self.orpgLog.log("Menu Created", ORPG_DEBUG)
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
649 h = int(xml_dom.getAttribute("height"))
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
650 w = int(xml_dom.getAttribute("width"))
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
651 posx = int(xml_dom.getAttribute("posx"))
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
652 posy = int(xml_dom.getAttribute("posy"))
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
653 maximized = int(xml_dom.getAttribute("maximized"))
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
654 self.SetDimensions(posx, posy, w, h)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
655 logger.debug("Dimensions Set")
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
656
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
657 # Sound Manager
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
658 self.sound_player = orpg.tools.orpg_sound.orpgSound(self)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
659 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
660 wndinfo = AUI.AuiPaneInfo()
60
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
661 menuid = wx.NewId()
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
662 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
663 wndinfo.DestroyOnClose(False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
664 wndinfo.Name("Sound Control Toolbar")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
665 wndinfo.Caption("Sound Control Toolbar")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
666 wndinfo.Float()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
667 wndinfo.ToolbarPane()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
668 wndinfo.Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
669 self._mgr.AddPane(self.sound_player, wndinfo)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
670 children = xml_dom._get_childNodes()
59
5aff3ef1ae46 New dev branch for Ornery Orc. Adds CSS styling to chat messages. Updates
sirebral
parents: 54
diff changeset
671 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
672
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
673 # status window
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
674 self.status = status_bar(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
675 wndinfo = AUI.AuiPaneInfo()
60
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
676 menuid = wx.NewId()
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
677 self.mainwindows[menuid] = "Status Window"
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
678 wndinfo.DestroyOnClose(False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
679 wndinfo.Name("Status Window")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
680 wndinfo.Caption("Status Window")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
681 wndinfo.Float()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
682 wndinfo.ToolbarPane()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
683 wndinfo.Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
684 self._mgr.AddPane(self.status, wndinfo)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
685 logger.debug("Status Window Created")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
686
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
687 # 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
688 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
689 wndinfo = AUI.AuiPaneInfo()
60
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
690 menuid = wx.NewId()
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
691 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
692 wndinfo.DestroyOnClose(False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
693 wndinfo.Name("Dice Tool Bar")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
694 wndinfo.Caption("Dice Tool Bar")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
695 wndinfo.Float()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
696 wndinfo.ToolbarPane()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
697 wndinfo.Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
698 self._mgr.AddPane(self.dieToolBar, wndinfo)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
699 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
700
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
701 #Create the Map tool bar
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
702 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
703 wndinfo = AUI.AuiPaneInfo()
60
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
704 menuid = wx.NewId()
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
705 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
706 wndinfo.DestroyOnClose(False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
707 wndinfo.Name("Map Tool Bar")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
708 wndinfo.Caption("Map Tool Bar")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
709 wndinfo.Float()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
710 wndinfo.ToolbarPane()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
711 wndinfo.Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
712 self._mgr.AddPane(self.mapToolBar, wndinfo)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
713 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
714
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
715 #Create the Browse Server Window
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
716 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
717 wndinfo = AUI.AuiPaneInfo()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
718 wndinfo.DestroyOnClose(False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
719 wndinfo.Name("Browse Server Window")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
720 wndinfo.Caption("Game Server")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
721 wndinfo.Float()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
722 wndinfo.Dockable(False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
723 wndinfo.MinSize(wx.Size(640,480))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
724 wndinfo.Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
725 self._mgr.AddPane(self.gs, wndinfo)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
726 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
727
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
728 #Create the Alias Lib Window
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
729 self.aliaslib = orpg.tools.aliaslib.AliasLib()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
730 self.aliaslib.Hide()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
731 logger.debug("Alias Window Created")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
732 menuid = wx.NewId()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
733 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
734 self.windowsmenu.Check(menuid, False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
735 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
736 self.mainwindows[menuid] = "Alias Lib"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
737 self.mainmenu.Insert(3, self.windowsmenu, 'Windows')
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
738 logger.debug("Windows Menu Done")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
739 self._mgr.Update()
59
5aff3ef1ae46 New dev branch for Ornery Orc. Adds CSS styling to chat messages. Updates
sirebral
parents: 54
diff changeset
740 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
741 else: self.Bind(AUI.EVT_AUI_PANECLOSE, self.onPaneClose)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
742 logger.debug("AUI Bindings Done")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
743
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
744 #Load the layout if one exists
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
745 layout = xml_dom.getElementsByTagName("DockLayout")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
746 try:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
747 textnode = self.xml.safe_get_text_node(layout[0])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
748 self._mgr.LoadPerspective(textnode._get_nodeValue())
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
749 except: pass
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
750 xml_dom.unlink()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
751 self.orpgLog.log("Perspective Loaded", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
752 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
753 self._mgr.Update()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
754 self.Maximize(maximized)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
755 self.orpgLog.log("GUI is all created", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
756 self.Thaw()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
757
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
758 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
759 def do_tab_window(self,xml_dom,parent_wnd):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
760 #def do_tab_window(self, etreeEl, parent_wnd):
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
761 # 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
762 temp_wnd = orpgTabberWnd(parent_wnd, style=FNB.FNB_ALLOW_FOREIGN_DND)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
763
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
764 children = xml_dom._get_childNodes()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
765 for c in children:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
766 wnd = self.build_window(c,temp_wnd)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
767 name = c.getAttribute("name")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
768 temp_wnd.AddPage(wnd, name, False)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
769
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
770 """
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
771 for c in etreeEl.getchildren():
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
772 wnd = self.build_window(c, temp_wnd)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
773 temp_wnd.AddPage(wnd, c.get('name'), False)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
774 """
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
775 return temp_wnd
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
776
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
777 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
778 def build_window(self, xml_dom, parent_wnd):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
779 name = xml_dom._get_nodeName()
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
780 if name == "DockLayout" or name == "dock": return
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
781 dir = xml_dom.getAttribute("direction")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
782 pos = xml_dom.getAttribute("pos")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
783 height = xml_dom.getAttribute("height")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
784 width = xml_dom.getAttribute("width")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
785 cap = xml_dom.getAttribute("caption")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
786 dockable = xml_dom.getAttribute("dockable")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
787 layer = xml_dom.getAttribute("layer")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
788
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
789 try: layer = int(layer); dockable = int(dockable)
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
790 except: layer = 0; dockable = 1
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
791
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
792 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
793 elif name == "map":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
794 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
795 self.map = temp_wnd
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
796 elif name == "tree":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
797 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
798 self.tree = temp_wnd
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
799 if self.settings.get_setting('ColorTree') == '1':
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
800 self.tree.SetBackgroundColour(self.settings.get_setting('bgcolor'))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
801 self.tree.SetForegroundColour(self.settings.get_setting('textcolor'))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
802 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
803 self.tree.SetBackgroundColour('white')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
804 self.tree.SetForegroundColour('black')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
805
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
806 elif name == "chat":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
807 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
808 self.chattabs = temp_wnd
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
809 self.chat = temp_wnd.MainChatPanel
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
810
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
811 elif name == "player":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
812 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
813 self.players = temp_wnd
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
814 if self.settings.get_setting('ColorTree') == '1':
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
815 self.players.SetBackgroundColour(self.settings.get_setting('bgcolor'))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
816 self.players.SetForegroundColour(self.settings.get_setting('textcolor'))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
817 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
818 self.players.SetBackgroundColour('white')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
819 self.players.SetForegroundColour('black')
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
820
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
821 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
822 menuid = wx.NewId()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
823 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
824 self.windowsmenu.Check(menuid, True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
825 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
826 self.mainwindows[menuid] = cap
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
827 wndinfo = AUI.AuiPaneInfo()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
828 wndinfo.DestroyOnClose(False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
829 wndinfo.Name(cap)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
830 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
831 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
832 wndinfo.Layer(int(layer))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
833 wndinfo.Caption(cap)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
834
14
0b8b7e3ed78d Adding fixes from OpenRPG 1.8.0
sirebral
parents: 7
diff changeset
835 # Lambda here should work! (future dev)
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
836 if dir.lower() == 'top': wndinfo.Top()
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
837 elif dir.lower() == 'bottom': wndinfo.Bottom()
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
838 elif dir.lower() == 'left': wndinfo.Left()
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
839 elif dir.lower() == 'right': wndinfo.Right()
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
840 elif dir.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
841
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
842 if dockable != 1:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
843 wndinfo.Dockable(False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
844 wndinfo.Floatable(False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
845 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
846 wndinfo.Position(int(pos))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
847 wndinfo.Show()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
848 self._mgr.AddPane(temp_wnd, wndinfo)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
849 self.orpgLog.log("Exit orpgFrame->build_window(" + name + ")", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
850 return temp_wnd
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
851
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
852 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
853 def onPaneClose(self, evt):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
854 self.orpgLog.log("Enter orpgFrame->onPaneClose()", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
855 pane = evt.GetPane()
60
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
856 #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
857 #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
858 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
859 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
860 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
861 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
862 else:
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
863 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
864 #print pane.name, wname, wndid
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
865 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
866 evt.Skip()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
867 self._mgr.Update()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
868 self.orpgLog.log("Exit orpgFrame->onPaneClose()", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
869
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
870 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
871 def saveLayout(self):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
872 self.orpgLog.log("Enter orpgFrame->saveLayout()", ORPG_DEBUG)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
873 filename = dir_struct["user"] + "layout.xml"
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
874 temp_file = open(filename)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
875 txt = temp_file.read()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
876 xml_dom = self.xml.parseXml(txt)._get_documentElement()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
877 temp_file.close()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
878 (x_size,y_size) = self.GetClientSize()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
879 (x_pos,y_pos) = self.GetPositionTuple()
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
880 if self.IsMaximized(): max = 1
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
881 else: max = 0
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
882 xml_dom.setAttribute("height", str(y_size))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
883 xml_dom.setAttribute("width", str(x_size))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
884 xml_dom.setAttribute("posx", str(x_pos))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
885 xml_dom.setAttribute("posy", str(y_pos))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
886 xml_dom.setAttribute("maximized", str(max))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
887 layout = xml_dom.getElementsByTagName("DockLayout")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
888 try:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
889 textnode = self.xml.safe_get_text_node(layout[0])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
890 textnode._set_nodeValue(str(self._mgr.SavePerspective()))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
891 except:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
892 elem = self.xml.minidom.Element('DockLayout')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
893 elem.setAttribute("DO_NO_EDIT","True")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
894 textnode = self.xml.safe_get_text_node(elem)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
895 textnode._set_nodeValue(str(self._mgr.SavePerspective()))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
896 xml_dom.appendChild(elem)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
897 temp_file = open(filename, "w")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
898 temp_file.write(xml_dom.toxml(1))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
899 temp_file.close()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
900 self.orpgLog.log("Exit saveLayout()", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
901
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
902 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
903 def build_hotkeys(self):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
904 self.orpgLog.log("Enter orpgFrame->build_hotkeys(self)", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
905 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
906 self.mainmenu.accel.xaccel.extend(self.map.get_hot_keys())
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
907 self.orpgLog.log("Exit orpgFrame->build_hotkeys(self)", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
908
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
909 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
910 def start_timer(self):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
911 self.orpgLog.log("Enter orpgFrame->start_timer(self)", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
912 self.poll_timer.Start(100)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
913 s = component.get('settings')
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
914 if s.get_setting("Heartbeat") == "1":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
915 self.ping_timer.Start(1000*60)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
916 self.orpgLog.log("starting heartbeat...", ORPG_DEBUG, True)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
917 self.orpgLog.log("Exit orpgFrame->start_timer(self)", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
918
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
919 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
920 def kill_mplay_session(self):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
921 self.orpgLog.log("Enter orpgFrame->kill_mplay_session(self)", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
922 self.game_name = ""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
923 self.session.start_disconnect()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
924 self.orpgLog.log("Exit orpgFrame->kill_mplay_session(self)", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
925
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
926 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
927 def quit_game(self, evt):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
928 self.orpgLog.log("Enter orpgFrame->quit_game(self, evt)", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
929 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
930 if dlg.ShowModal() == wx.ID_YES:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
931 self.session.exitCondition.notifyAll()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
932 dlg.Destroy()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
933 self.kill_mplay_session()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
934 self.orpgLog.log("Exit orpgFrame->quit_game(self, evt)", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
935
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
936 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
937 def on_status_event(self, evt):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
938 self.orpgLog.log("Enter orpgFrame->on_status_event(self, evt)", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
939 id = evt.get_id()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
940 status = evt.get_data()
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
941 if id == orpg.networking.mplay_client.STATUS_SET_URL: self.status.set_url(status)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
942 self.orpgLog.log("Exit orpgFrame->on_status_event(self, evt)", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
943
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
944 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
945 def on_player_event(self, evt):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
946 self.orpgLog.log("Enter orpgFrame->on_player_event(self, evt)", ORPG_DEBUG)
0
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 player = evt.get_data()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
949 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
950 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
951 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
952 self.players.add_player(player)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
953 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
954 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
955 self.players.del_player(player)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
956 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
957 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
958 self.players.update_player(player)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
959 self.players.Refresh()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
960 self.orpgLog.log("Exit orpgFrame->on_player_event(self, evt)", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
961
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
962 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
963 def on_group_event(self, evt):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
964 self.orpgLog.log("Enter orpgFrame->on_group_event(self, evt)", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
965 id = evt.get_id()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
966 data = evt.get_data()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
967
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
968 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
969 elif id == orpg.networking.mplay_client.GROUP_DEL:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
970 self.password_manager.RemoveGroupData(data)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
971 self.gs.del_room(data)
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
972 elif id == orpg.networking.mplay_client.GROUP_UPDATE: self.gs.update_room(data)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
973 self.orpgLog.log("Exit orpgFrame->on_group_event(self, evt)", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
974
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
975 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
976 def on_receive(self, data, player):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
977 self.orpgLog.log("Enter orpgFrame->on_receive(self, data, player)", ORPG_DEBUG)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
978
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
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
980 (ignore_id,ignore_name) = self.session.get_ignore_list()
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
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
985 #recvSound = "RecvSound" # this will be the default sound. Whisper will change this below
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
986 if player: display_name = self.chat.chat_display_name(player)
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
987 else: display_name = "Server Administrator"
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
988
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
989 if data[:5] == "<tree":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
990 self.tree.on_receive_data(data,player)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
991 self.chat.InfoPost(display_name + " has sent you a tree node...")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
992
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
993 elif data[:4] == "<map": self.map.new_data(data)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
994
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
995 elif data[:5] == "<chat":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
996 msg = orpg.chat.chat_msg.chat_msg(data)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
997 self.chat.post_incoming_msg(msg,player)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
998 else:
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
999 """
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1000 all this below code is for comptiablity with older clients and can
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1001 be removed after a bit
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1002 """
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1003 import warnings
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1004 warnings.warn("Getting here is bad, find out how and fix it",
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1005 DeprecationWarning, 2)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1006 if data[:3] == "/me":
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1007 """
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1008 This fixes the emote coloring to comply with what has been
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1009 asked for by the user population, not to mention, what I
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1010 committed to many moons ago. In doing so, Woody's scheme has
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1011 been tossed out. I'm sure Woody won't be happy but I'm
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1012 invoking developer priveledge to satisfy user request, not to
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1013 mention, this scheme actually makes more sense. In Woody's
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1014 scheme, a user could over-ride another users emote color. This
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1015 doesn't make sense, rather, people dictate their OWN colors...
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1016 which is as it should be in the first place and is as it has
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1017 been with normal text. In short, this makes sense and is
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1018 consistent.
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1019 """
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1020 data = data.replace( "/me", "" )
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1021 """
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1022 Check to see if we find the closing '>' for the font within the
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1023 first 22 values
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1024 """
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1025 index = data[:22].find( ">" )
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1026 if index == -1:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1027 data = "** " + self.chat.colorize( self.chat.infocolor, display_name + data ) + " **"
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 else:
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1030 """
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1031 This means that we found a valid font string, so we can
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1032 simply plug the name into the string between the start and
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1033 stop font delimiter
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1034 """
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1035 print "pre data = " + data
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1036 data = data[:22] + "** " + display_name + " " + data[22:] + " **"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1037 print "post data = " + data
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1038
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1039 elif data[:2] == "/w":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1040 data = data.replace("/w","")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1041 data = "<b>" + display_name + "</b> (whispering): " + data
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1042
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1043 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1044 # Normal text
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1045 if player: data = "<b>" + display_name + "</b>: " + data
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1046 else: data = "<b><i><u>" + display_name + "</u>-></i></b> " + data
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1047 self.chat.Post(data)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1048
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1049 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1050 def on_mplay_event(self, evt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1051 id = evt.get_id()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1052 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
1053 self.chat.InfoPost("Game connected!")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1054 self.gs.set_connected(1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1055 self.password_manager.ClearPassword("ALL")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1056
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1057 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
1058 self.poll_timer.Stop()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1059 self.ping_timer.Stop()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1060 self.chat.SystemPost("Game disconnected!")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1061 self.players.reset()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1062 self.gs.set_connected(0)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1063 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
1064
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1065 ####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
1066 elif id == orpg.networking.mplay_client.MPLAY_DISCONNECTING:
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1067 settings = component.get('settings')
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1068 custom_msg = settings.get_setting("dcmsg")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1069 custom_msg=custom_msg[:80]
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1070 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
1071 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
1072 #####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
1073
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1074 elif id== orpg.networking.mplay_client.MPLAY_GROUP_CHANGE:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1075 group = evt.get_data()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1076 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
1077 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
1078 self.players.reset()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1079 elif id== orpg.networking.mplay_client.MPLAY_GROUP_CHANGE_F:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1080 self.chat.SystemPost("Room access denied!")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1081
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1082 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1083 def OnCloseWindow(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1084 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
1085 if dlg.ShowModal() == wx.ID_YES:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1086 dlg.Destroy()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1087 self.closed_confirmed()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1088
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1089 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1090 def closed_confirmed(self):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1091 self.activeplugins = component.get('plugins')
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1092 self.aliaslib.OnMB_FileSave(None)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1093
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1094 #following lines added by mDuo13
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1095 #########plugin_disabled()#########
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1096 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
1097 plugin = self.activeplugins[plugin_fname]
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1098 try: plugin.plugin_disabled()
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1099 except Exception, e:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1100 traceback.print_exc()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1101 #end mDuo13 added code
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1102 self.saveLayout()
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1103 try: self.settings.save()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1104 except Exception:
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1105 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
1106
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1107 try: self.map.pre_exit_cleanup()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1108 except Exception:
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1109 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
1110
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1111 try:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1112 save_tree = string.upper(self.settings.get_setting("SaveGameTreeOnExit"))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1113 if (save_tree != "0") and (save_tree != "False") and (save_tree != "NO"):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1114 self.tree.save_tree(self.settings.get_setting("gametree"))
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1115 except Exception:
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1116 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
1117
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1118 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
1119
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1120 try:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1121 #Kill all the damn timers
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1122 self.sound_player.timer.Stop()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1123 del self.sound_player.timer
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1124 except Exception:
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1125 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
1126
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1127 try:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1128 self.poll_timer.Stop()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1129 self.ping_timer.Stop()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1130 self.chat.parent.chat_timer.Stop()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1131 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
1132 self.map.canvas.image_timer.Stop()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1133 self.status.timer.Stop()
14
0b8b7e3ed78d Adding fixes from OpenRPG 1.8.0
sirebral
parents: 7
diff changeset
1134 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
1135 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
1136 except Exception:
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1137 logger.general("some timer didn't die properly.", True)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1138
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1139 self._mgr.UnInit()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1140 mainapp = wx.GetApp()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1141 mainapp.ExitMainLoop()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1142 self.Destroy()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1143
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1144 try:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1145 if self.server_pipe != None:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1146 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
1147 dlg.Update(2)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1148 dlg.Show(True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1149 self.server_pipe.write("\nkill\n")
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1150 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
1151 time.sleep(5)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1152 self.server_stop()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1153 self.server_pipe.close()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1154 self.std_out.close()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1155 self.server_thread.exit()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1156 dlg.Destroy()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1157 logger.general("Server killed:", True)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1158 except Exception:
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1159 pass
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1160
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1161
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1162 ########################################
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1163 ## Application class
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1164 ########################################
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1165 class orpgSplashScreen(wx.SplashScreen):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1166 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1167 def __init__(self, parent, bitmapfile, duration, callback):
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1168 wx.SplashScreen.__init__(self, wx.Bitmap(bitmapfile),
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1169 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
1170 self.callback = callback
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1171 self.closing = False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1172 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
1173
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1174 class orpgApp(wx.App):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1175 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1176 def OnInit(self):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1177
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1178 component.add('log', logger)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1179 component.add('xml', xml)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1180 #component.add('settings', settings)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1181 component.add('validate', validate)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1182 component.add("tabbedWindows", [])
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1183
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 26
diff changeset
1184 self.manifest = manifest.ManifestChanges()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1185
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1186 self.orpgLog = component.get('log')
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1187 self.validate = component.get('validate')
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1188 self.settings = component.get('settings')
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1189 logger.log_level = int(self.settings.get_setting('LoggingLevel'))
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1190 self.called = False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1191 wx.InitAllImageHandlers()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1192 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
1193 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
1194 self._crust = None
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1195 wx.Yield()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1196 return True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1197
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1198 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1199 def OnKeyPress(self, evt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1200 #Event handler
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1201 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
1202 else: evt.Skip()
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1203
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1204 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1205 def ShowShell(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1206 #Show the PyCrust window.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1207 if not self._crust:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1208 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
1209 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
1210 win = wx.FindWindowAtPointer()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1211 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
1212 self._crust.Show()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1213
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1214 @debugging
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1215 def AfterSplash(self,evt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1216 if not self.called:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1217 self.splash.Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1218 self.called = True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1219 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
1220 self.frame.Raise()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1221 self.frame.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1222 self.frame.Show(True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1223 self.SetTopWindow(self.frame)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1224 #self.frame.show_dlgs()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1225 self.frame.post_show_init()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1226 wx.CallAfter(self.splash.Close)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1227 return True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1228
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1229 @debugging
14
0b8b7e3ed78d Adding fixes from OpenRPG 1.8.0
sirebral
parents: 7
diff changeset
1230 def OnExit_CleanUp(self):
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1231 self.orpgLog.log("Preforming cleanup\n", ORPG_DEBUG)
19
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1232 try: del os.environ["OPENRPG_BASE"]
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1233 except: pass
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1234 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
1235 except: pass
78407d627cba Beginning of Code Clean-up. Some code untested, may break!
sirebral
parents: 14
diff changeset
1236 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
1237 except: pass
14
0b8b7e3ed78d Adding fixes from OpenRPG 1.8.0
sirebral
parents: 7
diff changeset
1238
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1239 @debugging
14
0b8b7e3ed78d Adding fixes from OpenRPG 1.8.0
sirebral
parents: 7
diff changeset
1240 def OnExit(self):
0b8b7e3ed78d Adding fixes from OpenRPG 1.8.0
sirebral
parents: 7
diff changeset
1241 self.OnExit_CleanUp()
5
5a2c95067daf This update causes the software to remove approot.py and approot.pyc
sirebral
parents: 4
diff changeset
1242 #Exit
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 61
diff changeset
1243 self.orpgLog.log("Main Application Exit\n\n", ORPG_DEBUG)