comparison orpg/tools/orpg_settings.py @ 164:d263c8ff4d7c beta

Traipse Beta 'OpenRPG' {091202-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 Gametree Recursion method, mapping, context sensitivity, and effeciency.. New Features node with bonus nodes and Node Referencing help added Added 7th Sea die roller method; 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)]. Includes support for Mythos roller. 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 Fixed Whiteboard ID to prevent random line or text deleting. Modified ID's to prevent non updated clients from ruining the fix. default_manifest.xml renamed to default_upmana.xml Fix to Update Manager; cleaner clode for saved repositories Fixes made to Settings Panel and no reactive settings when Ok is pressed.
author sirebral
date Wed, 02 Dec 2009 21:21:34 -0600
parents dcf4fbe09b70
children b7206781c254
comparison
equal deleted inserted replaced
162:e3714f232f2f 164:d263c8ff4d7c
129 129
130 for i in xrange(0,len(self.changes)): 130 for i in xrange(0,len(self.changes)):
131 self.settings.set_setting(self.changes[i][0], self.changes[i][1]) 131 self.settings.set_setting(self.changes[i][0], self.changes[i][1])
132 top_frame = component.get('frame') 132 top_frame = component.get('frame')
133 133
134 if self.changes[i][0] == 'defaultfontsize' or self.changes[i][0] == 'defaultfont': 134 ## Settings are now reactive and organized ##
135 self.chat.chatwnd.SetDefaultFontAndSize(self.settings.get_setting('defaultfont'), 135 ok = {'IdleStatusAlias': self.chat.chat_cmds.on_status,
136 self.settings.get_setting('defaultfontsize')) 136 'dieroller': self.dieroller_ok,
137 self.chat.InfoPost("Font is now " + 137 'defaultfontsize': self.font_ok,
138 self.settings.get_setting('defaultfont') + " point size " + 138 'defaultfont': self.font_ok,
139 self.settings.get_setting('defaultfontsize')) 139 'bgcolor': self.text_ok,
140 self.chat.chatwnd.scroll_down() 140 'textcolor': self.text_ok,
141 141 'ColorTree': self.colortree_ok,
142 if self.changes[i][0] == 'bgcolor' or self.changes[i][0] == 'textcolor': 142 'player': self.session.set_name,
143 self.chat.chatwnd.SetPage(self.chat.ResetPage()) 143 'TabBackgroundGradient': self.tab_gradient_ok}
144 self.chat.chatwnd.scroll_down() 144
145 if self.settings.get_setting('ColorTree') == '1': 145 if self.changes[i][0] in ok.keys(): ok[self.changes[i][0]](self.changes[i][1])
146 top_frame.tree.SetBackgroundColour(self.settings.get_setting('bgcolor')) 146
147 top_frame.tree.SetForegroundColour(self.settings.get_setting('textcolor')) 147 elif self.changes[i][0] == 'GMWhisperTab' and self.changes[i][1] == '1': self.chat.parent.create_gm_tab()
148 top_frame.tree.Refresh() 148
149 top_frame.players.SetBackgroundColour(self.settings.get_setting('bgcolor')) 149 elif (self.changes[i][0][:3] == 'Tab' and self.changes[i][1][:6] == 'custom') or\
150 top_frame.players.SetForegroundColour(self.settings.get_setting('textcolor'))
151 top_frame.players.Refresh()
152 else:
153 top_frame.tree.SetBackgroundColour('white')
154 top_frame.tree.SetForegroundColour('black')
155 top_frame.tree.Refresh()
156 top_frame.players.SetBackgroundColour('white')
157 top_frame.players.SetForegroundColour('black')
158 top_frame.players.Refresh()
159
160 if self.changes[i][0] == 'ColorTree':
161 if self.changes[i][1] == '1':
162 top_frame.tree.SetBackgroundColour(self.settings.get_setting('bgcolor'))
163 top_frame.tree.SetForegroundColour(self.settings.get_setting('textcolor'))
164 top_frame.tree.Refresh()
165 top_frame.players.SetBackgroundColour(self.settings.get_setting('bgcolor'))
166 top_frame.players.SetForegroundColour(self.settings.get_setting('textcolor'))
167 top_frame.players.Refresh()
168 else:
169 top_frame.tree.SetBackgroundColour('white')
170 top_frame.tree.SetForegroundColour('black')
171 top_frame.tree.Refresh()
172 top_frame.players.SetBackgroundColour('white')
173 top_frame.players.SetForegroundColour('black')
174 top_frame.players.Refresh()
175
176 if self.changes[i][0] == 'GMWhisperTab' and self.changes[i][1] == '1': self.chat.parent.create_gm_tab()
177 self.toggleToolBars(self.chat, self.changes[i])
178 try: self.toggleToolBars(self.chat.parent.GMChatPanel, self.changes[i])
179 except: pass
180 for panel in self.chat.parent.whisper_tabs: self.toggleToolBars(panel, self.changes[i])
181 for panel in self.chat.parent.group_tabs: self.toggleToolBars(panel, self.changes[i])
182 for panel in self.chat.parent.null_tabs: self.toggleToolBars(panel, self.changes[i])
183
184 if self.changes[i][0] == 'player': self.session.name = str(self.changes[i][1])
185
186 if (self.changes[i][0][:3] == 'Tab' and self.changes[i][1][:6] == 'custom') or\
187 (self.changes[i][0][:3] == 'Tab' and self.settings.get_setting('TabTheme')[:6] == 'custom'): 150 (self.changes[i][0][:3] == 'Tab' and self.settings.get_setting('TabTheme')[:6] == 'custom'):
188
189 gfrom = self.settings.get_setting('TabGradientFrom') 151 gfrom = self.settings.get_setting('TabGradientFrom')
190 (fred, fgreen, fblue) = rgbconvert.rgb_tuple(gfrom) 152 (fred, fgreen, fblue) = rgbconvert.rgb_tuple(gfrom)
191
192 gto = self.settings.get_setting('TabGradientTo') 153 gto = self.settings.get_setting('TabGradientTo')
193 (tored, togreen, toblue) = rgbconvert.rgb_tuple(gto) 154 (tored, togreen, toblue) = rgbconvert.rgb_tuple(gto)
194
195 tabtext = self.settings.get_setting('TabTextColor') 155 tabtext = self.settings.get_setting('TabTextColor')
196 (tred, tgreen, tblue) = rgbconvert.rgb_tuple(tabtext) 156 (tred, tgreen, tblue) = rgbconvert.rgb_tuple(tabtext)
197
198 for wnd in tabbedwindows: 157 for wnd in tabbedwindows:
199 style = wnd.GetWindowStyleFlag() 158 style = wnd.GetWindowStyleFlag()
200 # remove old tabs style
201 mirror = ~(FNB.FNB_VC71 | FNB.FNB_VC8 | FNB.FNB_FANCY_TABS | FNB.FNB_COLORFUL_TABS) 159 mirror = ~(FNB.FNB_VC71 | FNB.FNB_VC8 | FNB.FNB_FANCY_TABS | FNB.FNB_COLORFUL_TABS)
202 style &= mirror 160 style &= mirror
203 if self.settings.get_setting('TabTheme') == 'customslant': style |= FNB.FNB_VC8 161 if self.settings.get_setting('TabTheme') == 'customslant': style |= FNB.FNB_VC8
204 else: style |= FNB.FNB_FANCY_TABS 162 else: style |= FNB.FNB_FANCY_TABS
205 wnd.SetWindowStyleFlag(style) 163 wnd.SetWindowStyleFlag(style)
206 wnd.SetGradientColourTo(wx.Color(tored, togreen, toblue)) 164 wnd.SetGradientColourTo(wx.Color(tored, togreen, toblue))
207 wnd.SetGradientColourFrom(wx.Color(fred, fgreen, fblue)) 165 wnd.SetGradientColourFrom(wx.Color(fred, fgreen, fblue))
208 wnd.SetNonActiveTabTextColour(wx.Color(tred, tgreen, tblue)) 166 wnd.SetNonActiveTabTextColour(wx.Color(tred, tgreen, tblue))
209 wnd.Refresh() 167 wnd.Refresh()
210 168
211 if self.changes[i][0] == 'TabBackgroundGradient': 169 self.toggleToolBars(self.chat, self.changes[i])
212 for wnd in tabbedwindows: 170 try: self.toggleToolBars(self.chat.parent.GMChatPanel, self.changes[i])
213 (red, green, blue) = rgbconvert.rgb_tuple(self.changes[i][1]) 171 except: pass
214 wnd.SetTabAreaColour(wx.Color(red, green, blue)) 172 for panel in self.chat.parent.whisper_tabs: self.toggleToolBars(panel, self.changes[i])
215 wnd.Refresh() 173 for panel in self.chat.parent.group_tabs: self.toggleToolBars(panel, self.changes[i])
174 for panel in self.chat.parent.null_tabs: self.toggleToolBars(panel, self.changes[i])
175
216 self.settings.save() 176 self.settings.save()
217 self.Destroy() 177 self.Destroy()
178
179 def tab_gradient_ok(self, changes):
180 for wnd in tabbedwindows:
181 (red, green, blue) = rgbconvert.rgb_tuple(changes)
182 wnd.SetTabAreaColour(wx.Color(red, green, blue))
183 wnd.Refresh()
184
185 def dieroller_ok(self, changes):
186 rm = component.get('DiceManager')
187 try:
188 rm.setRoller(changes)
189 self.chat.SystemPost('You have changed your die roller to the <b>"' + changes + '"</b> roller.')
190 except:
191 rm.setRoller('std')
192 self.settings.change('dieroller', 'std')
193 self.chat.SystemPost('<b>"' + changes + '"</b> is an invalid roller. Setting roller to <b>"std"</b>')
194
195 def colortree_ok(self, changes):
196 if changes == '1':
197 top_frame.tree.SetBackgroundColour(self.settings.get_setting('bgcolor'))
198 top_frame.tree.SetForegroundColour(self.settings.get_setting('textcolor'))
199 top_frame.tree.Refresh()
200 top_frame.players.SetBackgroundColour(self.settings.get_setting('bgcolor'))
201 top_frame.players.SetForegroundColour(self.settings.get_setting('textcolor'))
202 top_frame.players.Refresh()
203 else:
204 top_frame.tree.SetBackgroundColour('white')
205 top_frame.tree.SetForegroundColour('black')
206 top_frame.tree.Refresh()
207 top_frame.players.SetBackgroundColour('white')
208 top_frame.players.SetForegroundColour('black')
209 top_frame.players.Refresh()
210
211 def font_ok(self, changes):
212 self.chat.chatwnd.SetDefaultFontAndSize(self.settings.get_setting('defaultfont'),
213 self.settings.get_setting('defaultfontsize'))
214 self.chat.InfoPost("Font is now " +
215 self.settings.get_setting('defaultfont') + " point size " +
216 self.settings.get_setting('defaultfontsize'))
217 self.chat.chatwnd.scroll_down()
218
219 def text_ok(self, changes):
220 self.chat.chatwnd.SetPage(self.chat.ResetPage())
221 self.chat.chatwnd.scroll_down()
222 if self.settings.get_setting('ColorTree') == '1':
223 top_frame.tree.SetBackgroundColour(self.settings.get_setting('bgcolor'))
224 top_frame.tree.SetForegroundColour(self.settings.get_setting('textcolor'))
225 top_frame.tree.Refresh()
226 top_frame.players.SetBackgroundColour(self.settings.get_setting('bgcolor'))
227 top_frame.players.SetForegroundColour(self.settings.get_setting('textcolor'))
228 top_frame.players.Refresh()
229 else:
230 top_frame.tree.SetBackgroundColour('white')
231 top_frame.tree.SetForegroundColour('black')
232 top_frame.tree.Refresh()
233 top_frame.players.SetBackgroundColour('white')
234 top_frame.players.SetForegroundColour('black')
235 top_frame.players.Refresh()
218 236
219 def toggleToolBars(self, panel, changes): 237 def toggleToolBars(self, panel, changes):
220 if changes[0] == 'AliasTool_On': panel.toggle_alias(changes[1]) 238 if changes[0] == 'AliasTool_On': panel.toggle_alias(changes[1])
221 elif changes[0] == 'DiceButtons_On': panel.toggle_dice(changes[1]) 239 elif changes[0] == 'DiceButtons_On': panel.toggle_dice(changes[1])
222 elif changes[0] == 'FormattingButtons_On': panel.toggle_formating(changes[1]) 240 elif changes[0] == 'FormattingButtons_On': panel.toggle_formating(changes[1])