annotate orpg/tools/orpg_settings.py @ 183:0d9b746b5751 beta

Traipse Beta 'OpenRPG' {100115-00} Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc's main goal is to offer more advanced features and enhance the productivity of the user. Update Summary (Beta) New Features: Added Bookmarks Added 'boot' command to remote admin Added confirmation window for sent nodes Minor changes to allow for portability to an OpenSUSE linux OS Miniatures Layer pop up box allows users to turn off Mini labels, from FlexiRPG Zoom Mouse plugin added Images added to Plugin UI Switching to Element Tree Map efficiency, from FlexiRPG Added Status Bar to Update Manager New TrueDebug Class in orpg_log (See documentation for usage) Portable Mercurial Tip of the Day added, from Core and community New Reference Syntax added for custom PC sheets New Child Reference for gametree New Parent Reference for gametree New Gametree Recursion method, mapping, context sensitivity, and effeciency.. New Features node with bonus nodes and Node Referencing help added Dieroller structure from Core New DieRoller portability for odd Dice Added 7th Sea die roller; ie [7k3] = [7d10.takeHighest(3).open(10)] New 'Mythos' System die roller added Added new vs. die roller method for WoD; ie [3v3] = [3d10.vs(3)]. Included for Mythos roller also New Warhammer FRPG Die Roller (Special thanks to Puu-san for the support) New EZ_Tree Reference system. Push a button, Traipse the tree, get a reference (Beta!) Fixes: Fix to Text based Server Fix to Remote Admin Commands Fix to Pretty Print, from Core Fix to Splitter Nodes not being created Fix to massive amounts of images loading, from Core Fix to Map from gametree not showing to all clients Fix to gametree about menus Fix to Password Manager check on startup Fix to PC Sheets from tool nodes. They now use the tabber_panel Fix to Whiteboard ID to prevent random line or text deleting. Fixes to Server, Remote Server, and Server GUI Fix to Update Manager; cleaner clode for saved repositories Fixes made to Settings Panel and now reactive settings when Ok is pressed Fixes to Alternity roller's attack roll. Uses a simple Tuple instead of a Splice Fix to Use panel of Forms and Tabbers. Now longer enters design mode Fix made Image Fetching. New fetching image and new failed image Modified ID's to prevent non updated clients from ruining the fix. default_manifest.xml renamed to default_upmana.xml
author sirebral
date Fri, 15 Jan 2010 23:01:42 -0600
parents ff48c2741fe7
children 13054be69834
rev   line source
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1 # 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
2 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3 # openrpg-dev@lists.sourceforge.net
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
5 # 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
6 # 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
7 # 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
8 # (at your option) any later version.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
9 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
10 # 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
11 # 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
12 # 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
13 # 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
14 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
15 # 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
16 # 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
17 # 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
18 # --
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 # File: orpg_settings.py
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
21 # Author: Dj Gilcrease
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
22 # Maintainer:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
23 # Version:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
24 # $Id: orpg_settings.py,v 1.51 2007/07/15 14:25:12 digitalxero Exp $
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
25 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
26 # Description: classes for orpg settings
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
27 #
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 from orpg.orpg_windows import *
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 65
diff changeset
30 from orpg.orpgCore import component
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 65
diff changeset
31 from orpg.dirpath import dir_struct
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
32 from rgbhex import *
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
33
92
68c7bd272f27 Traipse Beta 'OpenRPG' {090919-00}
sirebral
parents: 66
diff changeset
34 from orpg.tools.orpg_log import logger
68c7bd272f27 Traipse Beta 'OpenRPG' {090919-00}
sirebral
parents: 66
diff changeset
35 from orpg.tools.validate import validate
68c7bd272f27 Traipse Beta 'OpenRPG' {090919-00}
sirebral
parents: 66
diff changeset
36 from orpg.orpg_xml import xml
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
37 from orpg.tools.settings import settings
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
38
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
39 class orpgSettingsWnd(wx.Dialog):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
40 def __init__(self, parent):
65
4840657c23c5 Traipse Dev 'OpenRPG' {090817-02}
sirebral
parents: 26
diff changeset
41 wx.Dialog.__init__(self,parent,-1,"OpenRPG Preferences",
4840657c23c5 Traipse Dev 'OpenRPG' {090817-02}
sirebral
parents: 26
diff changeset
42 wx.DefaultPosition,size = wx.Size(-1,-1),
4840657c23c5 Traipse Dev 'OpenRPG' {090817-02}
sirebral
parents: 26
diff changeset
43 style=wx.RESIZE_BORDER | wx.SYSTEM_MENU | wx.CAPTION)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
44 self.Freeze()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 65
diff changeset
45 self.settings = component.get("settings")
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 65
diff changeset
46 self.chat = component.get("chat")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
47 self.changes = []
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
48 self.SetMinSize((545,500))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
49 self.tabber = orpgTabberWnd(self, style=FNB.FNB_NO_X_BUTTON)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
50 self.build_gui()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
51 self.tabber.SetSelection(0)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
52 winsizer = wx.BoxSizer(wx.VERTICAL)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
53 sizer = wx.BoxSizer(wx.HORIZONTAL)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
54 sizer.Add(wx.Button(self, wx.ID_OK, "OK"), 1, wx.EXPAND)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
55 sizer.Add(wx.Size(10,10))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
56 sizer.Add(wx.Button(self, wx.ID_CANCEL, "Cancel"), 1, wx.EXPAND)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
57 winsizer.Add(self.tabber, 1, wx.EXPAND)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
58 winsizer.Add(sizer, 0, wx.EXPAND | wx.ALIGN_BOTTOM)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
59 self.winsizer = winsizer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
60 self.SetSizer(self.winsizer)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
61 self.SetAutoLayout(True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
62 self.Fit()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
63 self.Bind(wx.EVT_BUTTON, self.onOk, id=wx.ID_OK)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
64 self.Thaw()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
65
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
66 def on_size(self,evt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
67 (w,h) = self.GetClientSizeTuple()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
68 self.winsizer.SetDimension(0,0,w,h-25)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
69
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
70 def build_gui(self):
92
68c7bd272f27 Traipse Beta 'OpenRPG' {090919-00}
sirebral
parents: 66
diff changeset
71 validate.config_file("settings.xml","default_settings.xml")
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 65
diff changeset
72 filename = dir_struct["user"] + "settings.xml"
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
73 temp_file = open(filename)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
74 temp_file.close()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
75 children = self.settings.xml_dom._get_childNodes()
25
69149263026d This patch fixes the problem that occurs when users attempt to change
sirebral
parents: 0
diff changeset
76 for c in children: self.build_window(c,self.tabber)
0
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 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
79 name = xml_dom._get_nodeName()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
80 #container = 0
25
69149263026d This patch fixes the problem that occurs when users attempt to change
sirebral
parents: 0
diff changeset
81 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
82 return temp_wnd
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
83
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
84 def do_tab_window(self, xml_dom, parent_wnd):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
85 type = xml_dom.getAttribute("type")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
86 name = xml_dom.getAttribute("name")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
87
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
88 if type == "grid":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
89 temp_wnd = self.do_grid_tab(xml_dom, parent_wnd)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
90 parent_wnd.AddPage(temp_wnd, name, False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
91 elif type == "tab":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
92 temp_wnd = orpgTabberWnd(parent_wnd, style=FNB.FNB_NO_X_BUTTON)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
93 children = xml_dom._get_childNodes()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
94 for c in children:
25
69149263026d This patch fixes the problem that occurs when users attempt to change
sirebral
parents: 0
diff changeset
95 if c._get_nodeName() == "tab": self.do_tab_window(c, temp_wnd)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
96 temp_wnd.SetSelection(0)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
97 parent_wnd.AddPage(temp_wnd, name, False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
98 elif type == "text":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
99 temp_wnd = wx.TextCtrl(parent_wnd,-1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
100 parent_wnd.AddPage(temp_wnd, name, False)
25
69149263026d This patch fixes the problem that occurs when users attempt to change
sirebral
parents: 0
diff changeset
101 else: temp_wnd = None
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
102 return temp_wnd
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
103
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
104 def do_grid_tab(self, xml_dom, parent_wnd):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
105 settings = []
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
106 children = xml_dom._get_childNodes()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
107 for c in children:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
108 name = c._get_nodeName()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
109 value = c.getAttribute("value")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
110 help = c.getAttribute("help")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
111 options = c.getAttribute("options")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
112 settings.append([name, value, options, help])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
113 temp_wnd = settings_grid(parent_wnd, settings, self.changes)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
114 return temp_wnd
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
115
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
116 def onOk(self, evt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
117 #This will write the settings back to the XML
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 65
diff changeset
118 self.session = component.get("session")
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 65
diff changeset
119 tabbedwindows = component.get("tabbedWindows")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
120 new = []
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
121 for wnd in tabbedwindows:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
122 try:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
123 style = wnd.GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
124 new.append(wnd)
25
69149263026d This patch fixes the problem that occurs when users attempt to change
sirebral
parents: 0
diff changeset
125 except: pass
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
126 tabbedwindows = new
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 65
diff changeset
127 component.add("tabbedWindows", tabbedwindows)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
128 rgbconvert = RGBHex()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
129
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
130 for i in xrange(0,len(self.changes)):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
131 self.settings.set_setting(self.changes[i][0], self.changes[i][1])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
132
164
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
133 ## Settings are now reactive and organized ##
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
134 ok = {'IdleStatusAlias': self.chat.chat_cmds.on_status,
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
135 'dieroller': self.dieroller_ok,
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
136 'defaultfontsize': self.font_ok,
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
137 'defaultfont': self.font_ok,
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
138 'bgcolor': self.text_ok,
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
139 'textcolor': self.text_ok,
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
140 'ColorTree': self.colortree_ok,
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
141 'player': self.session.set_name,
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
142 'TabBackgroundGradient': self.tab_gradient_ok}
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
143
164
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
144 if self.changes[i][0] in ok.keys(): ok[self.changes[i][0]](self.changes[i][1])
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
145
164
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
146 elif self.changes[i][0] == 'GMWhisperTab' and self.changes[i][1] == '1': self.chat.parent.create_gm_tab()
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
147
164
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
148 elif (self.changes[i][0][:3] == 'Tab' and self.changes[i][1][:6] == 'custom') or\
25
69149263026d This patch fixes the problem that occurs when users attempt to change
sirebral
parents: 0
diff changeset
149 (self.changes[i][0][:3] == 'Tab' and self.settings.get_setting('TabTheme')[:6] == 'custom'):
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
150 gfrom = self.settings.get_setting('TabGradientFrom')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
151 (fred, fgreen, fblue) = rgbconvert.rgb_tuple(gfrom)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
152 gto = self.settings.get_setting('TabGradientTo')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
153 (tored, togreen, toblue) = rgbconvert.rgb_tuple(gto)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
154 tabtext = self.settings.get_setting('TabTextColor')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
155 (tred, tgreen, tblue) = rgbconvert.rgb_tuple(tabtext)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
156 for wnd in tabbedwindows:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
157 style = wnd.GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
158 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
159 style &= mirror
25
69149263026d This patch fixes the problem that occurs when users attempt to change
sirebral
parents: 0
diff changeset
160 if self.settings.get_setting('TabTheme') == 'customslant': style |= FNB.FNB_VC8
69149263026d This patch fixes the problem that occurs when users attempt to change
sirebral
parents: 0
diff changeset
161 else: style |= FNB.FNB_FANCY_TABS
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
162 wnd.SetWindowStyleFlag(style)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
163 wnd.SetGradientColourTo(wx.Color(tored, togreen, toblue))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
164 wnd.SetGradientColourFrom(wx.Color(fred, fgreen, fblue))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
165 wnd.SetNonActiveTabTextColour(wx.Color(tred, tgreen, tblue))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
166 wnd.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
167
164
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
168 self.toggleToolBars(self.chat, self.changes[i])
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
169 try: self.toggleToolBars(self.chat.parent.GMChatPanel, self.changes[i])
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
170 except: pass
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
171 for panel in self.chat.parent.whisper_tabs: self.toggleToolBars(panel, self.changes[i])
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
172 for panel in self.chat.parent.group_tabs: self.toggleToolBars(panel, self.changes[i])
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
173 for panel in self.chat.parent.null_tabs: self.toggleToolBars(panel, self.changes[i])
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
174
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
175 self.settings.save()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
176 self.Destroy()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
177
164
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
178 def tab_gradient_ok(self, changes):
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
179 for wnd in tabbedwindows:
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
180 (red, green, blue) = rgbconvert.rgb_tuple(changes)
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
181 wnd.SetTabAreaColour(wx.Color(red, green, blue))
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
182 wnd.Refresh()
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
183
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
184 def dieroller_ok(self, changes):
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
185 rm = component.get('DiceManager')
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
186 try:
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
187 rm.setRoller(changes)
183
0d9b746b5751 Traipse Beta 'OpenRPG' {100115-00}
sirebral
parents: 171
diff changeset
188 self.chat.SystemPost('You have changed your die roller to the <b>"' + rm.getRoller() + '"</b> roller.')
0d9b746b5751 Traipse Beta 'OpenRPG' {100115-00}
sirebral
parents: 171
diff changeset
189 except Exception, e:
0d9b746b5751 Traipse Beta 'OpenRPG' {100115-00}
sirebral
parents: 171
diff changeset
190 print e
164
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
191 rm.setRoller('std')
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
192 self.settings.change('dieroller', 'std')
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
193 self.chat.SystemPost('<b>"' + changes + '"</b> is an invalid roller. Setting roller to <b>"std"</b>')
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
194
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
195 def colortree_ok(self, changes):
183
0d9b746b5751 Traipse Beta 'OpenRPG' {100115-00}
sirebral
parents: 171
diff changeset
196 top_frame = component.get('frame')
164
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
197 if changes == '1':
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
198 top_frame.tree.SetBackgroundColour(self.settings.get_setting('bgcolor'))
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
199 top_frame.tree.SetForegroundColour(self.settings.get_setting('textcolor'))
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
200 top_frame.tree.Refresh()
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
201 top_frame.players.SetBackgroundColour(self.settings.get_setting('bgcolor'))
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
202 top_frame.players.SetForegroundColour(self.settings.get_setting('textcolor'))
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
203 top_frame.players.Refresh()
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
204 else:
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
205 top_frame.tree.SetBackgroundColour('white')
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
206 top_frame.tree.SetForegroundColour('black')
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
207 top_frame.tree.Refresh()
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
208 top_frame.players.SetBackgroundColour('white')
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
209 top_frame.players.SetForegroundColour('black')
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
210 top_frame.players.Refresh()
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
211
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
212 def font_ok(self, changes):
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
213 self.chat.chatwnd.SetDefaultFontAndSize(self.settings.get_setting('defaultfont'),
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
214 self.settings.get_setting('defaultfontsize'))
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
215 self.chat.InfoPost("Font is now " +
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
216 self.settings.get_setting('defaultfont') + " point size " +
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
217 self.settings.get_setting('defaultfontsize'))
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
218 self.chat.chatwnd.scroll_down()
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
219
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
220 def text_ok(self, changes):
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
221 self.chat.chatwnd.SetPage(self.chat.ResetPage())
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
222 self.chat.chatwnd.scroll_down()
183
0d9b746b5751 Traipse Beta 'OpenRPG' {100115-00}
sirebral
parents: 171
diff changeset
223 top_frame = component.get('frame')
164
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
224 if self.settings.get_setting('ColorTree') == '1':
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
225 top_frame.tree.SetBackgroundColour(self.settings.get_setting('bgcolor'))
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
226 top_frame.tree.SetForegroundColour(self.settings.get_setting('textcolor'))
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
227 top_frame.tree.Refresh()
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
228 top_frame.players.SetBackgroundColour(self.settings.get_setting('bgcolor'))
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
229 top_frame.players.SetForegroundColour(self.settings.get_setting('textcolor'))
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
230 top_frame.players.Refresh()
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
231 else:
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
232 top_frame.tree.SetBackgroundColour('white')
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
233 top_frame.tree.SetForegroundColour('black')
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
234 top_frame.tree.Refresh()
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
235 top_frame.players.SetBackgroundColour('white')
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
236 top_frame.players.SetForegroundColour('black')
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
237 top_frame.players.Refresh()
d263c8ff4d7c Traipse Beta 'OpenRPG' {091202-00}
sirebral
parents: 135
diff changeset
238
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
239 def toggleToolBars(self, panel, changes):
25
69149263026d This patch fixes the problem that occurs when users attempt to change
sirebral
parents: 0
diff changeset
240 if changes[0] == 'AliasTool_On': panel.toggle_alias(changes[1])
69149263026d This patch fixes the problem that occurs when users attempt to change
sirebral
parents: 0
diff changeset
241 elif changes[0] == 'DiceButtons_On': panel.toggle_dice(changes[1])
69149263026d This patch fixes the problem that occurs when users attempt to change
sirebral
parents: 0
diff changeset
242 elif changes[0] == 'FormattingButtons_On': panel.toggle_formating(changes[1])
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
243
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
244 class settings_grid(wx.grid.Grid):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
245 """grid for gen info"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
246 def __init__(self, parent, settings, changed = []):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
247 wx.grid.Grid.__init__(self, parent, -1, style=wx.SUNKEN_BORDER | wx.WANTS_CHARS)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
248 self.setting_data = changed
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
249 self.Bind(wx.EVT_SIZE, self.on_size)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
250 self.Bind(wx.grid.EVT_GRID_CELL_CHANGE, self.on_cell_change)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
251 self.Bind(wx.grid.EVT_GRID_CELL_LEFT_CLICK, self.on_left_click)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
252 self.CreateGrid(len(settings),3)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
253 self.SetRowLabelSize(0)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
254 self.SetColLabelValue(0,"Setting")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
255 self.SetColLabelValue(1,"Value")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
256 self.SetColLabelValue(2,"Available Options")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
257 self.settings = settings
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
258 for i in range(len(settings)):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
259 self.SetCellValue(i,0,settings[i][0])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
260 self.SetCellValue(i,1,settings[i][1])
25
69149263026d This patch fixes the problem that occurs when users attempt to change
sirebral
parents: 0
diff changeset
261 if settings[i][1] and settings[i][1][0] == '#': self.SetCellBackgroundColour(i,1,settings[i][1])
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
262 self.SetCellValue(i,2,settings[i][2])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
263
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
264 def on_left_click(self,evt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
265 row = evt.GetRow()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
266 col = evt.GetCol()
25
69149263026d This patch fixes the problem that occurs when users attempt to change
sirebral
parents: 0
diff changeset
267 if col == 2: return
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
268 elif col == 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
269 name = self.GetCellValue(row,0)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
270 str = self.settings[row][3]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
271 msg = wx.MessageBox(str,name)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
272 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
273 elif col == 1:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
274 setting = self.GetCellValue(row,0)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
275 value = self.GetCellValue(row,1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
276 if value and value[0] == '#':
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
277 hexcolor = orpg.tools.rgbhex.RGBHex().do_hex_color_dlg(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
278 if hexcolor:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
279 self.SetCellValue(row,2, hexcolor)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
280 self.SetCellBackgroundColour(row,1,hexcolor)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
281 self.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
282 setting = self.GetCellValue(row,0)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
283 self.setting_data.append([setting, hexcolor])
25
69149263026d This patch fixes the problem that occurs when users attempt to change
sirebral
parents: 0
diff changeset
284 else: evt.Skip()
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
285
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
286 def on_cell_change(self,evt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
287 row = evt.GetRow()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
288 col = evt.GetCol()
25
69149263026d This patch fixes the problem that occurs when users attempt to change
sirebral
parents: 0
diff changeset
289 if col != 1: return
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
290 setting = self.GetCellValue(row,0)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
291 value = self.GetCellValue(row,1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
292 self.setting_data.append([setting, value])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
293
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
294 def get_h(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
295 (w,h) = self.GetClientSizeTuple()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
296 rows = self.GetNumberRows()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
297 minh = 0
25
69149263026d This patch fixes the problem that occurs when users attempt to change
sirebral
parents: 0
diff changeset
298 for i in range (0,rows): minh += self.GetRowSize(i)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
299 minh += 120
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
300 return minh
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
301
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
302 def on_size(self,evt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
303 (w,h) = self.GetClientSizeTuple()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
304 cols = self.GetNumberCols()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
305 col_w = w/(cols)
25
69149263026d This patch fixes the problem that occurs when users attempt to change
sirebral
parents: 0
diff changeset
306 for i in range(0,cols): self.SetColSize(i,col_w)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
307 self.Refresh()
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 65
diff changeset
308
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
309 #settings = orpg.tools.settings.Settings()