comparison orpg/mapper/map.py @ 195:b633f4c64aae alpha

Traipse Alpha 'OpenRPG' {100219-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 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
author sirebral
date Sat, 24 Apr 2010 08:37:20 -0500
parents ff19dd30064b
children 0ccfb8836b81
comparison
equal deleted inserted replaced
182:4b2884f29a72 195:b633f4c64aae
19 # 19 #
20 # File: mapper/map.py 20 # File: mapper/map.py
21 # Author: OpenRPG 21 # Author: OpenRPG
22 # Maintainer: 22 # Maintainer:
23 # Version: 23 # Version:
24 # $Id: map.py,v 1.73 2007/12/07 20:39:49 digitalxero Exp $ 24 # $Id: map.py,v Traipse 'Ornery-Orc' prof.ebral Exp $
25 # 25 #
26 # Description: 26 # Description:
27 # 27 #
28 __version__ = "$Id: map.py,v 1.73 2007/12/07 20:39:49 digitalxero Exp $" 28 __version__ = "$Id: map.py,v Traipse 'Ornery-Orc' prof.ebral Exp $"
29 29
30 from map_version import MAP_VERSION 30 from map_version import MAP_VERSION
31 from map_msg import * 31 from map_msg import *
32 from min_dialogs import * 32 from min_dialogs import *
33 from map_prop_dialog import * 33 from map_prop_dialog import *
365 dc = wx.ClientDC( self ) 365 dc = wx.ClientDC( self )
366 self.PrepareDC( dc ) 366 self.PrepareDC( dc )
367 dc.SetUserScale(self.layers['grid'].mapscale,self.layers['grid'].mapscale) 367 dc.SetUserScale(self.layers['grid'].mapscale,self.layers['grid'].mapscale)
368 # Grab the current map position 368 # Grab the current map position
369 pos = self.snapMarker( evt.GetLogicalPosition( dc ) ) 369 pos = self.snapMarker( evt.GetLogicalPosition( dc ) )
370 # Enable brush optimizations
371 # dc.SetOptimization( True )
372 # Set up the pen used for drawing our marker 370 # Set up the pen used for drawing our marker
373 dc.SetPen( wx.Pen(wx.RED, 1, wx.LONG_DASH) ) 371 dc.SetPen( wx.Pen(wx.RED, 1, wx.LONG_DASH) )
374 # Now, based on the marker mode, draw the right thing 372 # Now, based on the marker mode, draw the right thing
375 if self.markerMode == MARKER_MODE_MEASURE: 373 if self.markerMode == MARKER_MODE_MEASURE:
376 if self.markerStop.x != -1 and self.markerStop.y != -1: 374 if self.markerStop.x != -1 and self.markerStop.y != -1:
384 # Restore the default DC function 382 # Restore the default DC function
385 dc.SetLogicalFunction(wx.COPY) 383 dc.SetLogicalFunction(wx.COPY)
386 # As long as we are in marker mode, we ned to update the stop point 384 # As long as we are in marker mode, we ned to update the stop point
387 self.markerStop = pos 385 self.markerStop = pos
388 dc.SetPen(wx.NullPen) 386 dc.SetPen(wx.NullPen)
389 # Disable brush optimizations
390 #dc.SetOptimization( False )
391 del dc 387 del dc
392 388
393 def on_tape_down(self, evt): 389 def on_tape_down(self, evt):
394 """Greg's experimental tape measure code. Hopefully, when this is done, it will all be 390 """Greg's experimental tape measure code. Hopefully, when this is done, it will all be
395 modal based on a toolbar.""" 391 modal based on a toolbar."""
401 pos = self.snapMarker( evt.GetLogicalPosition( dc ) ) 397 pos = self.snapMarker( evt.GetLogicalPosition( dc ) )
402 # Maker mode should really be set by a toolbar 398 # Maker mode should really be set by a toolbar
403 self.markerMode = MARKER_MODE_MEASURE 399 self.markerMode = MARKER_MODE_MEASURE
404 # Erase the old line if her have one 400 # Erase the old line if her have one
405 if self.markerStart.x != -1 and self.markerStart.y != -1: 401 if self.markerStart.x != -1 and self.markerStart.y != -1:
406 # Enable brush optimizations
407 #dc.SetOptimization( True )
408 # Set up the pen used for drawing our marker 402 # Set up the pen used for drawing our marker
409 dc.SetPen( wx.Pen(wx.RED, 1, wx.LONG_DASH) ) 403 dc.SetPen( wx.Pen(wx.RED, 1, wx.LONG_DASH) )
410 # Set the DC function that we need 404 # Set the DC function that we need
411 dc.SetLogicalFunction(wx.INVERT) 405 dc.SetLogicalFunction(wx.INVERT)
412 # Draw the marker line 406 # Draw the marker line
414 dc.DrawLine( self.markerStart.x, self.markerStart.y, self.markerStop.x, self.markerStop.y ) 408 dc.DrawLine( self.markerStart.x, self.markerStart.y, self.markerStop.x, self.markerStop.y )
415 dc.EndDrawing() 409 dc.EndDrawing()
416 # Restore the default DC function and pen 410 # Restore the default DC function and pen
417 dc.SetLogicalFunction(wx.COPY) 411 dc.SetLogicalFunction(wx.COPY)
418 dc.SetPen(wx.NullPen) 412 dc.SetPen(wx.NullPen)
419 # Disable brush optimizations
420 #dc.SetOptimization( False )
421 # Save our current start and reset the stop value 413 # Save our current start and reset the stop value
422 self.markerStart = pos 414 self.markerStart = pos
423 self.markerStop = pos 415 self.markerStop = pos
424 del dc 416 del dc
425 417