diff tools/editor/scripts/editor.py @ 505:ee65aa323457

Updated the ApplicationBase settings to use the new and improved fife_setting extension. I was able to remove all the setting related functions from the demos and editor so that the ApplicationBase now takes care of all the FIFE related settings.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Tue, 18 May 2010 19:37:31 +0000
parents 3dff106b945b
children e34b44afd428
line wrap: on
line diff
--- a/tools/editor/scripts/editor.py	Tue May 18 16:01:35 2010 +0000
+++ b/tools/editor/scripts/editor.py	Tue May 18 19:37:31 2010 +0000
@@ -59,6 +59,8 @@
 from mapview import MapView
 from fife.extensions.fife_settings import Setting
 
+TDS = Setting(app_name="editor")
+
 def getEditor():
 	""" Returns the Global editor instance """
 	if Editor.editor is None:
@@ -95,51 +97,14 @@
 		
 		self._change_map = -1
 		
-		self._settings = None
+		self._settings = TDS
 		
 		self._help_dialog = None
 	
-		ApplicationBase.__init__(self, *args, **kwargs)
+		ApplicationBase.__init__(self, TDS, *args, **kwargs)
 		MainWindow.__init__(self, *args, **kwargs)
 		pychan.init(self.engine, debug=False)
 		
-
-	def loadSettings(self):
-		"""
-		Load the settings from a python file and load them into the engine.
-		Called in the ApplicationBase constructor.
-		"""
-		self._settings = Setting(app_name="editor")
-		TDS = self._settings
-		
-		glyphDft = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-+/():;%&`'*#=[]\\\""
-		engineSetting = self.engine.getSettings()
-		engineSetting.setDefaultFontGlyphs(TDS.get("FIFE", "FontGlyphs", glyphDft))
-		engineSetting.setDefaultFontPath(TDS.get("FIFE", "Font", "fonts/FreeSans.ttf"))
-		engineSetting.setDefaultFontSize(12)
-		engineSetting.setBitsPerPixel(TDS.get("FIFE", "BitsPerPixel", 0))
-		engineSetting.setInitialVolume(TDS.get("FIFE", "InitialVolume", 5.0))
-		engineSetting.setSDLRemoveFakeAlpha(TDS.get("FIFE", "SDLRemoveFakeAlpha", 1))
-		engineSetting.setScreenWidth(TDS.get("FIFE", "ScreenWidth", 1024))
-		engineSetting.setScreenHeight(TDS.get("FIFE", "ScreenHeight", 768))
-		engineSetting.setRenderBackend(TDS.get("FIFE", "RenderBackend", "OpenGL"))
-		engineSetting.setFullScreen(TDS.get("FIFE", "FullScreen", 0))
-
-		engineSetting.setWindowTitle(TDS.get("FIFE", "WindowTitle", "No window title set"))
-		engineSetting.setWindowIcon(TDS.get("FIFE", "WindowIcon", ""))
-		engineSetting.setImageChunkingSize(TDS.get("FIFE", "ImageChunkSize", 256))
-
-	def initLogging(self):
-		"""
-		Initialize the LogManager.
-		"""
-		from fife.extensions import fifelog
-		
-		logModules = self._settings.get("FIFE", "LogModules")
-		self.log = fifelog.LogManager(self.engine, self._settings.get("FIFE", "LogToPrompt"), self._settings.get("FIFE", "LogToFile"))
-		if logModules:
-			self.log.setVisibleModules(*logModules)
-		
 	def _initTools(self):
 		""" Initializes tools """
 		self._pluginmanager = plugin.PluginManager(self.getSettings())