def tryingToRun(self, runCtx): settings = TUTORIAL_SETTINGS.getSettings(runCtx.settings) if not settings.enabled: return else: runCtx.cache = TutorialCache.TutorialCache(BigWorld.player().name, settings.space) reqs = TUTORIAL_SETTINGS.factory(settings.reqs, init=(weakref.proxy(self), runCtx)) if reqs.isEnabled(): if self.__tutorial is None or self.__tutorial._settings.id != settings.id: self.__tutorial = Tutorial(settings) if self.__tutorial._descriptor is None: LOG_ERROR( 'Tutorial descriptor is not valid. Tutorial is not available.' ) return if self.__dispatcher is not None: self.__dispatcher.stop() self.__dispatcher = None self.__dispatcher = TUTORIAL_SETTINGS.factory( settings.dispatcher) self.__dispatcher.start(runCtx) self.__tutorial.setDispatcher(weakref.proxy(self.__dispatcher)) reqs.process() return
def tryingToRun(self, runCtx): settings = TUTORIAL_SETTINGS.getSettings(runCtx.settings) if not settings.enabled: return runCtx.cache = TutorialCache.TutorialCache(BigWorld.player().name, settings.space) reqs = TUTORIAL_SETTINGS.factory(settings.reqs, init=(weakref.proxy(self), runCtx)) if reqs.isEnabled(): if self.__tutorial is None or self.__tutorial._settings.id != settings.id: self.__tutorial = Tutorial(settings) if self.__tutorial._descriptor is None: LOG_ERROR('Tutorial descriptor is not valid. Tutorial is not available.') return if self.__dispatcher is not None: self.__dispatcher.stop() self.__dispatcher = None self.__dispatcher = TUTORIAL_SETTINGS.factory(settings.dispatcher) self.__dispatcher.start(runCtx) self.__tutorial.setDispatcher(weakref.proxy(self.__dispatcher)) reqs.process()