Пример #1
0
 def __onPlayerReady(self, result):
     if result:
         g_eventDispatcher.loadTrainingRoom()
     else:
         g_eventDispatcher.loadHangar()
         g_eventDispatcher.removeTrainingFromCarousel()
         g_eventDispatcher.addTrainingToCarousel(False)
Пример #2
0
 def __onPlayerReady(self, result):
     if result:
         g_eventDispatcher.loadTrainingRoom()
     elif self.hasEntity():
         g_eventDispatcher.loadHangar()
         g_eventDispatcher.removeTrainingFromCarousel()
         g_eventDispatcher.addTrainingToCarousel(False)
Пример #3
0
    def init(self, clientPrb=None, ctx=None):
        result = super(TrainingEntity, self).init(clientPrb=clientPrb, ctx=ctx)
        add = g_eventBus.addListener
        for event in self.__loadEvents:
            add(event, self.__handleViewLoad, scope=EVENT_BUS_SCOPE.LOBBY)

        self.__enterTrainingRoom(True)
        g_eventDispatcher.addTrainingToCarousel(False)
        result = FUNCTIONAL_FLAG.addIfNot(result, FUNCTIONAL_FLAG.LOAD_WINDOW)
        result = FUNCTIONAL_FLAG.addIfNot(result, FUNCTIONAL_FLAG.LOAD_PAGE)
        return result
Пример #4
0
 def __onPlayerReady(self, result):
     """
     Callback for player set ready opertaion
     Args:
         result: was operation successful
     """
     if result:
         g_eventDispatcher.loadTrainingRoom()
     else:
         g_eventDispatcher.addTrainingToCarousel(False)
         g_eventDispatcher.loadHangar()
Пример #5
0
 def init(self, clientPrb=None, ctx=None):
     result = super(TrainingEntity, self).init(clientPrb=clientPrb, ctx=ctx)
     g_eventBus.addListener(ViewEventType.LOAD_VIEW,
                            self.__handleViewLoad,
                            scope=EVENT_BUS_SCOPE.LOBBY)
     g_eventBus.addListener(ViewEventType.LOAD_GUI_IMPL_VIEW,
                            self.__handleViewLoad,
                            scope=EVENT_BUS_SCOPE.LOBBY)
     self.__enterTrainingRoom(isInitial=ctx.getInitCtx() is None)
     g_eventDispatcher.addTrainingToCarousel(False)
     result = FUNCTIONAL_FLAG.addIfNot(result, FUNCTIONAL_FLAG.LOAD_WINDOW)
     result = FUNCTIONAL_FLAG.addIfNot(result, FUNCTIONAL_FLAG.LOAD_PAGE)
     self.__watcher = TrainingVehiclesWatcher()
     self.__watcher.start()
     return result