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 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(): 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 __closeWindows(self): container = self.app.containerManager.getContainer(VIEW_TYPE.WINDOW) if container is not None: for viewAlias in [VIEW_ALIAS.TRAINING_SETTINGS_WINDOW, g_entitiesFactories.getAliasByEvent(events.ShowWindowEvent.SHOW_SEND_INVITES_WINDOW)]: window = container.getView(criteria={POP_UP_CRITERIA.VIEW_ALIAS: viewAlias}) if window is not None: window.destroy() return
def showLobbyView(self, event): alias = g_entitiesFactories.getAliasByEvent(event.eventType) if alias is not None: if event.ctx is not None and len(event.ctx): self.app.loadView(alias, ctx=event.ctx) else: self.app.loadView(alias) else: LOG_ERROR("Passes event '{0}' is not listed in event to alias dict".format(event))
def showLobbyView(self, event): alias = g_entitiesFactories.getAliasByEvent(event.eventType) if alias is not None: if event.ctx is not None and len(event.ctx): self.app.loadView(alias, alias, event.ctx) else: self.app.loadView(alias) else: LOG_ERROR( "Passes event '{0}' is not listed in event to alias dict". format(event))
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 __manageWindow(self, eventType): manager = self.app.containerManager window = manager.getView(ViewTypes.WINDOW, {POP_UP_CRITERIA.VIEW_ALIAS: g_entitiesFactories.getAliasByEvent(eventType)}) result = window is not None if result: name = window.uniqueName isOnTop = manager.as_isOnTopS(ViewTypes.WINDOW, name) if not isOnTop: manager.as_bringToFrontS(ViewTypes.WINDOW, name) else: window.onWindowClose() return result
def __manageWindow(self, eventType): manager = self.app.containerManager window = manager.getView(ViewTypes.WINDOW, {POP_UP_CRITERIA.VIEW_ALIAS: g_entitiesFactories.getAliasByEvent(eventType)}) result = window is not None if result: name = window.uniqueName isOnTop = manager.as_isOnTopS(ViewTypes.WINDOW, name) if not isOnTop: manager.as_bringToFrontS(ViewTypes.WINDOW, name) else: window.onWindowClose() return result
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 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(): 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 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 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 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 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 __getWindow(self): return self.app.containerManager.getView(VIEW_TYPE.WINDOW, criteria={POP_UP_CRITERIA.VIEW_ALIAS: g_entitiesFactories.getAliasByEvent(events.ShowWindowEvent.SHOW_NOTIFICATION_INVITES_WINDOW)})