예제 #1
0
def addCompaniesToCarousel():
    clientID = channel_num_gen.getClientID4LazyChannel(LAZY_CHANNEL.COMPANIES)
    if not clientID:
        LOG_ERROR('Client ID not found', 'addCompaniesToCarousel')
        return
    else:
        g_eventBus.handleEvent(ChannelManagementEvent(
            clientID, ChannelManagementEvent.REQUEST_TO_ADD, {
                'label':
                LAZY_CHANNEL.COMPANIES,
                'canClose':
                False,
                'isNotified':
                False,
                'icon':
                None,
                'order':
                channel_num_gen.getOrder4LazyChannel(LAZY_CHANNEL.COMPANIES),
                'criteria': {
                    POP_UP_CRITERIA.VIEW_ALIAS:
                    guiFactory.getAliasByEvent(
                        events.ShowWindowEvent.SHOW_COMPANIES_WINDOW)
                },
                'openHandler':
                loadCompaniesWindow
            }),
                               scope=EVENT_BUS_SCOPE.LOBBY)
        return
예제 #2
0
def addSpecBattlesToCarousel():
    clientID = channel_num_gen.getClientID4LazyChannel(
        LAZY_CHANNEL.SPECIAL_BATTLES)
    if not clientID:
        LOG_ERROR('Client ID not found', 'addSpecBattlesToCarousel')
        return
    else:
        g_eventBus.handleEvent(ChannelManagementEvent(
            clientID, ChannelManagementEvent.REQUEST_TO_ADD, {
                'label':
                LAZY_CHANNEL.SPECIAL_BATTLES,
                'canClose':
                False,
                'isNotified':
                False,
                'icon':
                None,
                'order':
                channel_num_gen.getOrder4LazyChannel(
                    LAZY_CHANNEL.SPECIAL_BATTLES),
                'criteria': {
                    POP_UP_CRITERIA.VIEW_ALIAS:
                    guiFactory.getAliasByEvent(
                        events.ShowWindowEvent.SHOW_BATTLE_SESSION_LIST)
                },
                'openHandler':
                loadBattleSessionList
            }),
                               scope=EVENT_BUS_SCOPE.LOBBY)
        return
예제 #3
0
def addCompaniesToCarousel():
    clientID = channel_num_gen.getClientID4LazyChannel(LAZY_CHANNEL.COMPANIES)
    if not clientID:
        LOG_ERROR('Client ID not found', 'addCompaniesToCarousel')
        return
    else:
        g_eventBus.handleEvent(ChannelManagementEvent(clientID, ChannelManagementEvent.REQUEST_TO_ADD, {'label': LAZY_CHANNEL.COMPANIES,
         'canClose': False,
         'isNotified': False,
         'icon': None,
         'order': channel_num_gen.getOrder4LazyChannel(LAZY_CHANNEL.COMPANIES),
         'criteria': {POP_UP_CRITERIA.VIEW_ALIAS: guiFactory.getAliasByEvent(events.ShowWindowEvent.SHOW_COMPANIES_WINDOW)},
         'openHandler': loadCompaniesWindow}), scope=EVENT_BUS_SCOPE.LOBBY)
        return
예제 #4
0
def addSpecBattlesToCarousel():
    clientID = channel_num_gen.getClientID4LazyChannel(LAZY_CHANNEL.SPECIAL_BATTLES)
    if not clientID:
        LOG_ERROR('Client ID not found', 'addSpecBattlesToCarousel')
        return
    else:
        g_eventBus.handleEvent(ChannelManagementEvent(clientID, ChannelManagementEvent.REQUEST_TO_ADD, {'label': LAZY_CHANNEL.SPECIAL_BATTLES,
         'canClose': False,
         'isNotified': False,
         'icon': None,
         'order': channel_num_gen.getOrder4LazyChannel(LAZY_CHANNEL.SPECIAL_BATTLES),
         'criteria': {POP_UP_CRITERIA.VIEW_ALIAS: guiFactory.getAliasByEvent(events.ShowWindowEvent.SHOW_BATTLE_SESSION_LIST)},
         'openHandler': loadBattleSessionList}), scope=EVENT_BUS_SCOPE.LOBBY)
        return
예제 #5
0
 def addSpecBattlesToCarousel(self):
     clientID = channel_num_gen.getClientID4LazyChannel(LAZY_CHANNEL.SPECIAL_BATTLES)
     if not clientID:
         LOG_ERROR("Client ID not found", "addSpecBattlesToCarousel")
         return
     currCarouselItemCtx = _defCarouselItemCtx._replace(
         label=LAZY_CHANNEL.SPECIAL_BATTLES,
         order=channel_num_gen.getOrder4LazyChannel(LAZY_CHANNEL.SPECIAL_BATTLES),
         isNotified=True,
         criteria={POP_UP_CRITERIA.VIEW_ALIAS: PREBATTLE_ALIASES.BATTLE_SESSION_LIST_WINDOW_PY},
         openHandler=self.loadBattleSessionList,
     )
     self._fireEvent(
         ChannelManagementEvent(clientID, PreBattleChannelEvent.REQUEST_TO_ADD, currCarouselItemCtx._asdict())
     )
 def addChannel(self, channel, lazy = False, isNotified = False):
     clientID = channel.getClientID()
     isSystem = channel.isSystem()
     if lazy:
         order = channel_num_gen.getOrder4LazyChannel(channel.getName())
         openHandler = lambda : events_dispatcher.showLazyChannelWindow(clientID)
     else:
         order = channel_num_gen.genOrder4Channel(channel)
         openHandler = lambda : events_dispatcher.showLobbyChannelWindow(clientID)
     self.__handlers[clientID] = (ChannelFindCriteria(clientID), openHandler)
     self.__channelsDP.addItem(clientID, {'label': channel.getFullName(),
      'canClose': not isSystem,
      'isNotified': isNotified,
      'icon': None,
      'order': order})
     return
 def addChannel(self, channel, lazy = False, isNotified = False):
     clientID = channel.getClientID()
     isSystem = channel.isSystem()
     if lazy:
         order = channel_num_gen.getOrder4LazyChannel(channel.getName())
         openHandler = lambda : events_dispatcher.showLazyChannelWindow(clientID)
     else:
         order = channel_num_gen.genOrder4Channel(channel)
         openHandler = lambda : events_dispatcher.showLobbyChannelWindow(clientID)
     self.__handlers[clientID] = (ChannelFindCriteria(clientID), openHandler, ViewTypes.WINDOW)
     self.__channelsDP.addItem(clientID, {'label': channel.getFullName(),
      'canClose': not isSystem,
      'isNotified': isNotified,
      'icon': None,
      'order': order,
      'isInProgress': False})
     return
예제 #8
0
 def addSpecBattlesToCarousel(self):
     clientID = channel_num_gen.getClientID4LazyChannel(
         LAZY_CHANNEL.SPECIAL_BATTLES)
     if not clientID:
         LOG_ERROR('Client ID not found', 'addSpecBattlesToCarousel')
         return
     currCarouselItemCtx = _defCarouselItemCtx._replace(
         label=LAZY_CHANNEL.SPECIAL_BATTLES,
         order=channel_num_gen.getOrder4LazyChannel(
             LAZY_CHANNEL.SPECIAL_BATTLES),
         isNotified=True,
         criteria={
             POP_UP_CRITERIA.VIEW_ALIAS:
             PREBATTLE_ALIASES.BATTLE_SESSION_LIST_WINDOW_PY
         },
         openHandler=self.loadBattleSessionList)
     self._fireEvent(
         ChannelManagementEvent(clientID,
                                PreBattleChannelEvent.REQUEST_TO_ADD,
                                currCarouselItemCtx._asdict()))
예제 #9
0
 def addChannel(self, channel, lazy=False, isNotified=False):
     clientID = channel.getClientID()
     isSystem = channel.isSystem()
     if lazy:
         order = channel_num_gen.getOrder4LazyChannel(channel.getName())
         openHandler = lambda: events_dispatcher.showLazyChannelWindow(clientID)
     else:
         order = channel_num_gen.genOrder4Channel(channel)
         openHandler = lambda: events_dispatcher.showLobbyChannelWindow(clientID)
     self.__handlers[clientID] = (ChannelFindCriteria(clientID), openHandler, ViewTypes.WINDOW)
     self.__channelsDP.addItem(
         clientID,
         {
             "label": channel.getFullName(),
             "canClose": not isSystem,
             "isNotified": isNotified,
             "icon": None,
             "order": order,
             "isInProgress": False,
         },
     )
     return