def __setBottomContent(self): bottomContent = self.bottomContentViewModel year, collectionName = new_year.getCollectionByIntID( self.__collectionID) price = getCollectionCost(year, collectionName) bottomContent.setValue(str(price)) self.__updateIsEnough(price)
def __updateState(self, model): collectionIntID = self.__getCollectionIntID() self.__updateCollections(model) self.__updateAdditionalData(model, collectionIntID) model.setCurrentCollectionName(self.__collectionName) model.setYear(self.__yearName) cost = getCollectionCost(self.__yearName, self.__collectionName) model.setCost(cost or 0) if self.__yearName == YEARS_INFO.CURRENT_YEAR_STR: model.setCollectionState(CollectionState.CURRENTYEAR) elif self.__itemsCache.items.festivity.getMaxLevel( ) != MAX_ATMOSPHERE_LVL and cost == 0: model.setCollectionState(CollectionState.RECEIVEDEARLIER) elif self.__itemsCache.items.festivity.getMaxLevel( ) != MAX_ATMOSPHERE_LVL: model.setCollectionState(CollectionState.MAXLVLNOTREACHED) elif cost == 0: model.setCollectionState(CollectionState.RECEIVED) elif cost > self.__itemsCache.items.festivity.getShardsCount(): model.setCollectionState(CollectionState.LACKSHARDS) else: model.setCollectionState(CollectionState.READYTOGET) self.__nyController.markPreviousYearTabVisited( self.__yearName, NY_OLD_REWARDS_BY_YEAR_VISITED)
def _setPrice(self, template, price=None): year, collectionName = getCollectionByIntID(self.__collectionID) super(AlbumCollectionDialogBuilder, self)._setPrice(template, getCollectionCost(year, collectionName))
def __onUpdated(self, keys): if SyncDataKeys.TOY_FRAGMENTS in keys: year, collectionName = new_year.getCollectionByIntID( self.__collectionID) self.__updateIsEnough(getCollectionCost(year, collectionName)) self.__setBalanceContent()
def __updateShards(self): self.viewModel.setFullCollectionCost( getCollectionCost(self._collectionBuilder.YEAR_NAME, self._collectionType)) self.viewModel.setTotalShardsPrice( self._itemsCache.items.festivity.getShardsCount())