# HG changeset patch # User prock@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1277739822 0 # Node ID 90d369c788c06a1eb4116b980518f5e14f6fd858 # Parent 8d0a4e87f24d9ec18cfb03cb9173e6d474ad854e Updated the basicapplication extension to initialize pychan and modal execution. Also fixed the demos and editor to reflect this change. diff -r 8d0a4e87f24d -r 90d369c788c0 demos/pychan_demo/pychan_test.py --- 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) diff -r 8d0a4e87f24d -r 90d369c788c0 demos/rio_de_hola/run.py --- 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"))) diff -r 8d0a4e87f24d -r 90d369c788c0 demos/rpg/scripts/rpg.py --- 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): diff -r 8d0a4e87f24d -r 90d369c788c0 demos/shooter/run.py --- 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) diff -r 8d0a4e87f24d -r 90d369c788c0 engine/python/fife/extensions/basicapplication.py --- 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. diff -r 8d0a4e87f24d -r 90d369c788c0 tools/editor/scripts/editor.py --- 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 """