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
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 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
def addSpecBattleToCarousel(prbType): clientID = channel_num_gen.getClientID4Prebattle(prbType) if not clientID: LOG_ERROR('Client ID not found', 'addSpecBattleToCarousel') return else: if prbType is PREBATTLE_TYPE.CLAN: label = CHAT.CHANNELS_CLAN elif prbType is PREBATTLE_TYPE.TOURNAMENT: label = CHAT.CHANNELS_TOURNAMENT else: LOG_ERROR('Prebattle type is not valid', prbType) return g_eventBus.handleEvent(ChannelManagementEvent( clientID, ChannelManagementEvent.REQUEST_TO_ADD, { 'label': label, 'canClose': False, 'isNotified': False, 'icon': None, 'order': channel_num_gen.getOrder4Prebattle(), 'criteria': { POP_UP_CRITERIA.VIEW_ALIAS: guiFactory.getAliasByEvent( events.ShowWindowEvent.SHOW_BATTLE_SESSION_WINDOW) }, 'openHandler': _showBattleSessionWindow }), scope=EVENT_BUS_SCOPE.LOBBY) return
def removeSquadFromCarousel(): clientID = channel_num_gen.getClientID4Prebattle(PREBATTLE_TYPE.SQUAD) if not clientID: LOG_ERROR('Client ID not found', '_removeSquadFromCarousel') return g_eventBus.handleEvent(ChannelManagementEvent( clientID, ChannelManagementEvent.REQUEST_TO_REMOVE), scope=EVENT_BUS_SCOPE.LOBBY)
def removeSpecBattleFromCarousel(prbType): clientID = channel_num_gen.getClientID4Prebattle(prbType) if not clientID: LOG_ERROR('Client ID not found', '_removeSpecBattleFromCarousel') return g_eventBus.handleEvent(ChannelManagementEvent( clientID, ChannelManagementEvent.REQUEST_TO_REMOVE), scope=EVENT_BUS_SCOPE.LOBBY)
def removeSpecBattlesFromCarousel(): clientID = channel_num_gen.getClientID4LazyChannel( LAZY_CHANNEL.SPECIAL_BATTLES) if not clientID: LOG_ERROR('Client ID not found', 'removeSpecBattlesFromCarousel') return g_eventBus.handleEvent(ChannelManagementEvent( clientID, ChannelManagementEvent.REQUEST_TO_REMOVE), scope=EVENT_BUS_SCOPE.LOBBY)
def removeSpecBattlesFromCarousel(self): clientID = channel_num_gen.getClientID4LazyChannel( LAZY_CHANNEL.SPECIAL_BATTLES) if not clientID: LOG_ERROR('Client ID not found', 'removeSpecBattlesFromCarousel') return self._fireEvent( ChannelManagementEvent(clientID, PreBattleChannelEvent.REQUEST_TO_REMOVE))
def _dispose(self): self.__receivers = [] self._ignoreActionCooldown.stop() self._ignoreActionCooldown = None self.fireEvent(ChannelManagementEvent(0, ChannelManagementEvent.UNREGISTER_BATTLE), scope=EVENT_BUS_SCOPE.BATTLE) self.removeListener(ChannelManagementEvent.MESSAGE_FADING_ENABLED, self.__handleMessageFadingEnabled, EVENT_BUS_SCOPE.GLOBAL) self.sessionProvider.removeArenaCtrl(self) g_replayEvents.onTimeWarpStart -= self.__onReplayTimeWarpStart g_replayEvents.onTimeWarpFinish -= self.__onReplayTimeWarpFinished super(BattleMessengerView, self)._dispose() return
def _dispose(self): self.__receivers = [] self.fireEvent(ChannelManagementEvent( 0, ChannelManagementEvent.UNREGISTER_BATTLE), scope=EVENT_BUS_SCOPE.BATTLE) self.removeListener(events.GameEvent.SHOW_CURSOR, self.__handleShowCursor, EVENT_BUS_SCOPE.GLOBAL) self.removeListener(events.GameEvent.HIDE_CURSOR, self.__handleHideCursor, EVENT_BUS_SCOPE.GLOBAL) self.removeListener(ChannelManagementEvent.MESSAGE_FADING_ENABLED, self.__handleMessageFadingEnabled, EVENT_BUS_SCOPE.GLOBAL) super(BattleMessengerView, self)._dispose()
def _populate(self): super(BattleMessengerView, self)._populate() self.__receivers = [] self.as_setupListS(_makeSettingsVO()) self.fireEvent(ChannelManagementEvent( 0, ChannelManagementEvent.REGISTER_BATTLE, {'component': self}), scope=EVENT_BUS_SCOPE.BATTLE) self.addListener(events.GameEvent.SHOW_CURSOR, self.__handleShowCursor, EVENT_BUS_SCOPE.GLOBAL) self.addListener(events.GameEvent.HIDE_CURSOR, self.__handleHideCursor, EVENT_BUS_SCOPE.GLOBAL) self.addListener(ChannelManagementEvent.MESSAGE_FADING_ENABLED, self.__handleMessageFadingEnabled, EVENT_BUS_SCOPE.GLOBAL)
def _populate(self): super(BattleMessengerView, self)._populate() self._accDbID = getAvatarDatabaseID() self.__receivers = [] self.fireEvent(ChannelManagementEvent( 0, ChannelManagementEvent.REGISTER_BATTLE, {'component': self}), scope=EVENT_BUS_SCOPE.BATTLE) self.addListener(ChannelManagementEvent.MESSAGE_FADING_ENABLED, self.__handleMessageFadingEnabled, EVENT_BUS_SCOPE.GLOBAL) self.__restoreLastReceiverInBattle() g_sessionProvider.addArenaCtrl(self) self.as_setupListS(_makeSettingsVO(self._arenaVisitor)) self._ignoreActionCooldown.start() if self.isToxicPanelAvailable(): self.as_enableToxicPanelS()
def _populate(self): super(BattleMessengerView, self)._populate() self._avatarSessionID = getAvatarSessionID() self.__isInTimeWarp = BattleReplay.g_replayCtrl.isTimeWarpInProgress self.__receivers = [] self.fireEvent(ChannelManagementEvent(0, ChannelManagementEvent.REGISTER_BATTLE, {'component': self}), scope=EVENT_BUS_SCOPE.BATTLE) self.addListener(ChannelManagementEvent.MESSAGE_FADING_ENABLED, self.__handleMessageFadingEnabled, EVENT_BUS_SCOPE.GLOBAL) self.__restoreLastReceiverInBattle() self.sessionProvider.addArenaCtrl(self) self.as_setupListS(_makeSettingsVO(self._arenaVisitor)) self._ignoreActionCooldown.start() if self.isToxicPanelAvailable(): self.as_enableToxicPanelS() if self.__invalidateReceiverIndex(): self.as_changeReceiverS(self.__receiverIndex) if BattleReplay.g_replayCtrl.isPlaying: g_replayEvents.onTimeWarpStart += self.__onReplayTimeWarpStart g_replayEvents.onTimeWarpFinish += self.__onReplayTimeWarpFinished
def addSquadToCarousel(): clientID = channel_num_gen.getClientID4Prebattle(PREBATTLE_TYPE.SQUAD) if not clientID: LOG_ERROR('Client ID not found', 'addSquadToCarousel') return g_eventBus.handleEvent(ChannelManagementEvent( clientID, ChannelManagementEvent.REQUEST_TO_ADD, { 'label': CHAT.CHANNELS_SQUAD, 'canClose': False, 'isNotified': False, 'icon': '../maps/icons/messenger/squad_icon.png', 'order': channel_num_gen.getOrder4Prebattle(), 'criteria': { POP_UP_CRITERIA.VIEW_ALIAS: guiFactory.getAliasByEvent( events.ShowWindowEvent.SHOW_SQUAD_WINDOW) }, 'openHandler': _showSquadWindow }), scope=EVENT_BUS_SCOPE.LOBBY)
def addCompanyToCarousel(): clientID = channel_num_gen.getClientID4Prebattle(PREBATTLE_TYPE.COMPANY) if not clientID: LOG_ERROR('Client ID not found', 'addCompanyToCarousel') return else: g_eventBus.handleEvent(ChannelManagementEvent( clientID, ChannelManagementEvent.REQUEST_TO_ADD, { 'label': CHAT.CHANNELS_TEAM, 'canClose': False, 'isNotified': False, 'icon': None, 'order': channel_num_gen.getOrder4Prebattle(), 'criteria': { POP_UP_CRITERIA.VIEW_ALIAS: guiFactory.getAliasByEvent( events.ShowWindowEvent.SHOW_COMPANY_WINDOW) }, 'openHandler': _showCompanyWindow }), scope=EVENT_BUS_SCOPE.LOBBY) return
def addUnitToCarousel(): from gui.Scaleform.locale.CYBERSPORT import CYBERSPORT clientID = channel_num_gen.getClientID4Prebattle(PREBATTLE_TYPE.UNIT) if not clientID: LOG_ERROR('Client ID not found', 'addUnitToCarousel') return else: g_eventBus.handleEvent(ChannelManagementEvent( clientID, ChannelManagementEvent.REQUEST_TO_ADD, { 'label': CYBERSPORT.WINDOW_TITLE, 'canClose': False, 'isNotified': False, 'icon': None, 'order': channel_num_gen.getOrder4Prebattle(), 'criteria': { POP_UP_CRITERIA.VIEW_ALIAS: guiFactory.getAliasByEvent( events.ShowWindowEvent.SHOW_UNIT_WINDOW) }, 'openHandler': showUnitWindow }), scope=EVENT_BUS_SCOPE.LOBBY) return
def _handleAddPreBattleRequest(self, clientID, carouselItemCtx): self._fireEvent( ChannelManagementEvent( clientID, PreBattleChannelEvent.REQUEST_TO_ADD_PRE_BATTLE_CHANNEL, carouselItemCtx))
def _handleRemoveRequest(self, clientID): self._fireEvent( ChannelManagementEvent( clientID, PreBattleChannelEvent.REQUEST_TO_REMOVE_PRE_BATTLE_CHANNEL))
def __handleRemoveRequest(self, clientID, closeWindow=True): self.__fireEvent( ChannelManagementEvent( clientID, PreBattleChannelEvent.REQUEST_TO_REMOVE_PRE_BATTLE_CHANNEL, ctx={'closeWindow': closeWindow}))