def __getExchangeRateBonusIco(self, useBigIco=False): credit = getEconomicalStatsDict().get('exchangeRate') if useBigIco: goldIcon = formatGoldPriceBig(1) creditsIcon = formatCreditPriceBig(credit) else: goldIcon = formatGoldPrice(1) creditsIcon = formatCreditPrice(credit) return i18n.makeString(QUESTS.ACTION_EXCHANGERATE_GOLD2CREDIT, gold=goldIcon, credits=creditsIcon)
def _formatRentPriceIcon(cls, item, useBigIco, forNormalCard=False): if hasattr(item, 'minRentPrice'): rentPrice = item.minRentPrice.toDict() if rentPrice[Currency.GOLD]: if forNormalCard: return formatGoldPriceNormalCard(rentPrice[Currency.GOLD]) if useBigIco: return formatGoldPriceBig(rentPrice[Currency.GOLD]) return formatGoldPrice(rentPrice[Currency.GOLD]) if rentPrice[Currency.CREDITS]: if forNormalCard: return formatCreditPriceNormalCard(rentPrice[Currency.CREDITS]) if useBigIco: return formatCreditPriceBig(rentPrice[Currency.CREDITS]) return formatCreditPrice(rentPrice[Currency.CREDITS])
def _formatPriceIcon(cls, item, useBigIco, forNormalCard=False): if hasattr(item, 'buyPrices'): sellGold = item.buyPrices.itemPrice.price.gold sellCredits = item.buyPrices.itemPrice.price.credits if sellGold: if forNormalCard: return formatGoldPriceNormalCard(sellGold) if useBigIco: return formatGoldPriceBig(sellGold) return formatGoldPrice(sellGold) if sellCredits: if forNormalCard: return formatCreditPriceNormalCard(sellCredits) if useBigIco: return formatCreditPriceBig(sellCredits) return formatCreditPrice(sellCredits)
def _getAdditionalDescriptionData(self, useBigIco=False): paramName = self.discount.getParamName() if paramName.endswith(_MULTIPLIER): paramName = paramName[:-len(_MULTIPLIER)] if 'winXPFactorMode' in paramName: discountValue = getEconomicalStatsDict().get('dailyXPFactor', None) elif 'exchangeRate' in paramName: discountValue = self.__getExchangeRateBonusIco() else: discountValue = getEconomicalStatsDict().get(paramName, None) if paramName in _gold_bonus_list: if useBigIco: discountValue = formatGoldPriceBig(discountValue) else: discountValue = formatGoldPrice(discountValue) if not discountValue: discount = self._getMaxDiscount() discountValue = formatPercentValue(discount.discountValue) if discount else None return discountValue
def _formatRentPriceIcon(cls, item, useBigIco): """Convert price to text with currency icon :param item: vehicle, camuflage, etc... :param useBigIco: show small or big icon format :return: formatted price """ if hasattr(item, 'minRentPrice'): rentPrice = item.minRentPrice.toDict() if rentPrice[Currency.GOLD]: if useBigIco: return formatGoldPriceBig(rentPrice[Currency.GOLD]) else: return formatGoldPrice(rentPrice[Currency.GOLD]) if rentPrice[Currency.CREDITS]: if useBigIco: return formatCreditPriceBig(rentPrice[Currency.CREDITS]) else: return formatCreditPrice(rentPrice[Currency.CREDITS]) return ''
def _formatPriceIcon(cls, item, useBigIco): """Convert price to text with currency icon :param item: vehicle, camuflage, etc... :param useBigIco: show small or big icon format :return: formatted price """ if hasattr(item, 'buyPrices'): sellGold = item.buyPrices.itemPrice.price.gold sellCredits = item.buyPrices.itemPrice.price.credits if sellGold: if useBigIco: return formatGoldPriceBig(sellGold) else: return formatGoldPrice(sellGold) if sellCredits: if useBigIco: return formatCreditPriceBig(sellCredits) else: return formatCreditPrice(sellCredits) return ''