comparison orpg/mapper/map.py @ 31:fc48380f0c9f ornery-orc

Traipse Beta 'OpenRPG' {100503-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 (Patch-2) New Features: New Namespace method with two new syntaxes New Namespace Internal is context sensitive, always! New Namespace External is 'as narrow as you make it' New Namespace FutureCheck helps ensure you don't receive an incorrect node New Namespace 2.0 documentation in the User Manual New Namespace plugin, Allows Traipse users to use the Standard syntax !@ :: @! New Mini Library with minis from Devin Knight New PluginDB access for URL2Link plugin New to Forms, they now show their content in Design Mode New to Update Manager, checks Repo for updates on software start New to Mini Lib node, change title in design mode New to Game Tree, never lose a node, appends a number to the end of corrupted trees New to Server GUI, Traipse Suite's Debug Console New Warhammer PC Sheet Updates: Update to White Board layer, uses a pencil image for color button Update to Grid Layer, uses a grid image for color button Update to Chat Window, size of drop down menus Update to default lobby message Update to template Text node Update to 4e PC Sheet node Update to how display names are acquired Update to Server, added some 'Pious' technology Update to features node Fixes: Fix to Server GUI startup errors Fix to Server GUI Rooms tab updating Fix to Chat and Settings if non existant die roller is picked Fix to Dieroller and .open() used with .vs(). Successes are correctly calculated Fix to Alias Lib's Export to Tree, Open, Save features Fix to alias node, now works properly Fix to Splitter node, minor GUI cleanup Fix to Backgrounds not loading through remote loader Fix to Node name errors Fix to rolling dice in chat Whispers Fix to Splitters Sizing issues Fix to URL2Link plugin, modified regex compilation should remove memory leak Fix to mapy.py, a roll back due to zoomed grid issues Fix to whiteboard_handler, Circles work by you clicking the center of the circle Fix to Servers parse_incoming_dom which was outdated and did not respect XML Fix to a broken link in the server welcome message Fix to InterParse and logger requiring traceback Fix to Update Manager Status Bar Fix to failed image and erroneous pop up Fix to Mini Lib node that was preventing use Fix to plugins that parce dice but did not call InterParse Fix to nodes for name changing by double click Fix to Game Tree, node ordering on drag and drop corrected Fix to Game Tree, corrupted error message was not showing Fix to Update Manager, checks for internet connection Fix to Update Manager, Auto Update corrections Fix to Server GUI's broadcast, room, player messaging
author sirebral
date Mon, 03 May 2010 03:30:11 -0500
parents ff154cf3350c
children d02e9197c066
comparison
equal deleted inserted replaced
30:8e77f169f324 31:fc48380f0c9f
154 cacheSize = component.get('settings').get_setting("ImageCacheSize") 154 cacheSize = component.get('settings').get_setting("ImageCacheSize")
155 if len(cacheSize): self.cacheSize = int(cacheSize) 155 if len(cacheSize): self.cacheSize = int(cacheSize)
156 else: pass 156 else: pass
157 if not ImageHandler.Queue.empty(): 157 if not ImageHandler.Queue.empty():
158 (path, image_type, imageId) = ImageHandler.Queue.get() 158 (path, image_type, imageId) = ImageHandler.Queue.get()
159 if path == 'failed': img = wx.Image(dir_struct["icon"] + "failed.png", wx.BITMAP_TYPE_PNG) 159 if (path == 'failed' or path == dir_struct["icon"] + "failed.png"):
160 img = wx.Image(dir_struct["icon"] + "failed.png", wx.BITMAP_TYPE_PNG)
160 else: img = wx.ImageFromMime(path[1], path[2]) 161 else: img = wx.ImageFromMime(path[1], path[2])
161 try: 162 try:
162 # Now, apply the image to the proper object 163 # Now, apply the image to the proper object
163 if image_type == "miniature": 164 if image_type == "miniature":
164 min = self.layers['miniatures'].get_miniature_by_id(imageId) 165 min = self.layers['miniatures'].get_miniature_by_id(imageId)
248 scrollsize = self.GetScrollPixelsPerUnit() 249 scrollsize = self.GetScrollPixelsPerUnit()
249 clientsize = self.GetClientSize() 250 clientsize = self.GetClientSize()
250 topleft1 = self.GetViewStart() 251 topleft1 = self.GetViewStart()
251 topleft = [topleft1[0]*scrollsize[0], topleft1[1]*scrollsize[1]] 252 topleft = [topleft1[0]*scrollsize[0], topleft1[1]*scrollsize[1]]
252 if (clientsize[0] > 1) and (clientsize[1] > 1): 253 if (clientsize[0] > 1) and (clientsize[1] > 1):
253 self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM) 254 dc = wx.MemoryDC()
254 dc = wx.AutoBufferedPaintDC(self) 255 bmp = wx.EmptyBitmap(clientsize[0]+1, clientsize[1]+1)
256 dc.SelectObject(bmp)
255 dc.SetPen(wx.TRANSPARENT_PEN) 257 dc.SetPen(wx.TRANSPARENT_PEN)
256 dc.SetBrush(wx.Brush(self.GetBackgroundColour(), wx.SOLID)) 258 dc.SetBrush(wx.Brush(self.GetBackgroundColour(), wx.SOLID))
257 dc.DrawRectangle(0,0,clientsize[0]+1,clientsize[1]+1) 259 dc.DrawRectangle(0,0,clientsize[0]+1,clientsize[1]+1)
258 dc.SetDeviceOrigin(-topleft[0], -topleft[1]) 260 dc.SetDeviceOrigin(-topleft[0], -topleft[1])
259 dc.SetUserScale(scale, scale) 261 dc.SetUserScale(scale, scale)
264 [clientsize[0]/scale, clientsize[1]/scale]) 266 [clientsize[0]/scale, clientsize[1]/scale])
265 self.layers['whiteboard'].layerDraw(dc) 267 self.layers['whiteboard'].layerDraw(dc)
266 self.layers['fog'].layerDraw(dc, topleft, clientsize) 268 self.layers['fog'].layerDraw(dc, topleft, clientsize)
267 dc.SetPen(wx.NullPen) 269 dc.SetPen(wx.NullPen)
268 dc.SetBrush(wx.NullBrush) 270 dc.SetBrush(wx.NullBrush)
271
272 dc.SelectObject(wx.NullBitmap)
273 del dc
274 wdc = self.preppaint()
275 wdc.DrawBitmap(bmp, topleft[0], topleft[1])
276
269 if settings.get_setting("AlwaysShowMapScale") == "1": 277 if settings.get_setting("AlwaysShowMapScale") == "1":
270 self.showmapscale(dc) 278 self.showmapscale(wdc)
271 try: evt.Skip() 279 try: evt.Skip()
272 except: pass 280 except: pass
281
282 def preppaint(self):
283 dc = wx.PaintDC(self)
284 self.PrepareDC(dc)
285 return (dc)
273 286
274 def showmapscale(self, dc): 287 def showmapscale(self, dc):
275 scalestring = "Scale x" + `self.layers['grid'].mapscale`[:3] 288 scalestring = "Scale x" + `self.layers['grid'].mapscale`[:3]
276 (textWidth, textHeight) = dc.GetTextExtent(scalestring) 289 (textWidth, textHeight) = dc.GetTextExtent(scalestring)
277 dc.SetUserScale(1, 1) 290 dc.SetUserScale(1, 1)