Mercurial > fife-parpg
changeset 566:90d369c788c0
Updated the basicapplication extension to initialize pychan and modal execution. Also fixed the demos and editor to reflect this change.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Mon, 28 Jun 2010 15:43:42 +0000 |
parents | 8d0a4e87f24d |
children | 9152ed2b5bb8 |
files | demos/pychan_demo/pychan_test.py demos/rio_de_hola/run.py demos/rpg/scripts/rpg.py demos/shooter/run.py engine/python/fife/extensions/basicapplication.py tools/editor/scripts/editor.py |
diffstat | 6 files changed, 5 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/demos/pychan_demo/pychan_test.py Mon Jun 28 07:16:05 2010 +0000 +++ b/demos/pychan_demo/pychan_test.py Mon Jun 28 15:43:42 2010 +0000 @@ -86,7 +86,6 @@ super(DemoApplication,self).__init__() # Init Pychan - pychan.init(self.engine,debug=False) pychan.loadFonts("fonts/freefont.fontdef") pychan.manager.setDefaultFont("FreeSans") pychan.setupModalExecution(self.mainLoop,self.breakFromMainLoop)
--- a/demos/rio_de_hola/run.py Mon Jun 28 07:16:05 2010 +0000 +++ b/demos/rio_de_hola/run.py Mon Jun 28 15:43:42 2010 +0000 @@ -118,7 +118,6 @@ class IslandDemo(ApplicationBase): def __init__(self): super(IslandDemo,self).__init__(TDS) - pychan.init(self.engine, debug=TDS.get("FIFE", "PychanDebug")) self.world = world.World(self.engine) self.listener = ApplicationListener(self.engine, self.world) self.world.load(str(TDS.get("rio", "MapFile")))
--- a/demos/rpg/scripts/rpg.py Mon Jun 28 07:16:05 2010 +0000 +++ b/demos/rpg/scripts/rpg.py Mon Jun 28 15:43:42 2010 +0000 @@ -148,8 +148,6 @@ super(RPGApplication,self).__init__(TDS) self._settings = TDS - pychan.init(self.engine, debug=self._settings.get("FIFE", "PychanDebug", False)) - self._gamecontroller = GameController(self, self.engine, self._settings) def createListener(self):
--- a/demos/shooter/run.py Mon Jun 28 07:16:05 2010 +0000 +++ b/demos/shooter/run.py Mon Jun 28 15:43:42 2010 +0000 @@ -70,10 +70,6 @@ class Shooter(ApplicationBase): def __init__(self): 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._world = world.World(self, self.engine, self._setting) self._listener = ApplicationListener(self.engine, self._world)
--- a/engine/python/fife/extensions/basicapplication.py Mon Jun 28 07:16:05 2010 +0000 +++ b/engine/python/fife/extensions/basicapplication.py Mon Jun 28 15:43:42 2010 +0000 @@ -30,6 +30,7 @@ from fife import fife from fife.extensions import fifelog from fife.extensions.serializers.xmlanimation import XMLAnimationLoader +from fife.extensions import pychan from fife.extensions.fife_settings import Setting class ExitEventListener(fife.IKeyListener): @@ -85,10 +86,13 @@ self._animationloader = XMLAnimationLoader(self.engine.getImagePool(), self.engine.getVFS()) self.engine.getAnimationPool().addResourceLoader(self._animationloader) + pychan.init(self.engine, debug=self._setting.get("FIFE", "PychanDebug", False)) + pychan.setupModalExecution(self.mainLoop,self.breakFromMainLoop) + self.quitRequested = False self.breakRequested = False self.returnValues = [] - + def loadSettings(self): """ Load the settings from a python file and load them into the engine.
--- a/tools/editor/scripts/editor.py Mon Jun 28 07:16:05 2010 +0000 +++ b/tools/editor/scripts/editor.py Mon Jun 28 15:43:42 2010 +0000 @@ -103,9 +103,6 @@ ApplicationBase.__init__(self, TDS, *args, **kwargs) MainWindow.__init__(self, *args, **kwargs) - pychan.init(self.engine, debug=False) - - pychan.setupModalExecution(self.mainLoop,self.breakFromMainLoop) def _initTools(self): """ Initializes tools """