Ejemplo 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()
Ejemplo n.º 2
0
 def _populate(self):
     LobbySelectableView._populate(self)
     self.__isSpaceReadyForC11n = self.hangarSpace.spaceInited
     self.__isVehicleReadyForC11n = self.hangarSpace.isModelLoaded
     self.__checkVehicleCameraState()
     g_currentVehicle.onChanged += self.__onCurrentVehicleChanged
     self.hangarSpace.onVehicleChangeStarted += self.__onVehicleLoading
     self.hangarSpace.onVehicleChanged += self.__onVehicleLoaded
     self.hangarSpace.onSpaceRefresh += self.__onSpaceRefresh
     self.hangarSpace.onSpaceCreate += self.__onSpaceCreate
     self.igrCtrl.onIgrTypeChanged += self.__onIgrTypeChanged
     self.itemsCache.onSyncCompleted += self.onCacheResync
     self.rankedController.onUpdated += self.onRankedUpdate
     self.rankedController.onPrimeTimeStatusUpdated += self.__onRankedPrimeStatusUpdate
     self.epicSkillsController.onUpdated += self.__onEpicSkillsUpdate
     self.epicSkillsController.onPrimeTimeStatusUpdated += self.__onEpicSkillsUpdate
     self.hangarSpace.setVehicleSelectable(True)
     g_prbCtrlEvents.onVehicleClientStateChanged += self.__onVehicleClientStateChanged
     self.lobbyContext.getServerSettings(
     ).onServerSettingsChange += self.__onServerSettingChanged
     self._settingsCore.onSettingsChanged += self.__onSettingsChanged
     g_clientUpdateManager.addMoneyCallback(self.onMoneyUpdate)
     g_clientUpdateManager.addCallbacks({})
     self.startGlobalListening()
     self.__updateAll()
     self.addListener(LobbySimpleEvent.WAITING_SHOWN, self.__onWaitingShown,
                      EVENT_BUS_SCOPE.LOBBY)
     self.addListener(events.FightButtonEvent.FIGHT_BUTTON_UPDATE,
                      self.__handleFightButtonUpdated,
                      scope=EVENT_BUS_SCOPE.LOBBY)
     self.addListener(CameraRelatedEvents.CAMERA_ENTITY_UPDATED,
                      self.__handleSelectedEntityUpdated)
     self._onPopulateEnd()
     self.statsCollector.noteHangarLoadingState(
         HANGAR_LOADING_STATE.HANGAR_UI_READY, showSummaryNow=True)
Ejemplo n.º 3
0
 def _populate(self):
     super(CamoSelectorMainView, self)._populate()
     self.soundManager.playInstantSound(SOUNDS.ENTER)
     self.__viewLifecycleWatcher.start(self.app.containerManager, [_C11nWindowsLifecycleHandler()])
     self._isDeferredRenderer = self.settingsCore.getSetting(GRAPHICS.RENDER_PIPELINE) == 0
     g_clientUpdateManager.addMoneyCallback(self.__setBuyingPanelData)
     self.lobbyContext.addHeaderNavigationConfirmator(self.__confirmHeaderNavigation)
     self.lobbyContext.getServerSettings().onServerSettingsChange += self.__onServerSettingChanged
     self.service.onCarouselFilter += self.__onCarouselFilter
     self.service.onRemoveItems += self.removeItems
     self.service.onOutfitChanged += self.__onOutfitChanged
     g_eventBus.addListener(CameraRelatedEvents.IDLE_CAMERA, self.__onNotifyHangarCameraIdleStateChanged)
     g_hangarSpace.onSpaceCreate += self.__onSpaceCreateHandler
     g_hangarSpace.onSpaceDestroy += self.__onSpaceDestroyHandler
     g_hangarSpace.onSpaceRefresh += self.__onSpaceRefreshHandler
     self.service.onRegionHighlighted += self.__onRegionHighlighted
     self.itemsCache.onSyncCompleted += self.__onCacheResync
     self.__carveUpOutfits()
     self._carouselDP = CustomizationCarouselDataProvider(g_currentVehicle, self._carouseItemWrapper, self)
     self._carouselDP.setFlashObject(self.as_getDataProviderS())
     self._carouselDP.setEnvironment(self.app)
     self.__setHeaderInitData()
     self.__setFooterInitData()
     self.__setBuyingPanelData()
     self.__setSeasonData()
     self._vehicleCustomizationAnchorsUpdater = _VehicleCustomizationAnchorsUpdater(self.service)
     self._vehicleCustomizationAnchorsUpdater.startUpdater(self.settingsCore.interfaceScale.get())
     self.refreshOutfit()
     self.settingsCore.interfaceScale.onScaleExactlyChanged += self.__onInterfaceScaleChanged
     self.settingsCore.onSettingsChanged += self.__onSettingsChanged
     self.__updateCameraParalaxFlag()
     self.service.startHighlighter(chooseMode(tabToItem(self._tabIndex), g_currentVehicle.item))
 def __addListeners(self):
     self.viewModel.onModuleBtnClicked += self.__onModuleBtnClicked
     self.viewModel.onRepairBtnClicked += self.__onRepairBtnClicked
     g_currentVehicle.onChanged += self.__onCurrentVehicleChanged
     g_clientUpdateManager.addMoneyCallback(self.__moneyUpdateCallback)
     self.__battleRoyaleController.onUpdated += self.__updateModel
     self.startGlobalListening()
 def _populate(self):
     self.__ctx = self.service.getCtx()
     self.__blur = CachedBlur()
     g_clientUpdateManager.addMoneyCallback(self.updateButton)
     g_currentVehicle.onChangeStarted += self.__onVehicleChangeStarted
     self.__ctx.events.onUpdateStyleInfoDOF += self.__onUpdateStyleInfoDOF
     self.service.onCustomizationHelperRecreated += self.__onCustomizationHelperRecreated
Ejemplo n.º 6
0
 def _populate(self):
     self._onPopulateStarted()
     LobbySubView._populate(self)
     g_currentVehicle.onChanged += self.__onCurrentVehicleChanged
     self.igrCtrl.onIgrTypeChanged += self.__onIgrTypeChanged
     self.falloutCtrl.onSettingsChanged += self.__onFalloutSettingsChanged
     self.itemsCache.onSyncCompleted += self.onCacheResync
     self.rankedController.onUpdated += self.onRankedUpdate
     self.rankedController.onPrimeTimeStatusUpdated += self.__onRankedPrimeStatusUpdate
     g_hangarSpace.onObjectSelected += self.__on3DObjectSelected
     g_hangarSpace.onObjectUnselected += self.__on3DObjectUnSelected
     g_hangarSpace.onObjectClicked += self.__on3DObjectClicked
     g_prbCtrlEvents.onVehicleClientStateChanged += self.__onVehicleClientStateChanged
     g_clientUpdateManager.addMoneyCallback(self.onMoneyUpdate)
     g_clientUpdateManager.addCallbacks({})
     self.startGlobalListening()
     self.__updateAll()
     self.addListener(LobbySimpleEvent.HIDE_HANGAR,
                      self._onCustomizationShow)
     self.addListener(LobbySimpleEvent.NOTIFY_CURSOR_OVER_3DSCENE,
                      self.__onNotifyCursorOver3dScene)
     self.addListener(LobbySimpleEvent.WAITING_SHOWN, self.__onWaitingShown,
                      EVENT_BUS_SCOPE.LOBBY)
     self.addListener(events.FightButtonEvent.FIGHT_BUTTON_UPDATE,
                      self.__handleFightButtonUpdated,
                      scope=EVENT_BUS_SCOPE.LOBBY)
     self._onPopulateEnd()
Ejemplo n.º 7
0
 def __init__(self,
              itemCD,
              installVehicle=None,
              key='confirmExchangeDialog/exchangeCredits'):
     """
     # Meta for ConfirmExchangeDialog
     # allows to exchange gold for credits by purchasing item
     :param itemCD: <int> item compact descriptor
     :param installVehicle: <int> installed vehicle compact descriptor
     :param key: <str> localization key
     """
     super(ExchangeCreditsMeta, self).__init__(itemCD, key)
     item = self.itemsCache.items.getItemByCD(self.getTypeCompDescr())
     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.addMoneyCallback(self._onStatsChanged)
     g_clientUpdateManager.addCallbacks({
         'shop.exchangeRate': self._onStatsChanged,
         'inventory.1': self.__checkInventory
     })
Ejemplo n.º 8
0
 def _populate(self):
     super(PurchaseWindow, self)._populate()
     if self.service.getHightlighter():
         self._needRestart = True
         self._highlighterMode = self.service.getSelectionMode()
         self.service.stopHighlighter()
     self.lobbyContext.getServerSettings(
     ).onServerSettingsChange += self.__onServerSettingChanged
     self._c11nView = self.app.containerManager.getContainer(
         ViewTypes.LOBBY_SUB).getView()
     self._purchaseItems = self._c11nView.getPurchaseItems()
     g_clientUpdateManager.addMoneyCallback(self.__setTotalData)
     self.__searchDP = PurchaseDataProvider(self._purchaseItems)
     self.__searchDP.setFlashObject(self.as_getPurchaseDPS())
     self.__searchDP.selectionChanged += self.__setTotalData
     self.as_setInitDataS({
         'btnCancelLabel':
         VEHICLE_CUSTOMIZATION.WINDOW_PURCHASE_BTNCANCEL,
         'buyDisabledTooltip':
         VEHICLE_CUSTOMIZATION.CUSTOMIZATION_BUYDISABLED_BODY,
         'windowTitle':
         VEHICLE_CUSTOMIZATION.WINDOW_PURCHASE_HEADER,
         'btnBuyLabel':
         VEHICLE_CUSTOMIZATION.WINDOW_PURCHASE_BTNBUY
     })
     self.__setTotalData()
Ejemplo n.º 9
0
 def _populate(self):
     self._onPopulateStarted()
     LobbySubView._populate(self)
     g_currentVehicle.onChanged += self.__onCurrentVehicleChanged
     self.igrCtrl.onIgrTypeChanged += self.__onIgrTypeChanged
     self.falloutCtrl.onSettingsChanged += self.__onFalloutSettingsChanged
     self.itemsCache.onSyncCompleted += self.onCacheResync
     self.rankedController.onUpdated += self.onRankedUpdate
     self.rankedController.onPrimeTimeStatusUpdated += self.__onRankedPrimeStatusUpdate
     g_hangarSpace.onObjectSelected += self.__on3DObjectSelected
     g_hangarSpace.onObjectUnselected += self.__on3DObjectUnSelected
     g_hangarSpace.onObjectClicked += self.__on3DObjectClicked
     g_hangarSpace.setVehicleSelectable(True)
     g_prbCtrlEvents.onVehicleClientStateChanged += self.__onVehicleClientStateChanged
     self.lobbyContext.getServerSettings().onServerSettingsChange += self.__onServerSettingChanged
     self._newYearController.onStateChanged += self.__onNYStateChanged
     self._newYearController.boxStorage.onCountChanged += self.__onBoxesCountChanged
     g_clientUpdateManager.addMoneyCallback(self.onMoneyUpdate)
     g_clientUpdateManager.addCallbacks({})
     self.startGlobalListening()
     self.as_initNYS(self._newYearController.isAvailable(), self._newYearController.isAvailable(), self._newYearController.boxStorage.count)
     self.__updateAll()
     self.addListener(LobbySimpleEvent.NOTIFY_CURSOR_OVER_3DSCENE, self.__onNotifyCursorOver3dScene)
     self.addListener(LobbySimpleEvent.WAITING_SHOWN, self.__onWaitingShown, EVENT_BUS_SCOPE.LOBBY)
     self.addListener(events.FightButtonEvent.FIGHT_BUTTON_UPDATE, self.__handleFightButtonUpdated, scope=EVENT_BUS_SCOPE.LOBBY)
     selectedHangarEntityId = BigWorld.player().selectedHangarEntityId
     if selectedHangarEntityId is not None:
         entity = BigWorld.entities.get(selectedHangarEntityId, None)
         if entity is not None:
             self.__on3DObjectSelected(entity)
     self._onPopulateEnd()
     return
Ejemplo n.º 10
0
 def _populate(self):
     super(CustomizationBottomPanel, self)._populate()
     self.__ctx = self.service.getCtx()
     self._carouselDP = CustomizationCarouselDataProvider(
         self._carouseItemWrapper)
     self._carouselDP.setFlashObject(self.getDp())
     self._carouselDP.setEnvironment(self.app)
     self.__ctx.events.onCarouselFiltered += self.__onCarouselFiltered
     self.__ctx.events.onCacheResync += self.__onCacheResync
     self.__ctx.events.onSeasonChanged += self.__onSeasonChanged
     self.__ctx.events.onItemInstalled += self.__onItemsInstalled
     self.__ctx.events.onTabChanged += self.__onTabChanged
     self.__ctx.events.onItemsRemoved += self.__onItemsRemoved
     self.__ctx.events.onModeChanged += self.__onModeChanged
     self.__ctx.events.onChangesCanceled += self.__onChangesCanceled
     self.__ctx.events.onComponentChanged += self.__onComponentChanged
     self.__ctx.events.onInstallNextCarouselItem += self.__onInstallNextCarouselItem
     self.__ctx.events.onItemSelected += self.__onItemSelected
     self.__ctx.events.onItemUnselected += self.__onItemUnselected
     self.__ctx.events.onSlotSelected += self.__onSlotSelected
     self.__ctx.events.onSlotUnselected += self.__onSlotUnselected
     self.__ctx.events.onFilterPopoverClosed += self.__onFilterPopoverClosed
     self.__ctx.events.onGetItemBackToHand += self.__onGetItemBackToHand
     g_currentVehicle.onChanged += self.__onVehicleChanged
     g_clientUpdateManager.addMoneyCallback(self.__setBottomPanelBillData)
     self.__setFooterInitData()
     self.__setBottomPanelBillData()
     self.__updatePopoverBtnIcon()
     self.__c11nSettings = AccountSettings.getSettings(
         CUSTOMIZATION_SECTION)
     self.__serverSettings = self.settingsCore.serverSettings
     self.__stageSwitcherVisibility = False
     BigWorld.callback(0.0,
                       lambda: self.__onTabChanged(self.__ctx.mode.tabId))
 def _initialize(self):
     super(TrophyDeviceUpgradeConfirmView, self)._initialize()
     self.__wallet.onWalletStatusChanged += self.__onWalletStatusChanged
     g_clientUpdateManager.addMoneyCallback(self.__onMoneyUpdated)
     self._setPreset(DialogPresets.TROPHY_DEVICE_UPGRADE)
     self.__setUpgradeCost()
     canUpgrade = self.__canPurchaseUpgrade()
     self._addButton(DialogButtons.SUBMIT, R.strings.battle_pass.trophyDeviceUpgradeConfim.submit(), isFocused=True, isEnabled=canUpgrade, tooltipBody=self.__getSubmitBtnTooltip(canUpgrade))
     self._addButton(DialogButtons.CANCEL, R.strings.battle_pass.trophyDeviceUpgradeConfim.cancel(), invalidateAll=True)
 def _populate(self):
     super(RetrainCrewWindow, self)._populate()
     g_clientUpdateManager.addMoneyCallback(self.__updateDataCallBack)
     self.as_setVehicleDataS({'nationID': self.__vehicle.nationID,
      'vType': self.__vehicle.type,
      'vIntCD': self.__vehicle.intCD,
      'vLevel': self.__vehicle.level,
      'vName': self.__vehicle.shortUserName,
      'vIconSmall': self.__vehicle.iconSmall})
     self.__updateDataCallBack()
Ejemplo n.º 13
0
 def _populate(self):
     super(Shop, self)._populate()
     g_clientUpdateManager.addMoneyCallback(self._onTableUpdate)
     g_clientUpdateManager.addCallbacks({
         'cache.mayConsumeWalletResources':
         self._onTableUpdate,
         'inventory.1':
         self._onTableUpdate
     })
     g_playerEvents.onCenterIsLongDisconnected += self._update
Ejemplo n.º 14
0
 def __addListeners(self):
     self.viewModel.onRentBtnClicked += self.__onRentBtnClicked
     self.viewModel.onRepairBtnClicked += self.__onRepairBtnClicked
     g_currentVehicle.onChanged += self.__onCurrentVehicleChanged
     g_clientUpdateManager.addMoneyCallback(self.__moneyUpdateCallback)
     self.__battleRoyaleController.onUpdated += self.__updateModel
     self.__rentVehiclesController.onUpdated += self.__updateRent
     self.__rentVehiclesController.onRentInfoUpdated += self.__updateRentState
     self.__rentVehiclesController.onPriceInfoUpdated += self.__updateRentPrice
     self.__subscribeRentTimeUpdate()
     self.startGlobalListening()
Ejemplo n.º 15
0
 def _populate(self):
     super(VehiclePreviewBuyingPanel, self)._populate()
     g_clientUpdateManager.addMoneyCallback(self.__updateBtnState)
     g_clientUpdateManager.addCallbacks({'stats.freeXP': self.__updateBtnState,
      'inventory': self.__updateBtnState})
     g_currentPreviewVehicle.onVehicleUnlocked += self.__updateBtnState
     g_currentPreviewVehicle.onChanged += self.__onVehicleChanged
     self.restores.onRestoreChangeNotify += self.__onRestoreChanged
     self.lobbyContext.getServerSettings().onServerSettingsChange += self.__onServerSettingsChanged
     if g_currentPreviewVehicle.isPresent():
         self.__updateBtnState()
     self.addListener(CameraRelatedEvents.VEHICLE_LOADING, self.__onVehicleLoading, EVENT_BUS_SCOPE.DEFAULT)
Ejemplo n.º 16
0
 def _populate(self):
     """
     Prepares and set init data into Flash. Subscribes to account updates.
     """
     super(Shop, self)._populate()
     g_clientUpdateManager.addMoneyCallback(self._onTableUpdate)
     g_clientUpdateManager.addCallbacks({
         'cache.mayConsumeWalletResources':
         self._onTableUpdate,
         'inventory.1':
         self._onTableUpdate
     })
     g_playerEvents.onCenterIsLongDisconnected += self._update
Ejemplo n.º 17
0
 def _populate(self):
     g_currentPreviewVehicle.selectVehicle(self.__vehicleCD, self.__vehicleStrCD)
     super(VehiclePreview, self)._populate()
     g_clientUpdateManager.addMoneyCallback(self._updateBtnState)
     g_clientUpdateManager.addCallbacks({'stats.freeXP': self._updateBtnState})
     g_currentPreviewVehicle.onComponentInstalled += self.__updateStatus
     g_currentPreviewVehicle.onVehicleUnlocked += self._updateBtnState
     g_currentPreviewVehicle.onVehicleInventoryChanged += self.__onInventoryChanged
     g_currentPreviewVehicle.onChanged += self.__onVehicleChanged
     self.comparisonBasket.onChange += self.__onCompareBasketChanged
     self.comparisonBasket.onSwitchChange += self.__updateHeaderData
     self.restores.onRestoreChangeNotify += self.__onRestoreChanged
     g_hangarSpace.onSpaceCreate += self.__onHangarCreateOrRefresh
     if g_currentPreviewVehicle.isPresent():
         self.__fullUpdate()
     else:
         event_dispatcher.showHangar()
Ejemplo n.º 18
0
 def __init__(self,
              key,
              titleCtx=None,
              messageCtx=None,
              meta=None,
              focusedID=None):
     super(DemountDeviceDialogMeta,
           self).__init__(key, titleCtx, messageCtx, meta, focusedID)
     self.onConfirmationStatusChnaged = Event.Event()
     self.__isOperationAllowed = False
     self.__checkIsOperationAllowed()
     g_clientUpdateManager.addMoneyCallback(self.__moneyChangeHandler)
     g_clientUpdateManager.addCallbacks({
         'shop.paidRemovalCost':
         self.__paidRemovalCostChangeHandler,
         'shop.paidDeluxeRemovalCost':
         self.__paidRemovalCostChangeHandler
     })
 def _populate(self):
     super(VehiclePreviewBuyingPanel, self)._populate()
     g_clientUpdateManager.addMoneyCallback(self.__updateBtnState)
     g_clientUpdateManager.addCallbacks({
         'stats.freeXP':
         self.__updateBtnState,
         'inventory':
         self.__updateBtnState,
         'serverSettings.blueprints_config':
         self.__onBlueprintsModeChanged
     })
     g_currentPreviewVehicle.onVehicleUnlocked += self.__updateBtnState
     g_currentPreviewVehicle.onChanged += self.__onVehicleChanged
     self._heroTanks.onUpdated += self.__updateBtnState
     self._restores.onRestoreChangeNotify += self.__onRestoreChanged
     self._lobbyContext.getServerSettings(
     ).onServerSettingsChange += self.__onServerSettingsChanged
     self.addListener(CameraRelatedEvents.VEHICLE_LOADING,
                      self.__onVehicleLoading)
Ejemplo n.º 20
0
 def __init__(self,
              itemCD,
              installVehicle=None,
              key='confirmExchangeDialog/exchangeCredits'):
     super(ExchangeCreditsMeta, self).__init__(itemCD, key)
     item = self.itemsCache.items.getItemByCD(self.getTypeCompDescr())
     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.addMoneyCallback(self._onStatsChanged)
     g_clientUpdateManager.addCallbacks({
         'shop.exchangeRate': self._onStatsChanged,
         'inventory.1': self.__checkInventory
     })
Ejemplo n.º 21
0
 def _populate(self):
     super(MainView, self)._populate()
     self.__controller = g_customizationController
     self.__controller.init()
     self.__controller.events.onCartUpdated += self.__setBottomPanelData
     self.__controller.events.onMultiplePurchaseProcessed += self.__onPurchaseProcessed
     self.__controller.events.onCarouselUpdated += self.__setCarouselData
     self.__controller.events.onSlotUpdated += self.__onSlotUpdated
     self.__controller.events.onCartEmptied += self.as_hideBuyingPanelS
     self.__controller.events.onCartFilled += self.as_showBuyingPanelS
     self.__controller.events.onBonusesUpdated += self.__setBonusData
     self.__controller.start()
     self.as_setSlotsPanelDataS(_getSlotsPanelDataVO(self.__controller.slots.currentSlotsData))
     g_clientUpdateManager.addMoneyCallback(self.__setBottomPanelData)
     g_currentVehicle.onChanged += self.__setHeaderInitData
     self.__setHeaderInitData()
     self.__setFooterInitData()
     self.__setCarouselInitData()
     self.__setBottomPanelData()
     self.fireEvent(LobbySimpleEvent(LobbySimpleEvent.HIDE_HANGAR, True))
     self.lobbyContext.addHeaderNavigationConfirmator(self.__confirmHeaderNavigation)
 def _populate(self):
     super(CustomizationBottomPanel, self)._populate()
     self.__ctx = self.service.getCtx()
     self._carouselDP = CustomizationCarouselDataProvider(g_currentVehicle, self._carouseItemWrapper, self.__ctx)
     self._carouselDP.setFlashObject(self.getDp())
     self._carouselDP.setEnvironment(self.app)
     self.__needCaruselFullRebuild = False
     self.__ctx.onCarouselFilter += self.__onCarouselFilter
     self.__ctx.onCacheResync += self.__onCacheResync
     self.__ctx.onCustomizationSeasonChanged += self.__onSeasonChanged
     self.__ctx.onCustomizationItemInstalled += self.__onItemsInstalled
     self.__ctx.onCustomizationTabChanged += self.__onTabChanged
     self.__ctx.onCustomizationItemsRemoved += self.__onItemsRemoved
     self.__ctx.onCustomizationModeChanged += self.__onModeChanged
     self.__ctx.onChangesCanceled += self.__onChangesCanceled
     self.__ctx.onCustomizationItemSold += self.__onItemSold
     g_clientUpdateManager.addMoneyCallback(self.__setBottomPanelBillData)
     self.__updateTabs(self.__ctx.currentTab)
     self.__setFooterInitData()
     self.__setBottomPanelBillData()
     self.as_showSeasonBtnIconS(RES_ICONS.MAPS_ICONS_CUSTOMIZATION_ITEMS_POPOVER_SUMMER_LIST30X16)
Ejemplo n.º 23
0
 def __addListeners(self):
     self.addListener(ShopEvent.CONFIRM_TRADE_IN, self.__onTradeInConfirmed,
                      EVENT_BUS_SCOPE.LOBBY)
     self.addListener(ShopEvent.SELECT_RENT_TERM, self.__onRentTermSelected,
                      EVENT_BUS_SCOPE.LOBBY)
     self.addListener(VehicleBuyEvent.VEHICLE_SELECTED,
                      self.__setTradeOffVehicle)
     g_clientUpdateManager.addMoneyCallback(self.__updateIsEnoughStatus)
     self.wallet.onWalletStatusChanged += self.__onWalletStatusChanged
     self.viewModel.onCloseBtnClick += self.__onWindowClose
     self.viewModel.onShowInHangarClick += self.__onShowInHangar
     self.viewModel.onCheckboxWithoutCrewChanged += self.__onCheckboxWithoutCrewChanged
     self.viewModel.onBuyBtnClick += self.__onBuyBtnClick
     self.viewModel.onCommanderLvlChange += self.__onCommanderLvlChange
     self.viewModel.onToggleRentAndTradeIn += self.__onToggleRentAndTradeIn
     equipmentBlock = self.viewModel.equipmentBlock
     equipmentBlock.onCancelTradeOffVehicle += self.__onCancelTradeOffVehicle
     equipmentBlock.slot.onSelectedChange += self.__onSelectedChange
     equipmentBlock.ammo.onSelectedChange += self.__onSelectedChange
     self.restore.onRestoreChangeNotify += self.__onRestoreChange
     self.itemsCache.onSyncCompleted += self.__onItemCacheSyncCompleted
Ejemplo n.º 24
0
 def _populate(self):
     super(PurchaseWindow, self)._populate()
     self.__controller = g_customizationController
     self.__controller.events.onMultiplePurchaseProcessed += self.destroy
     g_clientUpdateManager.addMoneyCallback(self.__setTotalData)
     self.__searchDP = PurchaseDataProvider(self.__controller.cart)
     self.__searchDP.setFlashObject(self.as_getPurchaseDPS())
     self.__searchDP.selectionChanged += self.__setTotalData
     self.as_setInitDataS({
         'windowTitle':
         VEHICLE_CUSTOMIZATION.WINDOW_PURCHASE_HEADER,
         'imgGold':
         RES_ICONS.MAPS_ICONS_LIBRARY_GOLDICON_1,
         'imgCredits':
         RES_ICONS.MAPS_ICONS_LIBRARY_CREDITSICON_1,
         'btnBuyLabel':
         VEHICLE_CUSTOMIZATION.WINDOW_PURCHASE_BTNBUY,
         'btnCancelLabel':
         VEHICLE_CUSTOMIZATION.WINDOW_PURCHASE_BTNCANCEL,
         'buyDisabledTooltip':
         VEHICLE_CUSTOMIZATION.CUSTOMIZATION_BUYDISABLED_BODY,
         'defaultSortIndex':
         0,
         'tableHeader': [
             _getColumnHeaderVO(
                 'itemName',
                 text_styles.main(VEHICLE_CUSTOMIZATION.
                                  WINDOW_PURCHASE_TABLEHEADER_ITEMS), 250),
             _getColumnHeaderVO(
                 'lblBonus',
                 text_styles.main(VEHICLE_CUSTOMIZATION.
                                  WINDOW_PURCHASE_TABLEHEADER_BONUS), 110),
             _getColumnHeaderVO(
                 'lblPrice',
                 text_styles.main(VEHICLE_CUSTOMIZATION.
                                  WINDOW_PURCHASE_TABLEHEADER_COST), 150)
         ]
     })
     self.__setTotalData()
 def _populate(self):
     g_currentPreviewVehicle.selectVehicle(self._vehicleCD,
                                           self.__vehicleStrCD)
     LobbySelectableView._populate(self)
     g_clientUpdateManager.addMoneyCallback(self._updateBtnState)
     g_clientUpdateManager.addCallbacks(
         {'stats.freeXP': self._updateBtnState})
     g_currentPreviewVehicle.onComponentInstalled += self.__updateStatus
     g_currentPreviewVehicle.onVehicleUnlocked += self._updateBtnState
     g_currentPreviewVehicle.onVehicleInventoryChanged += self.__onInventoryChanged
     g_currentPreviewVehicle.onChanged += self.__onVehicleChanged
     self.comparisonBasket.onChange += self.__onCompareBasketChanged
     self.comparisonBasket.onSwitchChange += self.__updateHeaderData
     self.restores.onRestoreChangeNotify += self.__onRestoreChanged
     self.hangarSpace.onSpaceCreate += self.__onHangarCreateOrRefresh
     self.hangarSpace.setVehicleSelectable(True)
     if g_currentPreviewVehicle.isPresent():
         self.__fullUpdate()
     else:
         event_dispatcher.showHangar()
     self.addListener(CameraRelatedEvents.CAMERA_ENTITY_UPDATED,
                      self.handleSelectedEntityUpdated)
    def _populate(self):
        super(PurchaseWindow, self)._populate()
        self.service.suspendHighlighter()
        self.lobbyContext.getServerSettings(
        ).onServerSettingsChange += self.__onServerSettingChanged
        self.__c11nView = self.app.containerManager.getContainer(
            ViewTypes.LOBBY_SUB).getView()
        self.__ctx = self.service.getCtx()
        purchaseItems = self.__ctx.getPurchaseItems()
        g_clientUpdateManager.addMoneyCallback(self.__setTotalData)
        self.__isStyle, self.__purchaseItems, processor = _ProcessorSelector.selectFor(
            purchaseItems)
        processor.process(self.__purchaseItems)
        itemDescriptors = processor.itemsDescriptors
        if not self.__isStyle:
            for season in SeasonType.COMMON_SEASONS:
                for item in itemDescriptors[season]:
                    self.__items[item.identificator] = _SelectItemData(
                        season, item.quantity, item.purchaseIndices)
                    self.__counters[season][int(
                        item.isFromInventory)] += item.quantity

        self.as_setDataS({
            'summerData':
            [item.getVO() for item in itemDescriptors[SeasonType.SUMMER]],
            'winterData':
            [item.getVO() for item in itemDescriptors[SeasonType.WINTER]],
            'desertData':
            [item.getVO() for item in itemDescriptors[SeasonType.DESERT]]
        })
        self.__setTitlesData()
        self.__setTotalData()
        self.__blur.enable = True
        self.fireEvent(
            LobbyHeaderMenuEvent(LobbyHeaderMenuEvent.MENY_HIDE,
                                 ctx={'hide': True}), EVENT_BUS_SCOPE.LOBBY)
 def __init__(self):
     super(_ExchangeCreditsSubscriber, self).__init__()
     g_clientUpdateManager.addMoneyCallback(self._onStatsChanged)
     g_clientUpdateManager.addCallback('shop.exchangeRate', self._onStatsChanged)
Ejemplo n.º 28
0
 def init(self):
     super(ExchangeMoneyInfo, self).init()
     g_clientUpdateManager.addMoneyCallback(self._onUpdate)
     self.__walletController.onWalletStatusChanged += self._onUpdate
 def initialize(self):
     super(MoneyOption, self).initialize()
     g_clientUpdateManager.addMoneyCallback(self._moneyChangeHandler)
     self._moneyChangeHandler()
     self._updateMoney()
     self._updateIcon()
Ejemplo n.º 30
0
 def initialize(self):
     super(CheckMoneyButton, self).initialize()
     g_clientUpdateManager.addMoneyCallback(self._moneyChangeHandler)
     self._updateButton()