Пример #1
0
    def __init__(self, TDS):
        """Initialized the application

        Args:
            TDS: A fife_settings.Setting instance
        """
        ApplicationBase.__init__(self, TDS)
        FifeManager.__init__(self)
        self.name = self.settings.get("fife-rpg", "ProjectName")
        if self.name is None:
            raise AttributeError("The application name is not specified in"
                                 "the settings file")
        self._listener = None
        self.world = None
        self._maps = {}
        self._current_map = None
        self._languages = {}
        self._current_language = ""
        self._components = {}
        self._actions = {}
        self._systems = {}
        self._behaviours = {}
        self._map_switched_callbacks = []
        self._map_loaded_callbacks = []
        default_language = self.settings.get("i18n", "DefaultLanguage", "en")
        languages_dir = self.settings.get("i18n", "Directory", "__languages")
        for language in self.settings.get("i18n", "Languages", ("en",)):
            fallback = (language == default_language)
            self._languages[language] = gettext.translation(self.name,
                                                            languages_dir,
                                                            [language],
                                                            fallback=fallback)
        language = self.settings.get("i18n", "Language", default_language)
        self.switch_language(language)
Пример #2
0
	def __init__(self, options, mapfile, *args, **kwargs):
		Editor.editor = self

		self._filemanager = None

		self._options = options
		self._mapfile = mapfile
		self._eventlistener = None
		self._pluginmanager = None

		self._inited = False

		self._mapview = None
		self._mapviewlist = []
		self._mapgroup = None
		self._mapbar = None
		self._maparea = None
		self._mapeditor = None

		self._file_menu = None
		self._edit_menu = None
		self._view_menu = None
		self._tools_menu = None
		self._help_menu = None

		self._change_map = -1

		self._settings = TDS

		self._lighting_mode = int(TDS.get("FIFE", "Lighting"))
		self._help_dialog = None

		ApplicationBase.__init__(self, TDS, *args, **kwargs)
		MainWindow.__init__(self, *args, **kwargs)
Пример #3
0
    def __init__(self, TDS):
        """Initialized the application

        Args:
            TDS: A fife_settings.Setting instance
        """
        ApplicationBase.__init__(self, TDS)
        FifeManager.__init__(self)
        self.name = self.settings.get("fife-rpg", "ProjectName")
        if self.name is None:
            raise AttributeError("The application name is not specified in"
                                 "the settings file")
        self._listener = None
        self.world = None
        self._maps = {}
        self._current_map = None
        self._languages = {}
        self._current_language = ""
        self._components = {}
        self._actions = {}
        self._systems = {}
        self._behaviours = {}
        self._map_switched_callbacks = []
        self._map_loaded_callbacks = []
        default_language = self.settings.get("i18n", "DefaultLanguage", "en")
        languages_dir = self.settings.get("i18n", "Directory", "__languages")
        for language in self.settings.get("i18n", "Languages", ("en", )):
            fallback = (language == default_language)
            self._languages[language] = gettext.translation(self.name,
                                                            languages_dir,
                                                            [language],
                                                            fallback=fallback)
        language = self.settings.get("i18n", "Language", default_language)
        self.switch_language(language)
Пример #4
0
    def __init__(self, setting):
        """Initialise the instance.
           @return: None"""
        ApplicationBase.__init__(self, setting)
        self.manager = FifeManager()
        # KLUDGE M. George Hansen 2011-06-04: See parpg/vfs.py.
        vfs.VFS = self.engine.getVFS()
        vfs.VFS.addNewSource(setting.get("parpg","DataPath"))

        self.quitRequested = False
        self.breakRequested = False
        self.returnValues = []
        #self.engine.getModel(self)
        self.model = GameModel(self.engine, setting)
        self.model.readMapFiles()
        self.model.readObjectDB()
        self.model.getAgentImportFiles()
        self.model.readAllAgents()
        self.model.getDialogues()
        # KLUDGE M. George Hansen 2011-06-04: Hack to allow loaded PyChan XML
        #     scripts to locate their resources.
        os.chdir(setting.get("parpg","DataPath"))
        self.view = MainMenuView(self.engine, self.model)
        self.loadFonts()
        self.event_listener = EventListener(self.engine)
        controller = MainMenuController(self.engine, self.view, self.model, 
                                        self)
        #controller.initHud()
        self.manager.push_mode(controller)
        self.listener = ApplicationListener(self.event_listener,
                                            self.engine, 
                                            self.view, 
                                            self.model)
Пример #5
0
    def __init__(self, options, mapfile, *args, **kwargs):
        Editor.editor = self

        self._filemanager = None

        self._options = options
        self._mapfile = mapfile
        self._eventlistener = None
        self._pluginmanager = None

        self._inited = False

        self._mapview = None
        self._mapviewlist = []
        self._mapgroup = None
        self._mapbar = None
        self._maparea = None
        self._mapeditor = None

        self._file_menu = None
        self._edit_menu = None
        self._view_menu = None
        self._tools_menu = None
        self._help_menu = None

        self._change_map = -1

        self._settings = TDS

        self._lighting_mode = int(TDS.get("FIFE", "Lighting"))
        self._help_dialog = None

        ApplicationBase.__init__(self, TDS, *args, **kwargs)
        MainWindow.__init__(self, *args, **kwargs)
Пример #6
0
    def quit(self):
        """ Quits the editor. An onQuit signal is sent before the application closes """
        events.onQuit.send(sender=self)

        self._pluginmanager.stop()

        self._settings.saveSettings()
        ApplicationBase.quit(self)
Пример #7
0
	def quit(self):
		""" Quits the editor. An onQuit signal is sent before the application closes """
		events.onQuit.send(sender=self)

		self._settings.saveSettings()
		ApplicationBase.quit(self)