changeset 7:d63ad196cc0d grumpy-goblin

dvrabel's (?) Mini Label Patch
author sirebral
date Fri, 17 Jul 2009 01:56:41 -0500
parents 29c4c9ae58f7
children 33582ce538b5
files orpg/mapper/miniatures.py orpg/mapper/miniatures_handler.py orpg/orpg_version.py
diffstat 3 files changed, 19 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/orpg/mapper/miniatures.py	Fri Jul 17 01:33:49 2009 -0500
+++ b/orpg/mapper/miniatures.py	Fri Jul 17 01:56:41 2009 -0500
@@ -494,8 +494,20 @@
         self.log.log("Enter miniature_layer", ORPG_DEBUG)
         self.settings = self.canvas.settings
         layer_base.__init__(self)
+
+        self.id = -1 #added.
+
         self.miniatures = []
         self.serial_number = 0
+
+        # Set the font of the labels to be the same as the chat window
+        # only smaller.
+        font_size = int(self.settings.get_setting('defaultfontsize'))
+        if (font_size >= 10):
+            font_size -= 2
+        self.label_font = wx.Font(font_size, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL,
+                                  False, self.settings.get_setting('defaultfont'))
+
         self.log.log("Exit miniature_layer", ORPG_DEBUG)
 
     def next_serial(self):
@@ -589,6 +601,9 @@
 
     def layerDraw(self, dc, topleft, size):
         self.log.log("Enter miniature_layer->layerDraw(self, dc, topleft, size)", ORPG_DEBUG)
+
+        dc.SetFont(self.label_font)
+
         sorted_miniatures = self.miniatures[:]
         sorted_miniatures.sort(cmp_zorder)
         for m in sorted_miniatures:
--- a/orpg/mapper/miniatures_handler.py	Fri Jul 17 01:33:49 2009 -0500
+++ b/orpg/mapper/miniatures_handler.py	Fri Jul 17 01:56:41 2009 -0500
@@ -583,10 +583,13 @@
                 return
             self.sel_min = mini
             self.sel_min.selected = True
+            """
             dc = wx.ClientDC(self.canvas)
             self.canvas.PrepareDC(dc)
             dc.SetUserScale(self.canvas.layers['grid'].mapscale,self.canvas.layers['grid'].mapscale)
             self.sel_min.draw(dc, self.canvas.layers['miniatures'])
+            """
+            self.canvas.Refresh()
         else:
             self.drag_mini = None
             pos = self.getLogicalPosition(evt)
--- a/orpg/orpg_version.py	Fri Jul 17 01:33:49 2009 -0500
+++ b/orpg/orpg_version.py	Fri Jul 17 01:56:41 2009 -0500
@@ -4,7 +4,7 @@
 #BUILD NUMBER FORMAT: "YYMMDD-##" where ## is the incremental daily build index (if needed)
 DISTRO = "Traipse"
 DIS_VER = "Grumpy Goblin"
-BUILD = "090717-00"
+BUILD = "090717-01"
 
 # This version is for network capability.
 PROTOCOL_VERSION = "1.2"