Esempio n. 1
0
 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
Esempio n. 3
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)
Esempio n. 4
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)
Esempio n. 5
0
 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
Esempio n. 6
0
 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
Esempio n. 7
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
Esempio n. 8
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
 def doSelectAction(self, action):
     if action.actionName == PREBATTLE_ACTION_NAME.TRAININGS_LIST:
         g_eventDispatcher.loadTrainingList()
         return SelectResult(True)
     return super(TrainingIntroEntity, self).doSelectAction(action)
Esempio n. 10
0
 def doAction(self, action=None):
     g_eventDispatcher.loadTrainingList()
     return True
Esempio n. 11
0
 def __loadTrainingList(self):
     result = yield checkAmmoLevel()
     if result:
         g_eventDispatcher.loadTrainingList()
Esempio n. 12
0
 def doSelectAction(self, action):
     result = False
     if action.actionName == PREBATTLE_ACTION_NAME.TRAINING:
         g_eventDispatcher.loadTrainingList()
         result = True
     return result
Esempio n. 13
0
 def doAction(self, action = None, dispatcher = None):
     g_eventDispatcher.loadTrainingList()
     return True
Esempio n. 14
0
 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
Esempio n. 15
0
 def __loadTrainingList(self):
     result = yield checkAmmoLevel()
     if result:
         g_eventDispatcher.loadTrainingList()
Esempio n. 16
0
 def doSelectAction(self, action):
     result = False
     if action.actionName == PREBATTLE_ACTION_NAME.TRAINING:
         g_eventDispatcher.loadTrainingList()
         result = True
     return SelectResult(result, None)