Mercurial > traipse_dev
changeset 163:565ab3d84430 alpha
Traipse Alpha '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 (Keeping up with 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:20:44 -0600 |
parents | a766e1cbcb7c |
children | eef2463cd441 |
files | orpg/dieroller/die.py orpg/dieroller/utils.py orpg/gametree/nodehandlers/chatmacro.py orpg/mapper/whiteboard.py orpg/orpg_version.py orpg/plugindb.py orpg/tools/orpg_settings.py |
diffstat | 7 files changed, 167 insertions(+), 208 deletions(-) [+] |
line wrap: on
line diff
--- a/orpg/dieroller/die.py Sat Nov 28 01:25:20 2009 -0600 +++ b/orpg/dieroller/die.py Wed Dec 02 21:20:44 2009 -0600 @@ -37,64 +37,43 @@ class die_base(UserList.UserList): - def __init__(self,source = []): if isinstance(source, (int, float, basestring)): s = [] s.append(di(source)) - else: - s = source + else: s = source UserList.UserList.__init__(self,s) - - def sum(self): s = 0 for a in self.data: s += int(a) return s - def __lshift__(self,other): - if type(other) == type(3) or type(other) == type(3.0): - o = other - elif hasattr(other,"sum"): - o = other.sum() - else: - return None - + if type(other) == type(3) or type(other) == type(3.0): o = other + elif hasattr(other,"sum"): o = other.sum() + else: return None result = [] for die in self: - if die < o: - result.append(die) + if die < o: result.append(die) return self.__class__(result) - def __rshift__(self,other): - - if type(other) == type(3) or type(other) == type(3.0): - o = other - elif hasattr(other,"sum"): - o = other.sum() - else: - return None - + if type(other) == type(3) or type(other) == type(3.0): o = other + elif hasattr(other,"sum"): o = other.sum() + else: return None result = [] for die in self: - if die > o: - result.append(die) + if die > o: result.append(die) return self.__class__(result) - def __rlshift__(self,other): return self.__rshift__(other) - def __rrshift__(self,other): return self.__lshift__(other) - - def __str__(self): if len(self.data) > 0: myStr = "[" + str(self.data[0]) @@ -102,102 +81,60 @@ myStr += "," myStr += str(a) myStr += "] = (" + str(self.sum()) + ")" - else: - myStr = "[] = (0)" + else: myStr = "[] = (0)" return myStr - def __lt__(self,other): - if type(other) == type(3) or type(other) == type(3.0): - return (self.sum() < other) - elif hasattr(other,"sum"): - return (self.sum() < other.sum()) - else: - return UserList.UserList.__lt__(self,other) + if type(other) == type(3) or type(other) == type(3.0): return (self.sum() < other) + elif hasattr(other,"sum"): return (self.sum() < other.sum()) + else: return UserList.UserList.__lt__(self,other) - def __le__(self,other): - if type(other) == type(3) or type(other) == type(3.0): - return (self.sum() <= other) - elif hasattr(other,"sum"): - return (self.sum() <= other.sum()) - else: - return UserList.UserList.__le__(self,other) + if type(other) == type(3) or type(other) == type(3.0): return (self.sum() <= other) + elif hasattr(other,"sum"): return (self.sum() <= other.sum()) + else: return UserList.UserList.__le__(self,other) - def __eq__(self,other): - if type(other) == type(3) or type(other) == type(3.0): - return (self.sum() == other) - elif hasattr(other,"sum"): - return (self.sum() == other.sum()) - else: - return UserList.UserList.__eq__(self,other) + if type(other) == type(3) or type(other) == type(3.0): return (self.sum() == other) + elif hasattr(other,"sum"): return (self.sum() == other.sum()) + else: return UserList.UserList.__eq__(self,other) - def __ne__(self,other): - if type(other) == type(3) or type(other) == type(3.0): - return (self.sum() != other) - elif hasattr(other,"sum"): - return (self.sum() != other.sum()) - else: - return UserList.UserList.__ne__(self,other) + if type(other) == type(3) or type(other) == type(3.0): return (self.sum() != other) + elif hasattr(other,"sum"):return (self.sum() != other.sum()) + else: return UserList.UserList.__ne__(self,other) - def __gt__(self,other): - if type(other) == type(3) or type(other) == type(3.0): - return (self.sum() > other) - elif hasattr(other,"sum"): - return (self.sum() > other.sum()) - else: - return UserList.UserList.__gt__(self,other) + if type(other) == type(3) or type(other) == type(3.0): return (self.sum() > other) + elif hasattr(other,"sum"): return (self.sum() > other.sum()) + else: return UserList.UserList.__gt__(self,other) - def __ge__(self,other): - if type(other) == type(3) or type(other) == type(3.0): - return (self.sum() >= other) - elif hasattr(other,"sum"): - return (self.sum() >= other.sum()) - else: - return UserList.UserList.__ge__(self,other) + if type(other) == type(3) or type(other) == type(3.0): return (self.sum() >= other) + elif hasattr(other,"sum"): return (self.sum() >= other.sum()) + else: return UserList.UserList.__ge__(self,other) - def __cmp__(self,other): # this function included for backwards compatibility # As of 2.1, lists implement the "rich comparison" # methods overloaded above. - if type(other) == type(3) or type(other) == type(3.0): - return cmp(self.sum(), other) - elif hasattr(other,"sum"): - return cmp(self.sum(), other.sum()) - else: - return UserList.UserList.__cmp__(self,other) + if type(other) == type(3) or type(other) == type(3.0): return cmp(self.sum(), other) + elif hasattr(other,"sum"): return cmp(self.sum(), other.sum()) + else: return UserList.UserList.__cmp__(self,other) - - def __rcmp__(self,other): return self.__cmp__(other) - def __add__(self,other): mycopy = copy.deepcopy(self) - if type(other) == type(3) or type(other) == type(3.0): - #if other < 0: - # return self.__sub__(-other) - #other = [di(other,other)] - other = [static_di(other)] - #return self.sum() + other - - elif type(other) == type("test"): - return self + if type(other) == type(3) or type(other) == type(3.0): other = [static_di(other)] + elif type(other) == type("test"): return self mycopy.extend(other) - #result = UserList.UserList.__add__(mycopy,other) return mycopy - def __iadd__(self,other): return self.__add__(other) - def __radd__(self,other): mycopy = copy.deepcopy(self) if type(other) == type(3) or type(other) == type(3.0): @@ -207,27 +144,20 @@ mycopy.insert(0,other) return mycopy - def __int__(self): return self.sum() - def __sub__(self,other): mycopy = copy.deepcopy(self) if type(other) == type(3) or type(other) == type(3.0): neg_die = static_di(-other) - #neg_die.set_value(-other) other = [neg_die] - #return self.sum() - other - else: - other = -other + else: other = -other mycopy.extend(other) return mycopy - def __rsub__(self,other): mycopy = -copy.deepcopy(self) - #print type(other) if type(other) == type(3) or type(other) == type(3.0): new_die = di(0) new_die.set_value(other) @@ -235,18 +165,13 @@ mycopy.insert(0,other) return mycopy - def __isub__(self,other): return self.__sub__(other) - def __mul__(self,other): - if type(other) == type(3) or type(other) == type(3.0): - return self.sum() * other - elif hasattr(other,"sum"): - return other.sum() * self.sum() - else: - return UserList.UserList.__mul__(self,other) + if type(other) == type(3) or type(other) == type(3.0): return self.sum() * other + elif hasattr(other,"sum"): return other.sum() * self.sum() + else: return UserList.UserList.__mul__(self,other) def __rmul__(self,other): @@ -254,21 +179,15 @@ def __div__(self,other): - if type(other) == type(3) or type(other) == type(3.0): - return float(self.sum()) / other - elif hasattr(other,"sum"): - return float(self.sum()) / other.sum() - else: - return UserList.UserList.__div__(self,other) + if type(other) == type(3) or type(other) == type(3.0): return float(self.sum()) / other + elif hasattr(other,"sum"): return float(self.sum()) / other.sum() + else: return UserList.UserList.__div__(self,other) def __rdiv__(self,other): - if type(other) == type(3) or type(other) == type(3.0): - return other / float(self.sum()) - elif hasattr(other,"sum"): - return other.sum() / float(self.sum()) - else: - return UserList.UserList.__rdiv__(self,other) + if type(other) == type(3) or type(other) == type(3.0): return other / float(self.sum()) + elif hasattr(other,"sum"): return other.sum() / float(self.sum()) + else: return UserList.UserList.__rdiv__(self,other) def __mod__(self,other):
--- a/orpg/dieroller/utils.py Sat Nov 28 01:25:20 2009 -0600 +++ b/orpg/dieroller/utils.py Wed Dec 02 21:20:44 2009 -0600 @@ -42,9 +42,10 @@ from runequest import * from savage import * from trinity import * +from mythos import * import re -rollers = ['std','wod','d20','hero','shadowrun', 'sr4','hackmaster','srex','wodex', 'gurps', 'runequest', 'sw', 'trinity'] +rollers = ['std','wod','d20','hero','shadowrun', 'sr4','hackmaster','srex','wodex', 'gurps', 'runequest', 'sw', 'trinity', 'mythos'] class roller_manager: @@ -70,15 +71,30 @@ def stdDieToDClass(self,match): s = match.group(0) - (num,sides) = s.split('d') + num_sides = s.split('d') + if len(num_sides) > 1: num_sides; num = num_sides[0]; sides = num_sides[1] + else: return self.non_stdDieToDClass(s) # Use a non standard converter. if sides.strip().upper() == 'F': sides = "'f'" try: - if int(num) > 100 or int(sides) > 10000: - return None + if int(num) > 100 or int(sides) > 10000: return None except: pass return "(" + num.strip() + "**" + self.roller_class + "(" + sides.strip() + "))" + + def non_stdDieToDClass(self, s): + num_sides = s.split('v') + if len(num_sides) > 1: + num_sides; num = num_sides[0]; sides = num_sides[1] + if self.roller_class == 'stry': sides = '12'; target = num_sides[1] + elif self.roller_class == 'wod': sides = '10'; target = num_sides[1] + return "("+num.strip()+"**"+self.roller_class+"("+sides.strip()+")).vs("+target+")" + num_sides = s.split('k') + if len(num_sides) > 1: + num_sides; num = num_sides[0]; sides = '10'; target = num_sides[1] + return "("+num.strip()+"**"+self.roller_class+"("+sides.strip()+")).takeHighest("+target+").open(10)" + + # Use this to convert ndm-style (3d6) dice to d_base format def convertTheDieString(self,s):
--- a/orpg/gametree/nodehandlers/chatmacro.py Sat Nov 28 01:25:20 2009 -0600 +++ b/orpg/gametree/nodehandlers/chatmacro.py Wed Dec 02 21:20:44 2009 -0600 @@ -39,16 +39,17 @@ <text>some text here</text> </nodehandler > """ - def __init__(self,xml_dom,tree_node): - node_handler.__init__(self,xml_dom,tree_node) - self.text_elem = self.master_dom.getElementsByTagName('text')[0] - self.text = component.get('xml').safe_get_text_node(self.text_elem) + def __init__(self,xml,tree_node): + node_handler.__init__(self,xml,tree_node) + self.xml = xml + self.text_elem = self.xml.find('text') + self.text = self.text_elem.text def set_text(self,txt): - self.text._set_nodeValue(txt) + self.text = txt def on_use(self,evt): - txt = self.text._get_nodeValue() + txt = self.text actionlist = txt.split("\n") for line in actionlist: if(line != ""): @@ -63,8 +64,8 @@ return macro_edit_panel(parent,self) def tohtml(self): - title = self.master_dom.getAttribute("name") - txt = self.text._get_nodeValue() + title = self.xml.get("name") + txt = self.text txt = string.replace(txt,'\n',"<br />") return "<P><b>"+title+":</b><br />"+txt @@ -78,8 +79,8 @@ self.handler = handler sizer = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Chat Macro"), wx.VERTICAL) self.text = {} - self.text[P_TITLE] = wx.TextCtrl(self, P_TITLE, handler.master_dom.getAttribute('name')) - self.text[P_BODY] = wx.TextCtrl(self, P_BODY, handler.text._get_nodeValue(), style=wx.TE_MULTILINE) + self.text[P_TITLE] = wx.TextCtrl(self, P_TITLE, handler.xml.get('name')) + self.text[P_BODY] = wx.TextCtrl(self, P_BODY, handler.text, style=wx.TE_MULTILINE) sizer.Add(wx.StaticText(self, -1, "Title:"), 0, wx.EXPAND) sizer.Add(self.text[P_TITLE], 0, wx.EXPAND) sizer.Add(wx.StaticText(self, -1, "Text Body:"), 0, wx.EXPAND) @@ -97,6 +98,6 @@ txt = self.text[id].GetValue() if txt == "": return if id == P_TITLE: - self.handler.master_dom.setAttribute('name',txt) + self.handler.xml.setAttribute('name',txt) self.handler.rename(txt) elif id == P_BODY: self.handler.set_text(txt)
--- a/orpg/mapper/whiteboard.py Sat Nov 28 01:25:20 2009 -0600 +++ b/orpg/mapper/whiteboard.py Wed Dec 02 21:20:44 2009 -0600 @@ -277,7 +277,7 @@ self.serial_number -= 1 def add_line(self, line_string="", upperleft=cmpPoint(0,0), lowerright=cmpPoint(0,0), color="#000000", width=1): - id = 'line ' + str(self.next_serial()) + id = 'line-' + self.canvas.session.get_next_id() line = WhiteboardLine(id, line_string, upperleft, lowerright, color=self.color, width=self.width) self.lines.append(line) xml_str = "<map><whiteboard>" @@ -368,7 +368,7 @@ self.font = font def add_text(self, text_string, pos, style, pointsize, weight, color="#000000"): - id = 'text ' + str(self.next_serial()) + id = 'text-' + self.canvas.session.get_next_id() text = WhiteboardText(id,text_string, pos, style, pointsize, weight, color) self.texts.append(text) xml_str = "<map><whiteboard>" @@ -423,7 +423,9 @@ nodename = l._get_nodeName() action = l.getAttribute("action") id = l.getAttribute('id') - if self.serial_number < int(id[5:]): self.serial_number = int(id[5:]) + try: + if self.serial_number < int(id.split('-')[2]): self.serial_number = int(id.split('-')[2]) + except: pass if action == "del": if nodename == 'line': line = self.get_line_by_id(id) @@ -474,7 +476,6 @@ if nodename == "text": text = self.get_text_by_id(id) if text: text.takedom(l) - #self.canvas.send_map_data() def add_temp_line(self, line_string): line = WhiteboardLine(0, line_string, wx.Point(0,0), wx.Point(0,0),
--- a/orpg/orpg_version.py Sat Nov 28 01:25:20 2009 -0600 +++ b/orpg/orpg_version.py Wed Dec 02 21:20:44 2009 -0600 @@ -4,7 +4,7 @@ #BUILD NUMBER FORMAT: "YYMMDD-##" where ## is the incremental daily build index (if needed) DISTRO = "Traipse Alpha" DIS_VER = "Ornery Orc" -BUILD = "091128-00" +BUILD = "091202-00" # This version is for network capability. PROTOCOL_VERSION = "1.2"
--- a/orpg/plugindb.py Sat Nov 28 01:25:20 2009 -0600 +++ b/orpg/plugindb.py Wed Dec 02 21:20:44 2009 -0600 @@ -161,21 +161,25 @@ dict_el = Element(dictname) dict_el.set('type', 'dict') plugin.append(dict_el) - else: - dict_el.remove(list_el.find('dict')) + else: + refs = dict_el.findall('dict') + keys = val.keys() + for r in refs: + if r.find('dobject').get('name') in keys: + logger.debug('Duplicate Dictionary Reference', True); return dict_el.append(self.BuildDict(val)) self.SaveDoc() def FetchDict(self, parent): retdict = {} - for ditem in parent.findall('dobject'): + for ditem in parent.find('dict').findall('dobject'): key = self.normal(ditem.get('name')) if ditem.get('type') == 'int': value = int(ditem.text) elif ditem.get('type') == 'bool': value = ditem.text == 'True' elif ditem.get('type') == 'float': value = float(ditem.text) elif ditem.get('type') == 'list': value = self.FetchList(ditem) elif ditem.get('type') == 'dict': value = self.FetchDict(ditem) - else: value = str(self.normal(ditem[0])) + else: value = str(self.normal(ditem.text)) retdict[key] = value return retdict
--- a/orpg/tools/orpg_settings.py Sat Nov 28 01:25:20 2009 -0600 +++ b/orpg/tools/orpg_settings.py Wed Dec 02 21:20:44 2009 -0600 @@ -131,73 +131,31 @@ self.settings.set_setting(self.changes[i][0], self.changes[i][1]) top_frame = component.get('frame') - if self.changes[i][0] == 'defaultfontsize' or self.changes[i][0] == 'defaultfont': - self.chat.chatwnd.SetDefaultFontAndSize(self.settings.get_setting('defaultfont'), - self.settings.get_setting('defaultfontsize')) - self.chat.InfoPost("Font is now " + - self.settings.get_setting('defaultfont') + " point size " + - self.settings.get_setting('defaultfontsize')) - self.chat.chatwnd.scroll_down() - - if self.changes[i][0] == 'bgcolor' or self.changes[i][0] == 'textcolor': - self.chat.chatwnd.SetPage(self.chat.ResetPage()) - self.chat.chatwnd.scroll_down() - if self.settings.get_setting('ColorTree') == '1': - top_frame.tree.SetBackgroundColour(self.settings.get_setting('bgcolor')) - top_frame.tree.SetForegroundColour(self.settings.get_setting('textcolor')) - top_frame.tree.Refresh() - top_frame.players.SetBackgroundColour(self.settings.get_setting('bgcolor')) - top_frame.players.SetForegroundColour(self.settings.get_setting('textcolor')) - top_frame.players.Refresh() - else: - top_frame.tree.SetBackgroundColour('white') - top_frame.tree.SetForegroundColour('black') - top_frame.tree.Refresh() - top_frame.players.SetBackgroundColour('white') - top_frame.players.SetForegroundColour('black') - top_frame.players.Refresh() + ## Settings are now reactive and organized ## + ok = {'IdleStatusAlias': self.chat.chat_cmds.on_status, + 'dieroller': self.dieroller_ok, + 'defaultfontsize': self.font_ok, + 'defaultfont': self.font_ok, + 'bgcolor': self.text_ok, + 'textcolor': self.text_ok, + 'ColorTree': self.colortree_ok, + 'player': self.session.set_name, + 'TabBackgroundGradient': self.tab_gradient_ok} - if self.changes[i][0] == 'ColorTree': - if self.changes[i][1] == '1': - top_frame.tree.SetBackgroundColour(self.settings.get_setting('bgcolor')) - top_frame.tree.SetForegroundColour(self.settings.get_setting('textcolor')) - top_frame.tree.Refresh() - top_frame.players.SetBackgroundColour(self.settings.get_setting('bgcolor')) - top_frame.players.SetForegroundColour(self.settings.get_setting('textcolor')) - top_frame.players.Refresh() - else: - top_frame.tree.SetBackgroundColour('white') - top_frame.tree.SetForegroundColour('black') - top_frame.tree.Refresh() - top_frame.players.SetBackgroundColour('white') - top_frame.players.SetForegroundColour('black') - top_frame.players.Refresh() + if self.changes[i][0] in ok.keys(): ok[self.changes[i][0]](self.changes[i][1]) - if self.changes[i][0] == 'GMWhisperTab' and self.changes[i][1] == '1': self.chat.parent.create_gm_tab() - self.toggleToolBars(self.chat, self.changes[i]) - try: self.toggleToolBars(self.chat.parent.GMChatPanel, self.changes[i]) - except: pass - for panel in self.chat.parent.whisper_tabs: self.toggleToolBars(panel, self.changes[i]) - for panel in self.chat.parent.group_tabs: self.toggleToolBars(panel, self.changes[i]) - for panel in self.chat.parent.null_tabs: self.toggleToolBars(panel, self.changes[i]) + elif self.changes[i][0] == 'GMWhisperTab' and self.changes[i][1] == '1': self.chat.parent.create_gm_tab() - if self.changes[i][0] == 'player': self.session.name = str(self.changes[i][1]) - - if (self.changes[i][0][:3] == 'Tab' and self.changes[i][1][:6] == 'custom') or\ + elif (self.changes[i][0][:3] == 'Tab' and self.changes[i][1][:6] == 'custom') or\ (self.changes[i][0][:3] == 'Tab' and self.settings.get_setting('TabTheme')[:6] == 'custom'): - gfrom = self.settings.get_setting('TabGradientFrom') (fred, fgreen, fblue) = rgbconvert.rgb_tuple(gfrom) - gto = self.settings.get_setting('TabGradientTo') (tored, togreen, toblue) = rgbconvert.rgb_tuple(gto) - tabtext = self.settings.get_setting('TabTextColor') (tred, tgreen, tblue) = rgbconvert.rgb_tuple(tabtext) - for wnd in tabbedwindows: style = wnd.GetWindowStyleFlag() - # remove old tabs style mirror = ~(FNB.FNB_VC71 | FNB.FNB_VC8 | FNB.FNB_FANCY_TABS | FNB.FNB_COLORFUL_TABS) style &= mirror if self.settings.get_setting('TabTheme') == 'customslant': style |= FNB.FNB_VC8 @@ -208,14 +166,74 @@ wnd.SetNonActiveTabTextColour(wx.Color(tred, tgreen, tblue)) wnd.Refresh() - if self.changes[i][0] == 'TabBackgroundGradient': - for wnd in tabbedwindows: - (red, green, blue) = rgbconvert.rgb_tuple(self.changes[i][1]) - wnd.SetTabAreaColour(wx.Color(red, green, blue)) - wnd.Refresh() + self.toggleToolBars(self.chat, self.changes[i]) + try: self.toggleToolBars(self.chat.parent.GMChatPanel, self.changes[i]) + except: pass + for panel in self.chat.parent.whisper_tabs: self.toggleToolBars(panel, self.changes[i]) + for panel in self.chat.parent.group_tabs: self.toggleToolBars(panel, self.changes[i]) + for panel in self.chat.parent.null_tabs: self.toggleToolBars(panel, self.changes[i]) + self.settings.save() self.Destroy() + def tab_gradient_ok(self, changes): + for wnd in tabbedwindows: + (red, green, blue) = rgbconvert.rgb_tuple(changes) + wnd.SetTabAreaColour(wx.Color(red, green, blue)) + wnd.Refresh() + + def dieroller_ok(self, changes): + rm = component.get('DiceManager') + try: + rm.setRoller(changes) + self.chat.SystemPost('You have changed your die roller to the <b>"' + changes + '"</b> roller.') + except: + rm.setRoller('std') + self.settings.change('dieroller', 'std') + self.chat.SystemPost('<b>"' + changes + '"</b> is an invalid roller. Setting roller to <b>"std"</b>') + + def colortree_ok(self, changes): + if changes == '1': + top_frame.tree.SetBackgroundColour(self.settings.get_setting('bgcolor')) + top_frame.tree.SetForegroundColour(self.settings.get_setting('textcolor')) + top_frame.tree.Refresh() + top_frame.players.SetBackgroundColour(self.settings.get_setting('bgcolor')) + top_frame.players.SetForegroundColour(self.settings.get_setting('textcolor')) + top_frame.players.Refresh() + else: + top_frame.tree.SetBackgroundColour('white') + top_frame.tree.SetForegroundColour('black') + top_frame.tree.Refresh() + top_frame.players.SetBackgroundColour('white') + top_frame.players.SetForegroundColour('black') + top_frame.players.Refresh() + + def font_ok(self, changes): + self.chat.chatwnd.SetDefaultFontAndSize(self.settings.get_setting('defaultfont'), + self.settings.get_setting('defaultfontsize')) + self.chat.InfoPost("Font is now " + + self.settings.get_setting('defaultfont') + " point size " + + self.settings.get_setting('defaultfontsize')) + self.chat.chatwnd.scroll_down() + + def text_ok(self, changes): + self.chat.chatwnd.SetPage(self.chat.ResetPage()) + self.chat.chatwnd.scroll_down() + if self.settings.get_setting('ColorTree') == '1': + top_frame.tree.SetBackgroundColour(self.settings.get_setting('bgcolor')) + top_frame.tree.SetForegroundColour(self.settings.get_setting('textcolor')) + top_frame.tree.Refresh() + top_frame.players.SetBackgroundColour(self.settings.get_setting('bgcolor')) + top_frame.players.SetForegroundColour(self.settings.get_setting('textcolor')) + top_frame.players.Refresh() + else: + top_frame.tree.SetBackgroundColour('white') + top_frame.tree.SetForegroundColour('black') + top_frame.tree.Refresh() + top_frame.players.SetBackgroundColour('white') + top_frame.players.SetForegroundColour('black') + top_frame.players.Refresh() + def toggleToolBars(self, panel, changes): if changes[0] == 'AliasTool_On': panel.toggle_alias(changes[1]) elif changes[0] == 'DiceButtons_On': panel.toggle_dice(changes[1])