Exemplo n.º 1
0
    def _initialize(self, *args, **kwargs):
        super(CommonBalanceContent, self)._initialize()
        g_clientUpdateManager.addMoneyCallback(self.__onMoneyUpdated)
        g_clientUpdateManager.addCallback('stats.freeXP',
                                          self.__onFreeXpUpdated)
        self.__wallet.onWalletStatusChanged += self.__onWalletChanged
        self.__stats = self.__itemsCache.items.stats
        self.__isGoldAutoPurhaseEnabled = self.__wallet.isAvailable
        currencies = kwargs.get(
            'currencies', chain(Currency.GUI_ALL, (ValuePrice.FREE_XP, )))
        for currency in currencies:
            if currency == ValuePrice.FREE_XP:
                self._addCurrency(
                    ValuePrice.FREE_XP,
                    self.__getCurrencyFormat(ValuePrice.FREE_XP,
                                             self.__stats.actualFreeXP))
                self._onCurrencyUpdated(currency, self.__stats.actualFreeXP)
            self._addCurrency(
                currency,
                self.__getCurrencyFormat(
                    currency, self.__stats.actualMoney.get(currency)))
            self._onCurrencyUpdated(currency,
                                    self.__stats.actualMoney.get(currency))

        self.__updateMoneyStatus()
Exemplo n.º 2
0
 def _addListeners(self):
     super(NyGiftSystemGiftsOpenedView, self)._addListeners()
     self.viewModel.onOpenGifts += self.__onOpenGifts
     self.viewModel.onOpenOneGift += self.__onOpenOneGift
     self.__lobbyContext.getServerSettings(
     ).onServerSettingsChange += self.__onServerSettingChanged
     g_clientUpdateManager.addCallback('tokens.' + self.__lootBoxToken,
                                       self.__onTokensUpdate)
Exemplo n.º 3
0
 def __subscribe(self):
     g_clientUpdateManager.addCurrencyCallback(Currency.GOLD,
                                               self.__onSetGoldHandler)
     g_clientUpdateManager.addCurrencyCallback(Currency.CRYSTAL,
                                               self.__onSetCrystalHandler)
     g_clientUpdateManager.addCallback('goodies',
                                       self.__onSetGoodiesHandler)
     self.__itemsCache.onSyncCompleted += self.__shopResyncHandler
 def _populate(self):
     self._wotPlusInfo = BigWorld.player().renewableSubscription
     self._wotPlusInfo.onRenewableSubscriptionDataChanged += self._onWotPlusDataChanged
     self._wotPlusInfo.onPendingRentChanged += self._onWotPlusPendingRentChanged
     self._telecomRentals = BigWorld.player().telecomRentals
     self._telecomRentals.onPendingRentChanged += self._onTelecomPendingRentChanged
     g_clientUpdateManager.addCallback('tokens', self._onTelecomRentalsChanged)
     super(HangarCarouselDataProvider, self)._populate()
 def __init__(self, itemCD, installVehicle=None, key='confirmExchangeDialog/exchangeCredits', count=1):
     super(ExchangeCreditsSingleItemMeta, self).__init__(_SingleExchangeItem(itemCD, count=count), key=key)
     submitter = self._getSubmitter()
     item = self.itemsCache.items.getItemByCD(submitter.itemCD)
     self.__installVehicleCD = installVehicle
     self.__isInstalled = False
     if item and item.itemTypeID != GUI_ITEM_TYPE.VEHICLE and self.__installVehicleCD:
         vehicle = self.itemsCache.items.getItemByCD(self.__installVehicleCD)
         self.__isInstalled = item.isInstalled(vehicle)
     self.__inventoryCount = 0
     if item:
         self.__inventoryCount = item.inventoryCount
     g_clientUpdateManager.addCallback('inventory.1', self.__checkInventory)
 def __init__(self):
     super(_ExchangeCreditsSubscriber, self).__init__()
     g_clientUpdateManager.addMoneyCallback(self._onStatsChanged)
     g_clientUpdateManager.addCallback('shop.exchangeRate', self._onStatsChanged)
 def init(self):
     super(RankedEventHandler, self).init()
     g_clientUpdateManager.addCallback('tokens', self.__onTokensUpdate)
Exemplo n.º 8
0
 def init(self, nyCtrl, requester):
     super(_TankmanDiscountsStorage, self).init(nyCtrl, requester)
     self.__updateData()
     self._cny.onVariadicTankmenChanged += self.__onVariadicTankmanChanged
     self._cny.onTankmanChoicesChanged += self.__onTankmanChoicesChanged
     g_clientUpdateManager.addCallback('inventory.{}'.format(GUI_ITEM_TYPE.TANKMAN), self.__inventoryChanged)
Exemplo n.º 9
0
 def init(self, nyCtrl, requester):
     super(_VehicleDiscountsStorage, self).init(nyCtrl, requester)
     self.__discountsCache = self.__initLocalCache()
     self._cny.onVariadicDiscountsChanged += self.__onVariadicDiscountsChanged
     g_clientUpdateManager.addCallback('goodies', self.__onGoodiesUpdated)
 def onLobbyStarted(self, ctx):
     self._lobbyContext.getServerSettings(
     ).onServerSettingsChange += self._onServerSettingsChange
     g_clientUpdateManager.addCallback('tokens', self.__onTokensUpdate)
     self.processSwitchNotifications()
Exemplo n.º 11
0
 def init(self):
     super(UnifiedTradeInEventHandler, self).init()
     self.addListener(events.VehicleBuyEvent.VEHICLE_SELECTED,
                      self.__onTradeInDataChanged)
     g_clientUpdateManager.addCallback('tokens', self.__onTokensUpdate)
Exemplo n.º 12
0
 def init(self):
     super(TelecomTokenEventHandler, self).init()
     g_clientUpdateManager.addCallback('tokens', self.__onTokensUpdate)
     self._lobbyContext.getServerSettings(
     ).onServerSettingsChange += self.__onServerSettingChanged