Mercurial > traipse_dev
changeset 138:1ed2feab0db9 alpha
Traipse Alpha 'OpenRPG' {091021-00}
Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for
developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to
the code. 'Ornery-Orc's main goal is to offer more advanced features and enhance the productivity of the user.
Update Summary (Cleaning up for Beta)
Added Bookmarks
Fix to Remote Admin Commands
Minor fix to text based Server
Fix to Pretty Print, from Core
Fix to Splitter Nodes not being created
Fix to massive amounts of images loading, from Core
Added 'boot' command to remote admin
Added confirmation window for sent nodes
Minor changes to allow for portability to an OpenSUSE linux OS
Miniatures Layer pop up box allows users to turn off Mini labels, from FlexiRPG
Zoom Mouse plugin added
Images added to Plugin UI
Switching to Element Tree
Map efficiency, from FlexiRPG
Added Status Bar to Update Manager
default_manifest.xml renamed to default_upmana.xml
Cleaner clode for saved repositories
New TrueDebug Class in orpg_log (See documentation for usage)
Mercurial's hgweb folder is ported to upmana
Pretty important update that can help remove thousands of dead children from your gametree.
Children, <forms />, <group_atts />, <horizontal />, <cols />, <rows />, <height />, etc... are all tags now. Check
your gametree and look for dead children!!
New Gametree Recursion method, mapping, and context sensitivity. !!Alpha Still- Watch out for infinite loops!!
New Syntax added for custom PC sheets
Tip of the Day added, from Core and community
Fixed Whiteboard ID to prevent random line or text deleting. Appended tr_ to ID's to prevent non updated clients from
ruining the fix.
author | sirebral |
---|---|
date | Sat, 21 Nov 2009 03:19:34 -0600 |
parents | 54446a995007 |
children | 8e07c1a2c69b |
files | data/tips.txt orpg/chat/chat_util.py orpg/chat/chatwnd.py orpg/gametree/nodehandlers/containers.py orpg/gametree/nodehandlers/rpg_grid.py orpg/main.py orpg/mapper/map.py orpg/mapper/whiteboard.py orpg/orpg_version.py |
diffstat | 9 files changed, 209 insertions(+), 179 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/tips.txt Sat Nov 21 03:19:34 2009 -0600 @@ -0,0 +1,43 @@ +Traipse OpenRPG is a fork of the original OpenRPG software. Traipse has been designed to be easy to use while offering superb functionality and strong stability. + +You can find other OpenRPG users by clicking "Game Server/Browse Servers" and then double clicking on one of the servers. Try the top one: it has the most active users. + +For a technical question about OpenRPG try the RPGObjects OpenRPG forum here: http://www.rpgobjects.com/forum/index.php?action=vtopic&forum=1 + +Many of the OpenRPG servers have associated web sites that help players find campaigns, find OpenRPG resources such as miniatures and charachter sheets, and can answer other questions. + +The Traipes Suite has a debug console that allows you to see what would appear in a regular console. The debug console allows you to copy and paste any errors that occur, and the Bug Report button allows you to submit your bug while still playing. + +You may observe an OpenRPG session in progress by entering a room that someone else has created. Be careful not to annoy people. If you have questions use "Whisper". Red rooms are private. + +The Traipse Update Manager allows you to download source code from any OpenRPG fork in the Repos tab. Just give the repository a name, then add the url and press refresh. Here are two to try it with: Traipse-Dev: http://hg.assembla.com/traipse_dev and OpenRPG-Core: http://hg.assembla.com/openrpg + +Room Moderation helps prevent annyoing lurkers from disrupting your game. Turn on Room Moderation by right clicking on your name in the player list and find the Moderation sub menu. + +OpenRPG servers are maintained by private individuals. When you connect to a new server please take a moment to read any rules they might have, such as not posting images while in the lobby. + +OpenRPG images are hosted in one of three ways: by a URL to any image hosting site such as Photobucket or Imageshack, by a URL to an image served by your own client program (CherryPy) or by a file uploaded to OpenRPG's dedicated image server from your local file system. + +You can drag an image file straight from your file system to OpenRPG's map using the Remote Image Server. In Pious Paladin this feature will be added to CherryPy so will be able to drag and drop locally as well. + +If you want to create a large background image for your map you can make it using OpenRPG's whiteboard features or by loading many dungeon "tile" images and then save the entire map as a .jpg file. + +Locking a miniature means that it is ignored when you click around the map. Useful for images of terrain or objects. + +Hold down Ctrl to select or right-click a locked miniature on the map. On a Mac use the Command / Apple button. + +OpenRPG's main four windows are all sizeable, movable and dockable. In addition by editing the layout.xml file you can put two or more of them on a tab. + +You can customise OpenRPG's behaviour in four ways: plugins, custom die rollers, game system specific nodes and by using filters. + +OpenRPG is not written for any one role playing system, but custom features have been written to aid game play for about a dozen systems. Ask around to see what might be availble, and if nothing is, consider creating your own. + +OpenRPG automatically saves an html log of your entire game session and saves it in the folder myfiles/logs + +Thanks for selecting the Traipse distribution of OpenRPG. Traipse users are growing in number and often express joy about the stability of the software. If you see a bug, any bug, please report it with the Debug Console in Traipse Suite. + +Die roller notes are available on the Features Node. Right click on the top of the game tree, "Insert features Node" and double click on "Load Die Roller Notes" + +You can search your chat session by opening the text view of it (click the button to the right of the dice). Type in the search term and hit "find". + +The map has a tape measure. Hold down SHIFT and drag with the left mouse button down.
--- a/orpg/chat/chat_util.py Wed Nov 18 19:57:52 2009 -0600 +++ b/orpg/chat/chat_util.py Sat Nov 21 03:19:34 2009 -0600 @@ -3,7 +3,7 @@ import re import string from orpg.orpgCore import * -from orpg.tools.orpg_log import logger +from orpg.tools.orpg_log import logger, debug from orpg.tools.decorators import debugging #============================================ @@ -19,7 +19,7 @@ # # Created 04-25-2005 by Snowdog #============================================= -@debugging + def simple_html_repair(string): "Returns string with extra > symbols to isolate badly formated HTML" #walk though string checking positions of < and > tags. @@ -70,10 +70,10 @@ diff = string.count('<') - string.count('>') if diff > 0: for d in range(1,diff): - string = string+">" + string = string+">" return string -""" Depricated! Might as well use the already made component.get('xml') +# Depricated! Might as well use the already made component.get('xml') def strip_unicode(txt): for i in xrange(len(txt)): if txt[i] not in string.printable: @@ -81,8 +81,7 @@ txt = txt.replace(txt[i], '&#' + str(ord(txt[i])) + ';') except: txt = txt.replace(txt[i], '{?}') - return txt -""" + return txt #================================================ # strip_script_tags(string) @@ -90,7 +89,7 @@ # removes all script tags (start and end) # 04-26-2005 Snowdog #================================================ -@debugging + def strip_script_tags(string): #kill the <script> issue p = re.compile( '<(\s*)(/*)[Ss][Cc][Rr][Ii][Pp][Tt](.*?)>') @@ -103,7 +102,7 @@ # removes all li tags (start and end) # 05-13-2005 #================================================ -@debugging + def strip_li_tags(string): #kill the <li> issue string = re.sub( r'<(\s*)[Ll][Ii](.*?)>', r'<b><font color="#000000" size=+1>*</font></b> ', string) @@ -118,10 +117,10 @@ # through legitimate means such as the OpenRPG settings. # 07-27-2005 by mDuo13 #================================================ -@debugging + def strip_body_tags(string): bodytag_regex = re.compile(r"""<\/?body.*?>""", re.I) - string = re.sub(bodytag_regex, "", string) + string = re.sub(bodytag_regex, "", string) return string #================================================ @@ -137,7 +136,7 @@ # used legitimately without causing much annoyance. # 07-27-2005 mDuo13 #================================================ -@debugging + def strip_misalignment_tags(string): alignment_regex = re.compile(r"""<p([^>]*?)align\s*=\s*('.*?'|".*?"|[^\s>]*)(.*?)>""", re.I) string = re.sub(alignment_regex, "<p\\1\\3>", string) @@ -148,7 +147,7 @@ num_endcentertags = endcenter_regex.findall(string) if num_centertags > num_endcentertags: missing_tags = len(num_centertags) - len(num_endcentertags) - string = string + missing_tags*"</center>"#yes, you can do this. + string = string + missing_tags*"</center>"#yes, you can do this. return string #================================================ @@ -158,7 +157,7 @@ # 05-13-2005 # redone 07-11-2005 by mDuo13 #================================================ -@debugging + def strip_img_tags(string): #This is a Settings definable feature, Allowing users to enable or disable image display to fix the client crash due to large img posted to chat. #p = re.sub( r'<(\s*)(/*)[Ii][Mm][Gg][ ][Ss][Rr][Cc][=](.*?)>', r'<!-- img tag removed //--> <a href=\3>\3</a>', string)
--- a/orpg/chat/chatwnd.py Wed Nov 18 19:57:52 2009 -0600 +++ b/orpg/chat/chatwnd.py Sat Nov 21 03:19:34 2009 -0600 @@ -228,7 +228,7 @@ return (self.GetFont().GetFaceName(), self.GetFont().GetPointSize()) # class chat_html_window - end -if NEWCHAT: +if NEWCHAT: class ChatHtmlWindow(wx.webview.WebView): def __init__(self, parent, id): @@ -241,23 +241,18 @@ self.Bind(wx.webview.EVT_WEBVIEW_BEFORE_LOAD, self.OnLinkClicked) #Wrapers so I dont have to add special Code - def SetPage(self, htmlstring): self.SetPageSource(htmlstring) - - def AppendToPage(self, htmlstring): + def AppendToPage(self, htmlstring): self.SetPageSource(self.GetPageSource() + htmlstring) - def GetFont(self): return self.__font - def CalculateAllFonts(self, defaultsize): return - def SetDefaultFontAndSize(self, fontname, fontsize): self.__font = wx.Font(int(fontsize), wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL, @@ -267,22 +262,18 @@ return (self.GetFont().GetFaceName(), self.GetFont().GetPointSize()) #Events - def OnLinkClicked(self, linkinfo): href = linkinfo.GetHref() wb = webbrowser.get() wb.open(href) - def onPopup(self, evt): self.PopupMenu(self.menu) - def LeftUp(self, event): event.Skip() wx.CallAfter(self.parent.set_chat_text_focus, None) - def OnM_EditCopy(self, evt): wx.TheClipboard.UsePrimarySelection(False) wx.TheClipboard.Open() @@ -290,30 +281,25 @@ wx.TheClipboard.Close() #Cutom Methods - def Header(self): return "<html><head><style>body {font-size: " + str(self.GetFont().GetPointSize()) + "px;font-family: " + self.GetFont().GetFaceName() + ";color: " + self.parent.textcolor + ";background-color: " + self.parent.bgcolor + ";margin: 0;padding: 0 0;height: 100%;}</style></head><body>" - def StripHeader(self): tmp = self.GetPageSource().split('<BODY>') if tmp[-1].find('<body>') > -1: tmp = tmp[-1].split('<body>') return tmp[-1] - def build_menu(self): self.menu = wx.Menu() item = wx.MenuItem(self.menu, wx.ID_ANY, "Copy", "Copy") self.Bind(wx.EVT_MENU, self.OnM_EditCopy, item) self.menu.AppendItem(item) - def scroll_down(self): maxrange = self.GetScrollRange(wx.VERTICAL) pagesize = self.GetScrollPageSize(wx.VERTICAL) self.Scroll(-1, maxrange-pagesize) - def mouse_wheel(self, event): amt = event.GetWheelRotation() units = amt/(-(event.GetWheelDelta())) @@ -379,7 +365,6 @@ self.create_gm_tab() self.SetSelection(0) - def get_tab_index(self, chatpanel): "Return the index of a chatpanel in the wxNotebook." @@ -387,7 +372,6 @@ if (self.GetPage(i) == chatpanel): return i - def create_gm_tab(self): if self.GMChatPanel == None: self.GMChatPanel = chat_panel(self, -1, MAIN_TAB, 'gm') @@ -395,7 +379,6 @@ self.SetPageImage(self.GetPageCount()-1, 1) self.GMChatPanel.chatwnd.SetDefaultFontAndSize(self.font, self.fontsize) - def create_whisper_tab(self, playerid): "Add a new chatpanel directly connected to integer 'playerid' via whispering." private_tab = chat_panel(self, -1, WHISPER_TAB, playerid) @@ -408,7 +391,6 @@ wx.CallAfter(self.AliasLib.RefreshAliases) return private_tab - def create_group_tab(self, group_name): "Add a new chatpanel directly connected to integer 'playerid' via whispering." private_tab = chat_panel(self, -1, GROUP_TAB, group_name) @@ -420,7 +402,6 @@ wx.CallAfter(self.AliasLib.RefreshAliases) return private_tab - def create_null_tab(self, tab_name): "Add a new chatpanel directly connected to integer 'playerid' via whispering." private_tab = chat_panel(self, -1, NULL_TAB, tab_name) @@ -432,11 +413,9 @@ wx.CallAfter(self.AliasLib.RefreshAliases) return private_tab - def onCloseTab(self, evt): try: tabid = evt.GetSelection() except: tabid = self.GetSelection() - if self.GetPageText(tabid) == 'Main Room': #send no close error to chat evt.Veto() @@ -445,7 +424,6 @@ msg = "Are You Sure You Want To Close This Page?" dlg = wx.MessageDialog(self, msg, "NotebookCtrl Question", wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION) - if wx.Platform != '__WXMAC__': dlg.SetFont(wx.Font(8, wx.NORMAL, wx.NORMAL, wx.NORMAL, False)) @@ -461,16 +439,13 @@ elif panel in self.group_tabs: self.group_tabs.remove(panel) elif panel in self.null_tabs: self.null_tabs.remove(panel) - def newMsg(self, tabid): if tabid != self.GetSelection(): self.SetPageImage(tabid, 0) - def onPageChanging(self, event): """When private chattabs are selected, set the bitmap back to 'normal'.""" event.Skip() - def onPageChanged(self, event): """When private chattabs are selected, set the bitmap back to 'normal'.""" selected_idx = event.GetSelection() @@ -567,7 +542,6 @@ self.fontsize = self.chatwnd.GetFont().GetPointSize() self.scroll_down() - def set_default_font(self, fontname=None, fontsize=None): """Set all chatpanels to new default fontname/fontsize. Returns current font settings in a (fontname, fontsize) tuple.""" @@ -581,7 +555,6 @@ self.fontsize = newfontsize return (self.font, self.fontsize) - def build_menu(self): top_frame = component.get('frame') menu = wx.Menu() @@ -673,54 +646,44 @@ top_frame.mainmenu.Insert(2, menu, '&Chat') ## Settings Menu Events - def OnMB_ShowImages(self, event): if event.IsChecked(): self.settings.set_setting("Show_Images_In_Chat", '1') else: self.settings.set_setting("Show_Images_In_Chat", '0') - def OnMB_StripHTML(self, event): - if event.IsChecked(): self.settings.set_setting("Sstriphtml", '1') + if event.IsChecked(): self.settings.set_setting("striphtml", '1') else: self.settings.set_setting("striphtml", '0') - def OnMB_ChatTimeIndex(self, event): if event.IsChecked(): self.settings.set_setting("Chat_Time_Indexing", '1') else: self.settings.set_setting("Chat_Time_Indexing", '0') - def OnMB_ChatAutoComplete(self, event): if event.IsChecked(): self.settings.set_setting("SuppressChatAutoComplete", '0') else: self.settings.set_setting("SuppressChatAutoComplete", '1') - def OnMB_ShowIDinChat(self, event): if event.IsChecked(): self.settings.set_setting("ShowIDInChat", '1') else: self.settings.set_setting("ShowIDInChat", '0') - def OnMB_LogTimeIndex(self, event): if event.IsChecked(): self.settings.set_setting("TimeStampGameLog", '1') else: self.settings.set_setting("TimeStampGameLog", '0') - def OnMB_TabbedWhispers(self, event): if event.IsChecked(): self.settings.set_setting("tabbedwhispers", '1') else: self.settings.set_setting("tabbedwhispers", '0') - def OnMB_GMTab(self, event): if event.IsChecked(): self.settings.set_setting("GMWhisperTab", '1') self.parent.create_gm_tab() else: self.settings.set_setting("GMWhisperTab", '0') - def OnMB_GroupWhisperTabs(self, event): if event.IsChecked(): self.settings.set_setting("GroupWhisperTab", '1') else: self.settings.set_setting("GroupWhisperTab", '0') - def OnMB_DiceBar(self, event): act = '0' if event.IsChecked(): @@ -734,7 +697,6 @@ for panel in self.parent.group_tabs: panel.toggle_dice(act) for panel in self.parent.null_tabs: panel.toggle_dice(act) - def OnMB_FormatButtons(self, event): act = '0' if event.IsChecked(): @@ -749,7 +711,6 @@ for panel in self.parent.group_tabs: panel.toggle_formating(act) for panel in self.parent.null_tabs: panel.toggle_formating(act) - def OnMB_AliasTool(self, event): act = '0' if event.IsChecked(): @@ -763,7 +724,6 @@ for panel in self.parent.group_tabs: panel.toggle_alias(act) for panel in self.parent.null_tabs:panel.toggle_alias(act) - def OnMB_BackgroundColor(self, event): top_frame = component.get('frame') hexcolor = self.get_color() @@ -842,7 +802,7 @@ self.basesizer = wx.BoxSizer(wx.VERTICAL) self.basesizer.Add( self.chatwnd, 1, wx.EXPAND ) self.basesizer.Add( self.toolbar_sizer, 0, wx.EXPAND ) - self.basesizer.Add( self.chattxt, 0, wx.EXPAND ) + self.basesizer.Add( self.chattxt, 0, wx.EXPAND ) self.SetSizer(self.basesizer) self.SetAutoLayout(True) self.Fit() @@ -874,7 +834,6 @@ self.chattxt.Bind(wx.EVT_TEXT_COPY, self.chatwnd.OnM_EditCopy) # def build_ctrls - end - def build_bar(self): self.toolbar_sizer = wx.BoxSizer(wx.HORIZONTAL) self.scroll_lock = None @@ -896,14 +855,16 @@ def build_alias(self): - self.aliasSizer = wx.BoxSizer(wx.HORIZONTAL) ## Future ## Add these to a sizer, then turn the toolbar_sizer into a grid so these can adjust to the frame. + self.aliasSizer = wx.BoxSizer(wx.HORIZONTAL) self.aliasList = wx.Choice(self, wx.ID_ANY, size=(100, 25), choices=[self.defaultAliasName]) self.aliasButton = createMaskedButton( self, dir_struct["icon"] + 'player.gif', - 'Refresh list of aliases from Game Tree', wx.ID_ANY, '#bdbdbd' ) + 'Refresh list of aliases from Game Tree', + wx.ID_ANY, '#bdbdbd' ) self.aliasList.SetSelection(0) self.filterList = wx.Choice(self, wx.ID_ANY, size=(100, 25), choices=[self.defaultFilterName]) self.filterButton = createMaskedButton( self, dir_struct["icon"] + 'add_filter.gif', - 'Refresh list of filters from Game Tree', wx.ID_ANY, '#bdbdbd' ) + 'Refresh list of filters from Game Tree', + wx.ID_ANY, '#bdbdbd' ) self.filterList.SetSelection(0) self.aliasSizer.Add( self.aliasButton, 0, wx.EXPAND ) @@ -1711,9 +1672,9 @@ except: # HTML parser has errored out (most likely). Being as all we are doing is # scanning for empty/blank lines anyway there is no harm in letting a - # troublesome message though. Worst case is a blank line to chat. + # troublesome message though. Worst case is a blank line to chat. lineHasText = 1 - if lineHasText: + if lineHasText: #following added by mDuo13 if myself: s2 = s @@ -1740,8 +1701,8 @@ newline = "<div class='"+c+"'> " + self.TimeIndexString() + name + s + "</div>" log( self.settings, c, name+s ) else: send = False - newline = component.get('xml').strip_unicode(newline) - if self.lockscroll == 0: + newline = chat_util.strip_unicode(newline) + if self.lockscroll == 0: self.chatwnd.AppendToPage(newline) self.scroll_down() else: self.storedata.append(newline) @@ -1783,7 +1744,6 @@ s = self.NormalizeParse(s) self.set_colors() self.Post(s,send,myself) - def NormalizeParse(self, s): for plugin_fname in self.activeplugins.keys(): @@ -1799,7 +1759,6 @@ s = self.ParseFilter(s) self.parsed = 1 return s - def ParseFilter(self, s): s = self.GetFilteredText(s) @@ -1815,7 +1774,6 @@ newstr = self.ParseNode(self.resolve_nodes(matches[i][1])) s = s.replace(matches[i][0], newstr, 1) return s - def ParseDice(self, s): """Parses player input for embedded dice rolls""" @@ -1834,7 +1792,6 @@ s = s.replace("[" + matches[i] + "]", "<!-- Official Roll [" + newstr1 + "] => " + newstr + "-->" + newstr, 1) else: s = s.replace("[" + matches[i] + "]", "[" + newstr1 + "<!-- Official Roll -->] => " + newstr, 1) return s - def PraseUnknowns(self, s): # Uses a tuple. Usage: ?Label}dY. If no Label is assigned then use ?}DY @@ -1857,7 +1814,6 @@ # This subroutine builds a chat display name. # - def chat_display_name(self, player): if self.settings.get_setting("ShowIDInChat") == "0": display_name = player[0] @@ -1867,7 +1823,6 @@ # This subroutine will get a hex color and return it, or return nothing # - def get_color(self): data = wx.ColourData() data.SetChooseFull(True) @@ -1883,7 +1838,6 @@ return None # def get_color - end - def replace_quotes(self, s): in_tag = 0 i = 0 @@ -1910,14 +1864,26 @@ if child.get('name') == path[step]: node = child step += 1 - if node.get('class') in ('dnd35char_handler', "SWd20char_handler", "d20char_handler", "dnd3echar_handler"): self.resolve_cust_loop(node, path, step, depth) + if node.get('class') in ('dnd35char_handler', "SWd20char_handler", "d20char_handler", "dnd3echar_handler"): self.resolve_cust_loop(node, path, step, depth) + elif node.get('class') == 'rpg_grid_handler': self.resolve_grid(node, path, step, depth) else: self.resolve_loop(node, path, step, depth) + + def resolve_grid(self, node, path, step, depth): + if step == depth: + self.data = 'Invalid Grid Reference!' + return + cell = tuple(path[step].strip('(').strip(')').split(',')) + grid = node.find('grid') + rows = grid.findall('row') + col = rows[int(cell[0])].findall('cell') + self.data = col[int(cell[1])].text or 'No Cell Data!' + return + def resolve_cust_loop(self, node, path, step, depth): node_class = node.get('class') if step == depth: self.resolution(node) - ##Build Abilities dictionary## if node_class not in ('d20char_handler', "SWd20char_handler"): ab = node.find('character').find('abilities') else: ab = node.find('abilities') @@ -1930,7 +1896,6 @@ if node_class not in ('d20char_handler', "SWd20char_handler"): ab = node.find('character').find('saves') else: ab = node.find('saves') ab_list = ab.findall('save') - for save in ab_list: pc_stats[save.get('name')] = ( str(save.get('base')), str(int(save.get('magmod')) + int(save.get('miscmod')) + int(pc_stats[save.get('stat')][1]) ) ) if save.get('name') == 'Fortitude': abbr = 'Fort' @@ -1938,65 +1903,62 @@ if save.get('name') == 'Will': abbr = 'Will' pc_stats[abbr] = ( str(save.get('base')), str(int(save.get('magmod')) + int(save.get('miscmod')) + int(pc_stats[save.get('stat')][1]) ) ) - if path[step] == 'Skill': + if path[step].lower() == 'skill': if node_class not in ('d20char_handler', "SWd20char_handler"): node = node.find('snf') node = node.find('skills') child_list = node.findall('skill') for child in child_list: - if path[step+1] == child.get('name'): + if path[step+1].lower() == child.get('name').lower(): if step+2 == depth: self.data = child.get('rank') - elif path[step+2] == 'Check': - self.data = 'Skill Check: ' + child.get('name') + ' [1d20+'+str( int(child.get('rank')) + int(pc_stats[child.get('stat')][1]) )+']' + elif path[step+2].lower() == 'check': + self.data = '<b>Skill Check:</b> ' + child.get('name') + ' [1d20+'+str( int(child.get('rank')) + int(pc_stats[child.get('stat')][1]) )+']' return - if path[step] == 'Feat': + if path[step].lower() == 'feat': if node_class not in ('d20char_handler', "SWd20char_handler"): node = node.find('snf') node = node.find('feats') child_list = node.findall('feat') for child in child_list: - if path[step+1] == child.get('name'): - if step+2 == depth: self.data = child.get('name') + ': ' + child.get('desc') + if path[step+1].lower() == child.get('name').lower(): + if step+2 == depth: self.data = '<b>'+child.get('name')+'</b>'+': '+child.get('desc') return - - if path[step] == 'Cast': + if path[step].lower() == 'cast': if node_class not in ('d20char_handler', "SWd20char_handler"): node = node.find('snp') node = node.find('spells') child_list = node.findall('spell') for child in child_list: - if path[step+1] == child.get('name'): - if step+2 == depth: self.data = child.get('name') + ': ' + child.get('desc') + if path[step+1].lower() == child.get('name').lower(): + if step+2 == depth: self.data = '<b>'+child.get('name')+'</b>'+': '+child.get('desc') return - - if path[step] == 'Attack': + if path[step].lower() == 'attack': if node_class not in ('d20char_handler', "SWd20char_handler"): node = node.find('combat') - if path[step+1] == 'Melee' or path[step+1] == 'M': + if path[step+1].lower() == 'melee' or path[step+1].lower() == 'm': + bonus_text = '(Melee)' bonus = node.find('attacks') bonus = bonus.find('melee') bonus = bonus.attrib; d = 0 - elif path[step+1] == 'Ranged' or path[step+1] == 'R': + elif path[step+1].lower() == 'ranged' or path[step+1].lower() == 'r': + bonus_text = '(Ranged)' bonus = node.find('attacks') bonus = bonus.find('ranged') bonus = bonus.attrib; d = 0 for b in bonus: d += int(bonus[b]) bonus = str(d) - if path[step+2] == None: - self.data = bonus + if path[step+2] == None: self.data = bonus else: weapons = node.find('attacks') weapons = weapons.findall('weapon') for child in weapons: - if path[step+2] == child.get('name'): - self.data = 'Attack: '+child.get('name')+' [1d20+'+bonus+'] ' + 'Damage: ['+child.get('damage')+']' + if path[step+2].lower() == child.get('name').lower(): + self.data = '<b>Attack: '+bonus_text+'</b> '+child.get('name')+' [1d20+'+bonus+'] ' + 'Damage: ['+child.get('damage')+']' return - elif pc_stats.has_key(path[step]): if step+1 == depth: self.data = pc_stats[path[step]][0] + ' +('+pc_stats[path[step]][1]+')' - elif path[step+1] == 'Mod': self.data = pc_stats[path[step]][1] - elif path[step+1] == 'Check': self.data = path[step] + ' Check: [1d20+' + str(pc_stats[path[step]][1]) +']' + elif path[step+1].lower() == 'mod': self.data = pc_stats[path[step]][1] + elif path[step+1].lower() == 'check': self.data = '<b>'+path[step]+' Check:</b> [1d20+'+str(pc_stats[path[step]][1])+']' return - def resolution(self, node): if self.passed == False: self.passed = True @@ -2026,6 +1988,7 @@ depth = len(path) self.gametree = component.get('tree') node = self.gametree.tree_map[path[0]]['node'] - if node.get('class') in ('dnd35char_handler', "SWd20char_handler", "d20char_handler", "dnd3echar_handler"): self.resolve_cust_loop(node, path, 1, depth) + if node.get('class') in ('dnd35char_handler', "SWd20char_handler", "d20char_handler", "dnd3echar_handler"): self.resolve_cust_loop(node, path, 1, depth) + elif node.get('class') == 'rpg_grid_handler': self.resolve_grid(node, path, 1, depth) else: self.resolve_loop(node, path, 1, depth) return self.data
--- a/orpg/gametree/nodehandlers/containers.py Wed Nov 18 19:57:52 2009 -0600 +++ b/orpg/gametree/nodehandlers/containers.py Sat Nov 21 03:19:34 2009 -0600 @@ -160,10 +160,11 @@ class group_edit_panel(wx.Panel): def __init__(self, parent, handler): wx.Panel.__init__(self, parent, -1) - self.handler = handler + self.handler = handler + self.outline = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Group"), wx.VERTICAL) + sizer = wx.BoxSizer(wx.VERTICAL) - self.text = { P_TITLE : wx.TextCtrl(self, P_TITLE, handler.xml.get('name')) - } + self.text = {P_TITLE : wx.TextCtrl(self, P_TITLE, handler.xml.get('name')) } sizer.Add(wx.StaticText(self, -1, "Title:"), 0, wx.EXPAND) sizer.Add(self.text[P_TITLE], 0, wx.EXPAND) sizer.Add(wx.Size(10,10)) @@ -180,10 +181,10 @@ sizer.Add(radio_c, 0, wx.EXPAND) sizer.Add(wx.Size(10,10)) - sizer.Add(radio_b, 0, wx.EXPAND) - - self.sizer = sizer - self.outline = wx.StaticBox(self,-1,"Group") + sizer.Add(radio_b, 0, wx.EXPAND) + + self.outline.Add(sizer, 0) + self.sizer = self.outline self.SetSizer(self.sizer) self.SetAutoLayout(True) self.Fit() @@ -220,10 +221,10 @@ container_handler.__init__(self, xml, tree_node) def get_design_panel(self,parent): - return tabbed_panel(parent,self,1) + return tabbed_edit_panel(parent, self) def get_use_panel(self,parent): - return tabbed_panel(parent,self,2) + return tabbed_panel(parent, self, 1) class tabbed_panel(orpgTabberWnd): @@ -232,7 +233,6 @@ self.handler = handler self.parent = parent handler.tree.traverse(handler.mytree_node, self.pick_panel, mode, False) - parent.SetSize(self.GetBestSize()) def pick_panel(self, treenode, mode): @@ -240,7 +240,28 @@ if mode == 1: panel = node.get_design_panel(self) else: panel = node.get_use_panel(self) name = node.xml.get("name") - if panel: self.AddPage(panel, name, False) + if panel: self.AddPage(panel, name, False) + +class tabbed_edit_panel(orpgTabberWnd): + def __init__(self, parent, handler): + orpgTabberWnd.__init__(self, parent, style=FNB.FNB_NO_X_BUTTON) + self.handler = handler + self.parent = parent + main_sizer = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Tabber"), wx.VERTICAL) + self.title = wx.TextCtrl(self, 1, handler.xml.get('name')) + main_sizer.Add(wx.StaticText(self, -1, "Title:"), 0, wx.EXPAND) + main_sizer.Add(self.title, 0, wx.EXPAND) + self.SetSizer(main_sizer) + self.SetAutoLayout(True) + self.Fit() + self.Bind(wx.EVT_TEXT, self.on_text, id=1) + + def on_text(self,evt): + txt = self.title.GetValue() + if txt != "": + self.handler.xml.set('name',txt) + self.handler.rename(txt) + ################################# ## Splitter container @@ -258,10 +279,6 @@ if child_xml.tag == "splitter_atts": self.xml.remove(child_xml) #Same here! elif child_xml: self.tree.load_xml(child_xml,self.mytree_node) if not self.xml.get('horizontal'): self.xml.set('horizontal', '0') - """if not self.atts: - self.atts = Element('splitter_atts') - self.atts.set("horizontal","0") - self.xml.append(self.atts)""" def get_design_panel(self,parent): return self.build_splitter_wnd(parent, 1) @@ -275,27 +292,16 @@ def build_splitter_wnd(self, parent, mode): self.split = self.xml.get("horizontal") - self.pane = splitter_panel(parent, self) - - self.splitter = MultiSplitterWindow(self.pane, -1, style=wx.SP_LIVE_UPDATE|wx.SP_3DSASH|wx.SP_NO_XP_THEME) - - if self.split == '1': - self.splitter.SetOrientation(wx.VERTICAL) - else: - self.splitter.SetOrientation(wx.HORIZONTAL) - + self.splitter = MultiSplitterWindow(self.pane, -1, + style=wx.SP_LIVE_UPDATE|wx.SP_3DSASH|wx.SP_NO_XP_THEME) + if self.split == '1': self.splitter.SetOrientation(wx.VERTICAL) + else: self.splitter.SetOrientation(wx.HORIZONTAL) self.bestSizex = -1 self.bestSizey = -1 - self.tree.traverse(self.mytree_node, self.doSplit, mode, False) - self.pane.sizer.Add(self.splitter, 1, wx.EXPAND) - - - if mode != 1: - self.pane.hozCheck.Hide() - + if mode != 1: self.pane.hozCheck.Hide() self.pane.SetSize((self.bestSizex, self.bestSizey)) self.pane.Layout() parent.SetSize(self.pane.GetSize()) @@ -305,7 +311,6 @@ node = self.tree.GetPyData(treenode) if mode == 1: tmp = node.get_design_panel(self.splitter) else: tmp = node.get_use_panel(self.splitter) - if self.split == '1': sash = tmp.GetBestSize()[1]+1 self.bestSizey += sash+11 @@ -316,9 +321,7 @@ self.bestSizex += sash if self.bestSizey < tmp.GetBestSize()[1]: self.bestSizey = tmp.GetBestSize()[1]+31 - self.splitter.AppendWindow(tmp, sash) - def get_size_constraint(self): return 1 @@ -327,17 +330,16 @@ wx.Panel.__init__(self, parent, -1) self.handler = handler sizer = wx.BoxSizer(wx.VERTICAL) + self.title = wx.TextCtrl(self, 1, handler.xml.get('name')) self.hozCheck = wx.CheckBox(self, -1, "Horizontal Split") hoz = self.handler.xml.get("horizontal") - if hoz == '1': - self.hozCheck.SetValue(True) - #self.splitsize = wx.BoxSizer(wx.HORIZONTAL) - else: - self.hozCheck.SetValue(False) - #self.splitsize = wx.BoxSizer(wx.VERTICAL) - + if hoz == '1': self.hozCheck.SetValue(True) + else: self.hozCheck.SetValue(False) + + sizer.Add(wx.StaticText(self, -1, "Title:"), 0, wx.EXPAND) + sizer.Add(self.title, 0) sizer.Add(self.hozCheck, 0, wx.EXPAND) sizer.Add(wx.Size(10,0)) #sizer.Add(self.splitsize, 1, wx.EXPAND) @@ -345,12 +347,17 @@ self.sizer = sizer self.SetSizer(self.sizer) self.SetAutoLayout(True) - + self.Bind(wx.EVT_TEXT, self.on_text, id=1) self.Bind(wx.EVT_CHECKBOX, self.on_check_box, id=self.hozCheck.GetId()) def on_check_box(self,evt): state = self.hozCheck.GetValue() - if state: - self.handler.xml.set("horizontal", "1") - else: - self.handler.xml.set("horizontal", "0") + if state: self.handler.xml.set("horizontal", "1") + else: self.handler.xml.set("horizontal", "0") + + def on_text(self,evt): + txt = self.title.GetValue() + if txt != "": + self.handler.xml.set('name',txt) + self.handler.rename(txt) +
--- a/orpg/gametree/nodehandlers/rpg_grid.py Wed Nov 18 19:57:52 2009 -0600 +++ b/orpg/gametree/nodehandlers/rpg_grid.py Sat Nov 21 03:19:34 2009 -0600 @@ -29,7 +29,7 @@ __version__ = "$Id: rpg_grid.py,v 1.20 2006/11/15 12:11:24 digitalxero Exp $" from core import * -from forms import * +from forms import * class rpg_grid_handler(node_handler): """ Node handler for rpg grid tool @@ -390,7 +390,7 @@ num = self.GetNumberRows() if num == 1: return - self.handler.grid.remove(self.handler.grid[num-1])#always remove last row -- nasty + self.handler.grid.remove(self.handler.grid[num-1])# always remove last row -- nasty self.DeleteRows(num-1,1) self.rows = self.handler.grid.findall('row') self.handler.refresh_rows() @@ -401,7 +401,7 @@ return for r in self.rows: cells = r.findall('cell') - r.remove(r[num-1])# always remove the last column -- nasty + r.remove(r[num-1]) # always remove the last column -- nasty self.DeleteCols(num-1,1) self.set_col_widths() @@ -433,37 +433,36 @@ def __init__(self, parent, handler): wx.Panel.__init__(self, parent, -1) self.handler = handler - self.grid = rpg_grid(self,handler) - self.title = wx.TextCtrl(self, G_TITLE, handler.xml.get('name')) + self.grid = rpg_grid(self,handler) + self.main_sizer = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Grid"), wx.VERTICAL) + self.title = wx.TextCtrl(self, G_TITLE, handler.xml.get('name')) + radio_b = wx.RadioBox(self, GRID_BOR, "Border (HTML)", choices=["no","yes"]) - border = handler.grid.get("border") + border = handler.grid.get("border") radio_b.SetSelection(int(border)) - self.auto_size = wx.CheckBox(self, G_AUTO_SIZE, " Auto Size") - if handler.is_autosized() == '1': - self.auto_size.SetValue(True) - else: - self.auto_size.SetValue(False) + self.auto_size = wx.CheckBox(self, G_AUTO_SIZE, "Auto Size") + if handler.is_autosized() == '1': self.auto_size.SetValue(True) + else: self.auto_size.SetValue(False) - sizer = wx.BoxSizer(wx.HORIZONTAL) + sizer = wx.BoxSizer(wx.HORIZONTAL) sizer.Add(wx.Button(self, G_ADD_ROW, "Add Row"), 1, wx.EXPAND) sizer.Add(wx.Size(10,10)) sizer.Add(wx.Button(self, G_DEL_ROW, "Remove Row"), 1, wx.EXPAND) sizer.Add(wx.Size(10,10)) sizer.Add(wx.Button(self, G_ADD_COL, "Add Column"), 1, wx.EXPAND) sizer.Add(wx.Size(10,10)) - sizer.Add(wx.Button(self, G_DEL_COL, "Remove Column"), 1, wx.EXPAND) + sizer.Add(wx.Button(self, G_DEL_COL, "Remove Column"), 1, wx.EXPAND) - self.main_sizer = wx.StaticBoxSizer(wx.StaticBox(self,-1,"Grid"), wx.VERTICAL) self.main_sizer.Add(wx.StaticText(self, -1, "Title:"), 0, wx.EXPAND) self.main_sizer.Add(self.title, 0, wx.EXPAND) self.main_sizer.Add(radio_b, 0, 0) self.main_sizer.Add(self.auto_size, 0, 0) self.main_sizer.Add(self.grid,1,wx.EXPAND) - self.main_sizer.Add(sizer,0,wx.EXPAND) + self.main_sizer.Add(sizer,0,wx.EXPAND) - self.SetSizer(self.main_sizer) + self.SetSizer(self.main_sizer) self.SetAutoLayout(True) self.Fit()
--- a/orpg/main.py Wed Nov 18 19:57:52 2009 -0600 +++ b/orpg/main.py Sat Nov 21 03:19:34 2009 -0600 @@ -135,6 +135,13 @@ logger.debug("plugins reloaded and startup plugins launched") self.Bind(wx.EVT_CLOSE, self.OnCloseWindow) + tipotday_start = settings.get('tipotday_start') + try: tipotday_start = int(tipotday_start) + except TypeError: tipotday_start = 0 + + + self.TipOfTheDay = wx.CreateFileTipProvider(dir_struct['data']+'tips.txt', tipotday_start) + #Load Update Manager component.add('updatemana', self.updateMana) logger.debug("update manager reloaded") @@ -145,23 +152,37 @@ logger.debug("debugger window") self.Bind(wx.EVT_CLOSE, self.OnCloseWindow) + def ShowTipOfTheDay(self): + if wx.ShowTip(self, self.TipOfTheDay, settings.get('tipotday_enabled') != '0'): + settings.change('tipotday_enabled', '1') + else: settings.change('tipotday_enabled', '0') + settings.change('tipotday_start', str(self.TipOfTheDay.CurrentTip)) def post_show_init(self): - """Some Actions need to be done after the main fram is drawn""" + """Some Actions need to be done after the main frame is drawn""" self.players.size_cols() + try: + if settings.get('tipotday_enabled').lower() != '0': self.ShowTipOfTheDay() + except: self.add_setting('Tip of the Day') - + + def add_setting(self, setting): + if setting == 'Tip of the Day': + settings.add_tab('General', 'Tip of the Day', 'grid') + settings.add('Tip of the Day', 'tipotday_start', '0', 'int', 'Current Tip of the Day') + settings.add('Tip of the Day', 'tipotday_enabled', '1', '0|1', 'Show Tip of the Day on startup') + logger.info('New Settings added', True) + self.TraipseSuiteWarn('debug') + def get_activeplugins(self): try: tmp = self.pluginsFrame.get_activeplugins() except: tmp = {} return tmp - def get_startplugins(self): try: tmp = self.pluginsFrame.get_startplugins() except: tmp = {} return tmp - def on_password_signal(self,signal,type,id,data): try: @@ -233,7 +254,8 @@ [' &About'], [' Online User Guide'], [' Change Log'], - [' Report a Bug'] + [' Report a Bug'], + [' Tip of the Day'] ]] self.mainmenu = MenuBarEx(self, menu) @@ -606,6 +628,9 @@ wb = webbrowser.get() wb.open("http://www.assembla.com/spaces/tickets/index/traipse_dev?spaces_tool_id=Tickets") + def OnMB_HelpTipoftheDay(self): + self.ShowTipOfTheDay() + ################################# ## Build the GUI @@ -762,8 +787,7 @@ self.Thaw() - def do_tab_window(self,xml_dom,parent_wnd): - #def do_tab_window(self, etreeEl, parent_wnd): + def do_tab_window(self, xml_dom, parent_wnd): # if container window loop through childern and do a recursive call temp_wnd = orpgTabberWnd(parent_wnd, style=FNB.FNB_ALLOW_FOREIGN_DND) @@ -772,12 +796,6 @@ wnd = self.build_window(c,temp_wnd) name = c.get("name") temp_wnd.AddPage(wnd, name, False) - - """ - for c in etreeEl.getchildren(): - wnd = self.build_window(c, temp_wnd) - temp_wnd.AddPage(wnd, c.get('name'), False) - """ return temp_wnd
--- a/orpg/mapper/map.py Wed Nov 18 19:57:52 2009 -0600 +++ b/orpg/mapper/map.py Sat Nov 21 03:19:34 2009 -0600 @@ -608,8 +608,7 @@ try: xml_dom = fromstring(xml) if xml_dom == None: return - if xml_dom.tag != 'map': node_list = xml_dom.find("map") - else: node_list = xml_dom + node_list = xml_dom.find("map") if xml_dom.tag != 'map' else xml_dom # set map version to incoming data so layers can convert self.map_version = node_list.get("version") action = node_list.get("action")
--- a/orpg/mapper/whiteboard.py Wed Nov 18 19:57:52 2009 -0600 +++ b/orpg/mapper/whiteboard.py Sat Nov 21 03:19:34 2009 -0600 @@ -33,6 +33,8 @@ from orpg.tools.orpg_log import debug from xml.etree.ElementTree import ElementTree, Element, tostring +## I added tr_ to the line and text ID. This should help prevent Traipse's lines from being randomly deleted. ## + def cmp_zorder(first,second): f = first.zorder s = second.zorder @@ -281,7 +283,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 = 'tr_line-' + str(self.next_serial()) line = WhiteboardLine(id, line_string, upperleft, lowerright, color=self.color, width=self.width) self.lines.append(line) xml_str = "<map><whiteboard>" @@ -380,7 +382,7 @@ self.font = font def add_text(self, text_string, pos, style, pointsize, weight, color="#000000"): - id = 'text-' + str(self.next_serial()) + id = 'tr_text-' + str(self.next_serial()) text = WhiteboardText(id,text_string, pos, style, pointsize, weight, color) self.texts.append(text) xml_str = "<map><whiteboard>"
--- a/orpg/orpg_version.py Wed Nov 18 19:57:52 2009 -0600 +++ b/orpg/orpg_version.py Sat Nov 21 03:19:34 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 = "091018-00" +BUILD = "091021-00" # This version is for network capability. PROTOCOL_VERSION = "1.2"