def canShow(self): popupsWindowsDisabled = isPopupsWindowsOpenDisabled() prbDispatcher = self.prbDispatcher if prbDispatcher is None: return self.__isLobbyLoaded and not popupsWindowsDisabled else: return self.__isLobbyLoaded and not popupsWindowsDisabled and not (prbDispatcher.getFunctionalState().hasLockedState or prbDispatcher.getPlayerInfo().isReady)
def _showAwardsFor(self, quests): if isPopupsWindowsOpenDisabled(): return if quests: quests.sort(key=lambda q: (getLinkedSetMissionIDFromQuest(q), getLinkedSetQuestID(q))) messages = [] for quest in quests: winMessage = self._getQuestWinMessage(quest) if self.isFinalQuest(quest): messages.append(self._getLinkedSetWinMessage()) self._appendMessageWithViewCallback( messages, winMessage, quest, True) hasHint = hasLocalizedQuestHintNameForLinkedSetQuest(quest) self._appendMessageWithViewCallback(messages, winMessage, quest, not hasHint) if hasHint: self._appendMessageWithViewCallback( messages, self._getQuestHintMessage(quest), quest, True) g_eventBus.handleEvent(events.LoadViewEvent( SFViewLoadParams(VIEW_ALIAS.LINKEDSET_HINTS), ctx={'messages': messages}), scope=EVENT_BUS_SCOPE.LOBBY)
def _onVehicleBecomeElite(self, vehTypeCompDescr): if not isPopupsWindowsOpenDisabled(): self.fireEvent( events.LoadViewEvent( VIEW_ALIAS.ELITE_WINDOW, getViewName(VIEW_ALIAS.ELITE_WINDOW, vehTypeCompDescr), {'vehTypeCompDescr': vehTypeCompDescr}), EVENT_BUS_SCOPE.LOBBY)
def canShow(self): popupsWindowsDisabled = isPopupsWindowsOpenDisabled( ) or self.bootcampController.isInBootcamp() prbDispatcher = self.prbDispatcher if prbDispatcher is None: return self.__isLobbyLoaded and not popupsWindowsDisabled else: return self.__isLobbyLoaded and not popupsWindowsDisabled and not prbDispatcher.getFunctionalState( ).hasLockedState
def showAwardWindow(award, isUniqueName=True): if isPopupsWindowsOpenDisabled(): LOG_WARNING('Award popup disabled', award, isUniqueName) return if isUniqueName: name = getUniqueViewName(VIEW_ALIAS.AWARD_WINDOW) else: name = VIEW_ALIAS.AWARD_WINDOW g_eventBus.handleEvent(events.LoadViewEvent(VIEW_ALIAS.AWARD_WINDOW, name=name, ctx={'award': award}), EVENT_BUS_SCOPE.LOBBY)
def process(self, descriptor, ctx): if ctx.cache.isFinished() and not ctx.restart: return False popupsWindowsDisabled = isPopupsWindowsOpenDisabled() if not ctx.byRequest and popupsWindowsDisabled: ctx.cache.setStartOnNextLogin(False) ctx.cache.setRefused(True).write() return False self.__validateFinishReason(ctx) return self.__validateTutorialState(ctx) if self.__validateTutorialsCompleted(ctx, descriptor) else self.__validateBattleCount(descriptor, ctx)
def onLobbyInited(self, event): if not isPlayerAccount(): return self.__isLobbyInited = True self._updatePromo(self._getPromoEventNotifications()) self.eventsNotification.onEventNotificationsChanged += self.__onEventNotification self.browserCtrl.onBrowserDeleted += self.__onBrowserDeleted popupsWindowsDisabled = isPopupsWindowsOpenDisabled() if not popupsWindowsDisabled: self._processPromo(self.eventsNotification.getEventsNotifications())
def triggerEffect(self): window = self.getTarget() if window is not None: if isPopupsWindowsOpenDisabled(): LOG_DEBUG("Awards windows are disabled by setting 'popupsWindowsDisabled' in preferences.xml") else: content = window.getContent() if not window.isContentFull(): query = self._ctrlFactory.createContentQuery(window.getType()) query.invoke(content, window.getVarRef()) self._gui.showAwardWindow(window.getID(), window.getType(), content) return True LOG_ERROR('PopUp not found', self._effect.getTargetID()) return False
def onLobbyInited(self, event): if not isPlayerAccount(): return g_eventBus.addListener(BrowserEvent.BROWSER_CREATED, self.__handleBrowserCreated) self.__isLobbyInited = True if self.__needToGetTeasersInfo(): self.__updateWebBrgData() elif self.__hasPendingTeaser: self.__tryToShowTeaser() self.__notificationsCtrl.onEventNotificationsChanged += self.__onEventNotification if not isPopupsWindowsOpenDisabled(): self.__processPromo( self.__notificationsCtrl.getEventsNotifications()) self.app.loaderManager.onViewLoaded += self.__onViewLoaded
def onLobbyInited(self, event): if not isPlayerAccount(): return g_eventBus.addListener(BrowserEvent.BROWSER_CREATED, self.__handleBrowserCreated) self.__isLobbyInited = True if self.__hasPendingTeaser: self.__tryToShowTeaser() elif self.__battlesFromLastTeaser % self._CHECK_FREQUENCY_IN_BATTLES == 0: self.__updateWebBrgData() self.eventsNotification.onEventNotificationsChanged += self.__onEventNotification if not isPopupsWindowsOpenDisabled(): self.__processPromo( self.eventsNotification.getEventsNotifications()) self.app.loaderManager.onViewLoaded += self.__onViewLoaded