diff orpg/mapper/map.py @ 76:37a11fea3304 ornery-dev

More clean up. Images now posts a Chat Info post if image doesn't load.
author sirebral
date Sat, 22 Aug 2009 04:02:14 -0500
parents 449a8900f9ac
children 2f2bebe9c77f dcf4fbe09b70
line wrap: on
line diff
--- a/orpg/mapper/map.py	Fri Aug 21 21:49:42 2009 -0500
+++ b/orpg/mapper/map.py	Sat Aug 22 04:02:14 2009 -0500
@@ -35,7 +35,7 @@
 import random
 import os
 import thread
-import gc
+#import gc #Garbage Collecter Needed?
 import traceback
 
 from miniatures_handler import *
@@ -48,6 +48,7 @@
 from orpg.dirpath import dir_struct
 from images import ImageHandler
 from orpg.orpgCore import component
+from orpg.tools.orpg_settings import settings
 
 # Various marker modes for player tools on the map
 MARKER_MODE_NONE = 0
@@ -58,8 +59,6 @@
 class MapCanvas(wx.ScrolledWindow):
     def __init__(self, parent, ID, isEditor=0):
         self.parent = parent
-        self.log = component.get('log')
-        self.settings = component.get("settings")
         self.session = component.get("session")
         wx.ScrolledWindow.__init__(self, parent, ID, 
             style=wx.HSCROLL | wx.VSCROLL | wx.FULL_REPAINT_ON_RESIZE | wx.SUNKEN_BORDER )
@@ -156,7 +155,7 @@
                     self.parent.layer_tabs.EnableTab(cidx, True)
         if not self.cacheSizeSet:
             self.cacheSizeSet = True
-            cacheSize = self.settings.get_setting("ImageCacheSize")
+            cacheSize = component.get('settings').get_setting("ImageCacheSize")
             if len(cacheSize): self.cacheSize = int(cacheSize)
             else: pass
         if not ImageHandler.Queue.empty():
@@ -193,11 +192,11 @@
 
     def on_scroll(self, evt):
         if self.drag: self.drag.Hide()
-        if self.settings.get_setting("AlwaysShowMapScale") == "1": self.printscale()
+        if component.get('settings').get_setting("AlwaysShowMapScale") == "1": self.printscale()
         evt.Skip()
 
     def on_char(self, evt):
-        if self.settings.get_setting("AlwaysShowMapScale") == "1": self.printscale()
+        if component.get('settings').get_setting("AlwaysShowMapScale") == "1": self.printscale()
         evt.Skip()
 
     def printscale(self):
@@ -275,7 +274,7 @@
             del dc
             wdc = self.preppaint()
             wdc.DrawBitmap(bmp, topleft[0], topleft[1])
-            if self.frame.settings.get_setting("AlwaysShowMapScale") == "1":
+            if settings.get_setting("AlwaysShowMapScale") == "1":
                 self.showmapscale(wdc)
         try: evt.Skip()
         except: pass
@@ -715,11 +714,9 @@
 
 class map_wnd(wx.Panel):
     def __init__(self, parent, id):
-        self.log = component.get('log')
         wx.Panel.__init__(self, parent, id)
         self.canvas = MapCanvas(self, -1)
         self.session = component.get('session')
-        self.settings = component.get('settings')
         self.chat = component.get('chat')
         self.top_frame = component.get('frame')
         self.root_dir = os.getcwd()