Mercurial > fife-parpg
diff demos/shooter/run.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 | 520bd1621644 |
line wrap: on
line diff
--- a/demos/shooter/run.py Tue May 18 16:01:35 2010 +0000 +++ b/demos/shooter/run.py Tue May 18 19:37:31 2010 +0000 @@ -67,13 +67,11 @@ class Shooter(ApplicationBase): def __init__(self): - super(Shooter,self).__init__() + super(Shooter,self).__init__(TDS) pychan.init(self.engine, debug=False) #This is requred if you want to use modal dialog boxes pychan.setupModalExecution(self.mainLoop,self.breakFromMainLoop) - - self._setting = TDS self._world = world.World(self, self.engine, self._setting) self._listener = ApplicationListener(self.engine, self._world) @@ -84,50 +82,6 @@ cmd.setCommandType(fife.CMD_QUIT_GAME) self.engine.getEventManager().dispatchCommand(cmd) - def loadSettings(self): - """ - Load the settings from a python file and load them into the engine. - Called in the ApplicationBase constructor. I hard coded all the - settings in here to remove the complexity of loading settings from - an XML file which would be out of scope of this demo. - """ - - self._setting = TDS - - glyphDft = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-+/():;%&`'*#=[]\\\"" - engineSetting = self.engine.getSettings() - engineSetting.setDefaultFontGlyphs(self._setting.get("FIFE", "FontGlyphs", glyphDft)) - engineSetting.setDefaultFontPath(self._setting.get("FIFE", "Font", "fonts/FreeSans.ttf")) - engineSetting.setDefaultFontSize(self._setting.get("FIFE", "DefaultFontSize", 12)) - engineSetting.setBitsPerPixel(self._setting.get("FIFE", "BitsPerPixel", 0)) - engineSetting.setInitialVolume(self._setting.get("FIFE", "InitialVolume", 5.0)) - engineSetting.setSDLRemoveFakeAlpha(self._setting.get("FIFE", "SDLRemoveFakeAlpha", 1)) - engineSetting.setScreenWidth(self._setting.get("FIFE", "ScreenWidth", 1024)) - engineSetting.setScreenHeight(self._setting.get("FIFE", "ScreenHeight", 768)) - engineSetting.setRenderBackend(self._setting.get("FIFE", "RenderBackend", "OpenGL")) - engineSetting.setFullScreen(self._setting.get("FIFE", "FullScreen", 0)) - - engineSetting.setWindowTitle(self._setting.get("FIFE", "WindowTitle", "No window title set")) - engineSetting.setWindowIcon(self._setting.get("FIFE", "WindowIcon", "")) - engineSetting.setImageChunkingSize(self._setting.get("FIFE", "ImageChunkSize", 256)) - - def initLogging(self): - """ - Initialize the LogManager. - """ - - engineSetting = self.engine.getSettings() - logmodules = self._setting.get("FIFE", "LogModules", "controller") - - #log to both the console and log file - self._log = fifelog.LogManager(self.engine, - self._setting.get("FIFE", "LogToPrompt", "0"), - self._setting.get("FIFE", "LogToFile", "0")) - - self._log.setLevelFilter(fife.LogManager.LEVEL_DEBUG) - - if logmodules: - self._log.setVisibleModules(*logmodules) def createListener(self): pass # already created in constructor