def __setBuyingPanelData(self): totalGold = g_customizationController.carousel.slots.cart.totalPriceGold totalCredits = g_customizationController.carousel.slots.cart.totalPriceCredits notEnoughGoldTooltip = notEnoughCreditsTooltip = '' enoughGold = g_itemsCache.items.stats.gold >= totalGold enoughCredits = g_itemsCache.items.stats.credits >= totalCredits if not enoughGold: diff = text_styles.gold(totalGold - g_itemsCache.items.stats.gold) notEnoughGoldTooltip = makeTooltip(_ms(TOOLTIPS.CUSTOMIZATION_NOTENOUGHRESOURCES_HEADER), _ms(TOOLTIPS.CUSTOMIZATION_NOTENOUGHRESOURCES_BODY, count='{0}{1}'.format(diff, icons.gold()))) if not enoughCredits: diff = text_styles.credits(totalCredits - g_itemsCache.items.stats.credits) notEnoughCreditsTooltip = makeTooltip(_ms(TOOLTIPS.CUSTOMIZATION_NOTENOUGHRESOURCES_HEADER), _ms(TOOLTIPS.CUSTOMIZATION_NOTENOUGHRESOURCES_BODY, count='{0}{1}'.format(diff, icons.credits()))) self.as_setBuyingPanelDataS({'totalPriceCredits': formatPriceCredits(totalCredits), 'totalPriceGold': formatPriceGold(totalGold), 'enoughGold': enoughGold, 'enoughCredits': enoughCredits, 'notEnoughGoldTooltip': notEnoughGoldTooltip, 'notEnoughCreditsTooltip': notEnoughCreditsTooltip})
def __setTotalData(self): notEnoughGoldTooltip = notEnoughCreditsTooltip = '' enoughGold = g_itemsCache.items.stats.gold >= self.__totalPrice['gold'] enoughCredits = g_itemsCache.items.stats.credits >= self.__totalPrice['credits'] buyEnabled = bool(self.__totalPrice['credits'] + self.__totalPrice['gold']) and enoughGold and enoughCredits if not enoughGold: diff = text_styles.gold(self.__totalPrice['gold'] - g_itemsCache.items.stats.gold) notEnoughGoldTooltip = makeTooltip(_ms(TOOLTIPS.CUSTOMIZATION_NOTENOUGHRESOURCES_HEADER), _ms(TOOLTIPS.CUSTOMIZATION_NOTENOUGHRESOURCES_BODY, count='{0}{1}'.format(diff, icons.gold()))) if not enoughCredits: diff = text_styles.credits(self.__totalPrice['credits'] - g_itemsCache.items.stats.credits) notEnoughCreditsTooltip = makeTooltip(_ms(TOOLTIPS.CUSTOMIZATION_NOTENOUGHRESOURCES_HEADER), _ms(TOOLTIPS.CUSTOMIZATION_NOTENOUGHRESOURCES_BODY, count='{0}{1}'.format(diff, icons.credits()))) self.as_setTotalDataS({'credits': formatPriceCredits(self.__totalPrice['credits']), 'gold': formatPriceGold(self.__totalPrice['gold']), 'totalLabel': text_styles.highTitle(_ms(CUSTOMIZATION.WINDOW_PURCHASE_TOTALCOST, selected=len(self.__searchDP.getSelected()), total=len(self.__searchDP.getTotal()))), 'buyEnabled': buyEnabled, 'enoughGold': enoughGold, 'enoughCredits': enoughCredits, 'notEnoughGoldTooltip': notEnoughGoldTooltip, 'notEnoughCreditsTooltip': notEnoughCreditsTooltip})
def __setTotalData(self): notEnoughGoldTooltip = notEnoughCreditsTooltip = '' enoughGold = g_itemsCache.items.stats.gold >= self.__totalPrice['gold'] enoughCredits = g_itemsCache.items.stats.credits >= self.__totalPrice[ 'credits'] buyEnabled = bool( self.__totalPrice['credits'] + self.__totalPrice['gold']) and enoughGold and enoughCredits if not enoughGold: diff = text_styles.gold(self.__totalPrice['gold'] - g_itemsCache.items.stats.gold) notEnoughGoldTooltip = makeTooltip( _ms(TOOLTIPS.CUSTOMIZATION_NOTENOUGHRESOURCES_HEADER), _ms(TOOLTIPS.CUSTOMIZATION_NOTENOUGHRESOURCES_BODY, count='{0}{1}'.format(diff, icons.gold()))) if not enoughCredits: diff = text_styles.credits(self.__totalPrice['credits'] - g_itemsCache.items.stats.credits) notEnoughCreditsTooltip = makeTooltip( _ms(TOOLTIPS.CUSTOMIZATION_NOTENOUGHRESOURCES_HEADER), _ms(TOOLTIPS.CUSTOMIZATION_NOTENOUGHRESOURCES_BODY, count='{0}{1}'.format(diff, icons.credits()))) self.as_setTotalDataS({ 'credits': formatPriceCredits(self.__totalPrice['credits']), 'gold': formatPriceGold(self.__totalPrice['gold']), 'totalLabel': text_styles.highTitle( _ms(CUSTOMIZATION.WINDOW_PURCHASE_TOTALCOST, selected=len(self.__searchDP.getSelected()), total=len(self.__searchDP.getTotal()))), 'buyEnabled': buyEnabled, 'enoughGold': enoughGold, 'enoughCredits': enoughCredits, 'notEnoughGoldTooltip': notEnoughGoldTooltip, 'notEnoughCreditsTooltip': notEnoughCreditsTooltip })
def __setBottomPanelData(self): if self.__carouselHidden: label = g_customizationController.carousel.slots.getSummaryString() else: label = g_customizationController.carousel.slots.getCurrentTypeLabel( ) totalGold = g_customizationController.carousel.slots.cart.totalPriceGold totalCredits = g_customizationController.carousel.slots.cart.totalPriceCredits notEnoughGoldTooltip = notEnoughCreditsTooltip = '' enoughGold = g_itemsCache.items.stats.gold >= totalGold enoughCredits = g_itemsCache.items.stats.credits >= totalCredits if not enoughGold: diff = text_styles.gold(totalGold - g_itemsCache.items.stats.gold) notEnoughGoldTooltip = makeTooltip( _ms(TOOLTIPS.CUSTOMIZATION_NOTENOUGHRESOURCES_HEADER), _ms(TOOLTIPS.CUSTOMIZATION_NOTENOUGHRESOURCES_BODY, count='{0}{1}'.format(diff, icons.gold()))) if not enoughCredits: diff = text_styles.credits(totalCredits - g_itemsCache.items.stats.credits) notEnoughCreditsTooltip = makeTooltip( _ms(TOOLTIPS.CUSTOMIZATION_NOTENOUGHRESOURCES_HEADER), _ms(TOOLTIPS.CUSTOMIZATION_NOTENOUGHRESOURCES_BODY, count='{0}{1}'.format(diff, icons.credits()))) self.as_setBottomPanelHeaderS({ 'newHeaderText': label, 'buyBtnLabel': _ms(MENU.CUSTOMIZATION_BUTTONS_APPLY, count=len( g_customizationController.carousel.slots.cart.items)), 'pricePanel': { 'totalPriceCredits': formatPriceCredits(totalCredits), 'totalPriceGold': formatPriceGold(totalGold), 'enoughGold': enoughGold, 'enoughCredits': enoughCredits, 'notEnoughGoldTooltip': notEnoughGoldTooltip, 'notEnoughCreditsTooltip': notEnoughCreditsTooltip } })
def __setBottomPanelData(self): if self.__carouselHidden: label = g_customizationController.carousel.slots.getSummaryString() else: label = g_customizationController.carousel.slots.getCurrentTypeLabel() totalGold = g_customizationController.carousel.slots.cart.totalPriceGold totalCredits = g_customizationController.carousel.slots.cart.totalPriceCredits notEnoughGoldTooltip = notEnoughCreditsTooltip = '' enoughGold = g_itemsCache.items.stats.gold >= totalGold enoughCredits = g_itemsCache.items.stats.credits >= totalCredits if not enoughGold: diff = text_styles.gold(totalGold - g_itemsCache.items.stats.gold) notEnoughGoldTooltip = makeTooltip(_ms(TOOLTIPS.CUSTOMIZATION_NOTENOUGHRESOURCES_HEADER), _ms(TOOLTIPS.CUSTOMIZATION_NOTENOUGHRESOURCES_BODY, count='{0}{1}'.format(diff, icons.gold()))) if not enoughCredits: diff = text_styles.credits(totalCredits - g_itemsCache.items.stats.credits) notEnoughCreditsTooltip = makeTooltip(_ms(TOOLTIPS.CUSTOMIZATION_NOTENOUGHRESOURCES_HEADER), _ms(TOOLTIPS.CUSTOMIZATION_NOTENOUGHRESOURCES_BODY, count='{0}{1}'.format(diff, icons.credits()))) self.as_setBottomPanelHeaderS({'newHeaderText': label, 'buyBtnLabel': _ms(MENU.CUSTOMIZATION_BUTTONS_APPLY, count=len(g_customizationController.carousel.slots.cart.items)), 'pricePanel': {'totalPriceCredits': formatPriceCredits(totalCredits), 'totalPriceGold': formatPriceGold(totalGold), 'enoughGold': enoughGold, 'enoughCredits': enoughCredits, 'notEnoughGoldTooltip': notEnoughGoldTooltip, 'notEnoughCreditsTooltip': notEnoughCreditsTooltip}})