Пример #1
0
 def __onPlayerReady(self, result):
     if result:
         g_eventDispatcher.loadTrainingRoom()
     elif self.hasEntity():
         g_eventDispatcher.loadHangar()
         g_eventDispatcher.removeTrainingFromCarousel()
         g_eventDispatcher.addTrainingToCarousel(False)
 def _populate(self):
     if self.prbDispatcher:
         funcState = self.prbDispatcher.getFunctionalState()
         if not funcState.isInLegacy(PREBATTLE_TYPE.TRAINING):
             g_eventDispatcher.removeTrainingFromCarousel(False)
             return
     super(TrainingRoom, self)._populate()
Пример #3
0
 def __onPlayerReady(self, result):
     if result:
         g_eventDispatcher.loadTrainingRoom()
     else:
         g_eventDispatcher.loadHangar()
         g_eventDispatcher.removeTrainingFromCarousel()
         g_eventDispatcher.addTrainingToCarousel(False)
Пример #4
0
 def fini(self, clientPrb=None, ctx=None, woEvents=False):
     result = super(TrainingEntity, self).fini(clientPrb=clientPrb,
                                               ctx=ctx,
                                               woEvents=woEvents)
     g_eventBus.removeListener(ViewEventType.LOAD_VIEW,
                               self.__handleViewLoad,
                               scope=EVENT_BUS_SCOPE.LOBBY)
     g_eventBus.removeListener(ViewEventType.LOAD_GUI_IMPL_VIEW,
                               self.__handleViewLoad,
                               scope=EVENT_BUS_SCOPE.LOBBY)
     if not woEvents:
         aliasToLoad = [
             PREBATTLE_ALIASES.TRAINING_LIST_VIEW_PY,
             PREBATTLE_ALIASES.TRAINING_ROOM_VIEW_PY
         ]
         if not self.canSwitch(ctx) and g_eventDispatcher.needToLoadHangar(
                 ctx, self.getModeFlags(), aliasToLoad):
             g_eventDispatcher.loadHangar()
         g_eventDispatcher.removeTrainingFromCarousel(False)
         self.storage.suspend()
     else:
         g_eventDispatcher.removeTrainingFromCarousel(False,
                                                      closeWindow=False)
     if self.__watcher is not None:
         self.__watcher.stop()
         self.__watcher = None
     return result
Пример #5
0
 def fini(self, clientPrb=None, woEvents=False):
     super(TrainingIntroFunctional, self).fini()
     if self._flags & FUNCTIONAL_FLAG.SWITCH == 0 and not woEvents:
         g_eventDispatcher.loadHangar()
         g_eventDispatcher.removeTrainingFromCarousel()
         g_eventDispatcher.updateUI()
     return FUNCTIONAL_FLAG.UNDEFINED
Пример #6
0
 def fini(self, clientPrb = None, woEvents = False):
     super(TrainingIntroFunctional, self).fini()
     if self._flags & FUNCTIONAL_FLAG.SWITCH == 0 and not woEvents:
         g_eventDispatcher.loadHangar()
         g_eventDispatcher.removeTrainingFromCarousel()
         g_eventDispatcher.updateUI()
     return FUNCTIONAL_FLAG.UNDEFINED
Пример #7
0
 def fini(self, clientPrb=None, ctx=None, woEvents=False):
     result = super(TrainingIntroEntity, self).fini(clientPrb=clientPrb, ctx=ctx, woEvents=woEvents)
     if not woEvents:
         if not self.canSwitch(ctx) and self.needToLoadHangar():
             g_eventDispatcher.loadHangar()
         g_eventDispatcher.removeTrainingFromCarousel()
     else:
         g_eventDispatcher.removeTrainingFromCarousel(closeWindow=False)
     return result
Пример #8
0
 def _populate(self):
     super(Trainings, self)._populate()
     funcState = self.prbDispatcher.getFunctionalState()
     if not funcState.isInLegacy(PREBATTLE_TYPE.TRAINING):
         g_eventDispatcher.removeTrainingFromCarousel()
         return
     self.addListener(events.TrainingSettingsEvent.UPDATE_TRAINING_SETTINGS,
                      self._createTrainingRoom,
                      scope=EVENT_BUS_SCOPE.LOBBY)
 def fini(self, clientPrb=None, ctx=None, woEvents=False):
     result = super(TrainingIntroEntity, self).fini(clientPrb=clientPrb, ctx=ctx, woEvents=woEvents)
     if not woEvents:
         aliasToLoad = [PREBATTLE_ALIASES.TRAINING_LIST_VIEW_PY, PREBATTLE_ALIASES.TRAINING_ROOM_VIEW_PY]
         if not self.canSwitch(ctx) and g_eventDispatcher.needToLoadHangar(ctx, self.getModeFlags(), aliasToLoad):
             g_eventDispatcher.loadHangar()
         g_eventDispatcher.removeTrainingFromCarousel()
     else:
         g_eventDispatcher.removeTrainingFromCarousel(closeWindow=False)
     if self.__watcher is not None:
         self.__watcher.stop()
         self.__watcher = None
     return result
Пример #10
0
    def fini(self, clientPrb=None, ctx=None, woEvents=False):
        result = super(TrainingEntity, self).fini(clientPrb=clientPrb, ctx=ctx, woEvents=woEvents)
        remove = g_eventBus.removeListener
        for event in self.__loadEvents:
            remove(event, self.__handleViewLoad, scope=EVENT_BUS_SCOPE.LOBBY)

        if not woEvents:
            if not self.canSwitch(ctx) and self.needToLoadHangar():
                g_eventDispatcher.loadHangar()
            g_eventDispatcher.removeTrainingFromCarousel(False)
            self.storage.suspend()
        else:
            g_eventDispatcher.removeTrainingFromCarousel(False, closeWindow=False)
        return result
Пример #11
0
    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)
Пример #12
0
    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)
Пример #13
0
 def _populate(self):
     super(TrainingRoom, self)._populate()
     funcState = self.prbDispatcher.getFunctionalState()
     if not funcState.isInLegacy(PREBATTLE_TYPE.TRAINING):
         g_eventDispatcher.removeTrainingFromCarousel(False)
         return
     entity = self.prbEntity
     if entity.getEntityType():
         self.__showSettings(entity)
         self.__showRosters(entity, entity.getRosters())
         self.__swapTeamsInMinimap(entity.getPlayerTeam())
     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(entity.getPlayerInfo().getVehicle().isObserver)
     g_messengerEvents.users.onUserActionReceived += self.__me_onUserActionReceived
Пример #14
0
    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
Пример #15
0
    def fini(self, clientPrb=None, ctx=None, woEvents=False):
        super(EpicBattleTrainingEntity, self).fini(clientPrb=clientPrb, ctx=ctx, woEvents=woEvents)
        clientPrb = prb_getters.getClientPrebattle()
        if clientPrb is not None:
            clientPrb.onPlayerGroupChanged -= self.__prb_onPlayerGroupChanged
        remove = g_eventBus.removeListener
        for event in self.__loadEvents:
            remove(event, self.__handleViewLoad, scope=EVENT_BUS_SCOPE.LOBBY)

        if not woEvents:
            if not self.canSwitch(ctx):
                g_eventDispatcher.loadHangar()
            g_eventDispatcher.removeTrainingFromCarousel(False)
            self.storage.suspend()
        else:
            g_eventDispatcher.removeTrainingFromCarousel(False, closeWindow=False)
        return FUNCTIONAL_FLAG.UNDEFINED
Пример #16
0
    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
Пример #17
0
 def fini(self, clientPrb = None, woEvents = False):
     super(TrainingIntroFunctional, self).fini()
     if self._exit != FUNCTIONAL_EXIT.PREBATTLE and not woEvents:
         g_eventDispatcher.loadHangar()
         g_eventDispatcher.removeTrainingFromCarousel()
         g_eventDispatcher.updateUI()
Пример #18
0
 def fini(self, clientPrb=None, woEvents=False):
     super(TrainingIntroFunctional, self).fini()
     if self._exit != FUNCTIONAL_EXIT.PREBATTLE and not woEvents:
         g_eventDispatcher.loadHangar()
         g_eventDispatcher.removeTrainingFromCarousel()
         g_eventDispatcher.updateUI()