def init(self, clientPrb=None, ctx=None): result = super(TrainingIntroFunctional, self).init() g_eventDispatcher.loadTrainingList() result = FUNCTIONAL_INIT_RESULT.addIfNot( result, FUNCTIONAL_INIT_RESULT.LOAD_PAGE) g_eventDispatcher.updateUI() return result
def init(self, clientPrb=None, ctx=None): result = super(TrainingIntroEntity, self).init(clientPrb=clientPrb, ctx=ctx) g_eventDispatcher.loadTrainingList() result = FUNCTIONAL_FLAG.addIfNot(result, FUNCTIONAL_FLAG.LOAD_PAGE) self.__watcher = TrainingVehiclesWatcher() self.__watcher.start() return result
def fini(self, clientPrb = None, woEvents = False): super(TrainingFunctional, self).fini(clientPrb=clientPrb, woEvents=woEvents) remove = g_eventBus.removeListener for event in self.__loadEvents: remove(event, self.__handleViewLoad, scope=EVENT_BUS_SCOPE.LOBBY) if not woEvents: if self._exit == FUNCTIONAL_EXIT.INTRO_PREBATTLE: g_eventDispatcher.loadTrainingList() else: g_eventDispatcher.loadHangar() g_eventDispatcher.removeTrainingFromCarousel(False) g_eventDispatcher.updateUI() g_eventDispatcher.requestToDestroyPrbChannel(PREBATTLE_TYPE.TRAINING)
def fini(self, clientPrb=None, woEvents=False): super(TrainingFunctional, self).fini(clientPrb=clientPrb, woEvents=woEvents) remove = g_eventBus.removeListener for event in self.__loadEvents: remove(event, self.__handleViewLoad, scope=EVENT_BUS_SCOPE.LOBBY) if not woEvents: if self._exit == FUNCTIONAL_EXIT.INTRO_PREBATTLE: g_eventDispatcher.loadTrainingList() else: g_eventDispatcher.loadHangar() g_eventDispatcher.removeTrainingFromCarousel(False) g_eventDispatcher.updateUI() g_eventDispatcher.requestToDestroyPrbChannel(PREBATTLE_TYPE.TRAINING)
def _populate(self): super(TrainingRoom, self)._populate() functional = self.prbFunctional if functional and functional.getPrbType(): self.__showSettings(functional) self.__showRosters(functional, functional.getRosters()) self.__swapTeamsInMinimap(functional.getPlayerTeam()) else: self.destroy() g_eventDispatcher.loadTrainingList() return self.startPrbListening() self.addListener(events.CoolDownEvent.PREBATTLE, self.__handleSetPrebattleCoolDown, scope=EVENT_BUS_SCOPE.LOBBY) self.addListener(events.TrainingSettingsEvent.UPDATE_TRAINING_SETTINGS, self.__updateTrainingRoom, scope=EVENT_BUS_SCOPE.LOBBY) self.as_setObserverS(functional.getPlayerInfo().getVehicle().isObserver) g_messengerEvents.users.onUserRosterChanged += self.__me_onUserRosterChanged
def _populate(self): super(TrainingRoom, self)._populate() functional = self.prbFunctional if functional and functional.getEntityType(): self.__showSettings(functional) self.__showRosters(functional, functional.getRosters()) self.__swapTeamsInMinimap(functional.getPlayerTeam()) else: self.destroy() g_eventDispatcher.loadTrainingList() return self.startPrbListening() self.addListener(events.CoolDownEvent.PREBATTLE, self.__handleSetPrebattleCoolDown, scope=EVENT_BUS_SCOPE.LOBBY) self.addListener(events.TrainingSettingsEvent.UPDATE_TRAINING_SETTINGS, self.__updateTrainingRoom, scope=EVENT_BUS_SCOPE.LOBBY) self.as_setObserverS(functional.getPlayerInfo().getVehicle().isObserver) g_messengerEvents.users.onUserActionReceived += self.__me_onUserActionReceived
def fini(self, clientPrb = None, woEvents = False): super(TrainingFunctional, self).fini(clientPrb=clientPrb, woEvents=woEvents) remove = g_eventBus.removeListener for event in self.__loadEvents: remove(event, self.__handleViewLoad, scope=EVENT_BUS_SCOPE.LOBBY) if not woEvents: if self._flags & FUNCTIONAL_FLAG.SWITCH > 0: g_eventDispatcher.loadTrainingList() else: g_eventDispatcher.loadHangar() g_eventDispatcher.removeTrainingFromCarousel(False) g_eventDispatcher.updateUI() self.storage.suspend() g_eventDispatcher.requestToDestroyPrbChannel(PREBATTLE_TYPE.TRAINING) return FUNCTIONAL_FLAG.UNDEFINED
def fini(self, clientPrb=None, woEvents=False): super(TrainingFunctional, self).fini(clientPrb=clientPrb, woEvents=woEvents) remove = g_eventBus.removeListener for event in self.__loadEvents: remove(event, self.__handleViewLoad, scope=EVENT_BUS_SCOPE.LOBBY) if not woEvents: if self._flags & FUNCTIONAL_FLAG.SWITCH > 0: g_eventDispatcher.loadTrainingList() else: g_eventDispatcher.loadHangar() g_eventDispatcher.removeTrainingFromCarousel(False) g_eventDispatcher.updateUI() self.storage.suspend() else: g_eventDispatcher.removeTrainingFromCarousel(False) g_eventDispatcher.requestToDestroyPrbChannel(PREBATTLE_TYPE.TRAINING) return FUNCTIONAL_FLAG.UNDEFINED
def doSelectAction(self, action): if action.actionName == PREBATTLE_ACTION_NAME.TRAININGS_LIST: g_eventDispatcher.loadTrainingList() return SelectResult(True) return super(TrainingIntroEntity, self).doSelectAction(action)
def doAction(self, action=None): g_eventDispatcher.loadTrainingList() return True
def __loadTrainingList(self): result = yield checkAmmoLevel() if result: g_eventDispatcher.loadTrainingList()
def doSelectAction(self, action): result = False if action.actionName == PREBATTLE_ACTION_NAME.TRAINING: g_eventDispatcher.loadTrainingList() result = True return result
def doAction(self, action = None, dispatcher = None): g_eventDispatcher.loadTrainingList() return True
def init(self, clientPrb = None, ctx = None): result = super(TrainingIntroFunctional, self).init() g_eventDispatcher.loadTrainingList() result = FUNCTIONAL_INIT_RESULT.addIfNot(result, FUNCTIONAL_INIT_RESULT.LOAD_PAGE) g_eventDispatcher.updateUI() return result
def doSelectAction(self, action): result = False if action.actionName == PREBATTLE_ACTION_NAME.TRAINING: g_eventDispatcher.loadTrainingList() result = True return SelectResult(result, None)