예제 #1
0
    def handleNextButton(self):
        bonuses = self._quest.getBonuses('tokens')
        hasCommander = False
        offerID = None
        for bonus in bonuses:
            for tID in bonus.getTokens():
                if getRecruitInfo(tID) is not None:
                    hasCommander = True
                    break
                if tID.startswith(OFFER_TOKEN_PREFIX):
                    for offer in self._offersProvider.getAvailableOffers(
                            onlyVisible=True):
                        if offer.token == tID:
                            offerID = offer.id

        if hasCommander:
            g_eventBus.handleEvent(events.LoadViewEvent(
                SFViewLoadParams(VIEW_ALIAS.LOBBY_BARRACKS),
                ctx={
                    'location':
                    BARRACKS_CONSTANTS.LOCATION_FILTER_NOT_RECRUITED
                }),
                                   scope=EVENT_BUS_SCOPE.LOBBY)
        elif offerID is not None:
            showOfferGiftsWindow(offerID)
        return
예제 #2
0
def showOfferGiftsWindowByToken(token, overrideSuccessCallback=None):
    offersProvider = dependency.instance(IOffersDataProvider)
    offer = first(offersProvider.getAvailableOffersByToken(token))
    if offer is None:
        _logger.warning('Offer with token="%s" is not available.', token)
        return
    else:
        showOfferGiftsWindow(offer.id, overrideSuccessCallback=overrideSuccessCallback)
        return
예제 #3
0
 def openOfferWindow(self, offerID):
     offer = self._offersProvider.getOffer(offerID)
     if offer is not None and offer.token == BATTLE_PASS_TOKEN_TROPHY_OFFER_2020:
         showOfferTrophyDevices()
         return
     elif offer is not None and offer.token == BATTLE_PASS_TOKEN_NEW_DEVICE_OFFER_2020:
         showOfferNewDevices()
         return
     else:
         showOfferGiftsWindow(offerID)
         return
예제 #4
0
 def __handleMakeChoice(self):
     if self.__offer:
         event_dispatcher.showOfferGiftsWindow(self.__offer)
     else:
         event_dispatcher.showStorage(STORAGE_CONSTANTS.OFFERS)
예제 #5
0
 def _processBackClick(self, ctx=None):
     event_dispatcher.showOfferGiftsWindow(self._offer.id)
 def openOfferWindow(self, offerID):
     showOfferGiftsWindow(offerID)
 def _onSelect(self):
     if isPlayerAccount():
         BigWorld.player().setOfferBannerSeen(self._offerID)
     showOfferGiftsWindow(self._offerID)
     self.destroyWindow()
 def _onClose(self):
     self.destroyWindow()
     if self._offer.isOfferAvailable and self._gift.isVehicle and self._serverSettings.isOffersEnabled(
     ):
         showOfferGiftsWindow(self._offer.id)