Esempio n. 1
0
 def __addComplexXPsItem(self,
                         label,
                         baseXP,
                         premiumXP,
                         baseFreeXP,
                         premiumFreeXP,
                         xpRecord,
                         freeXPRecord,
                         htmlKey=''):
     baseCanBeFaded = not self.isPremium
     premiumCanBeFaded = self.isPremium
     columns = {
         'column1':
         style.makeXpLabel(baseXP.getRecord(xpRecord),
                           canBeFaded=baseCanBeFaded),
         'column3':
         style.makeXpLabel(premiumXP.getRecord(xpRecord),
                           canBeFaded=premiumCanBeFaded),
         'column2':
         style.makeFreeXpLabel(baseFreeXP.getRecord(freeXPRecord),
                               canBeFaded=baseCanBeFaded),
         'column4':
         style.makeFreeXpLabel(premiumFreeXP.getRecord(freeXPRecord),
                               canBeFaded=premiumCanBeFaded)
     }
     self._addStatsRow(label, htmlKey=htmlKey, **columns)
Esempio n. 2
0
 def __addTotalResults(self, baseXP, premiumXP, baseFreeXP, premiumFreeXP):
     baseCanBeFaded = not self.isPremium and self.canResourceBeFaded
     premiumCanBeFaded = self.isPremium and self.canResourceBeFaded
     columns = {'column1': style.makeXpLabel(baseXP.getRecord('xp'), canBeFaded=baseCanBeFaded),
      'column3': style.makeXpLabel(premiumXP.getRecord('xp'), canBeFaded=premiumCanBeFaded),
      'column2': style.makeFreeXpLabel(baseFreeXP.getRecord('freeXP'), canBeFaded=baseCanBeFaded),
      'column4': style.makeFreeXpLabel(premiumFreeXP.getRecord('freeXP'), canBeFaded=premiumCanBeFaded)}
     self._addStatsRow('total', htmlKey='lightText', **columns)
 def __addXPsItem(self, label, baseXP, premiumXP, xpRecord):
     columns = {
         'column1':
         style.makeXpLabel(baseXP.getRecord(xpRecord),
                           canBeFaded=not self.isPremium),
         'column3':
         style.makeXpLabel(premiumXP.getRecord(xpRecord),
                           canBeFaded=self.isPremium)
     }
     self._addStatsRow(label, **columns)
Esempio n. 4
0
 def __addEventXPs(self, baseXP, premiumXP, baseFreeXP, premiumFreeXP):
     baseXPValue = baseXP.findRecord('eventXPList_') + baseXP.findRecord('eventXPFactor100List_')
     premiumXPValue = premiumXP.findRecord('eventXPList_') + premiumXP.findRecord('eventXPFactor100List_')
     baseFreeXPValue = baseFreeXP.findRecord('eventFreeXPList_') + baseFreeXP.findRecord('eventFreeXPFactor100List_')
     premiumFreeXPValue = premiumFreeXP.findRecord('eventFreeXPList_') + premiumFreeXP.findRecord('eventFreeXPFactor100List_')
     if baseXPValue or premiumXPValue or baseFreeXPValue or premiumFreeXPValue:
         baseCanBeFaded = not self.isPremium
         premiumCanBeFaded = self.isPremium
         columns = {'column1': style.makeXpLabel(baseXPValue, canBeFaded=baseCanBeFaded),
          'column3': style.makeXpLabel(premiumXPValue, canBeFaded=premiumCanBeFaded),
          'column2': style.makeFreeXpLabel(baseFreeXPValue, canBeFaded=baseCanBeFaded),
          'column4': style.makeFreeXpLabel(premiumFreeXPValue, canBeFaded=premiumCanBeFaded)}
         self._addStatsRow('event', **columns)
Esempio n. 5
0
 def __addBoosterXPs(self, baseXP, premiumXP, baseFreeXP, premiumFreeXP):
     baseXPValue = baseXP.getRecord('boosterXP', 'boosterXPFactor100')
     premiumXPValue = premiumXP.getRecord('boosterXP', 'boosterXPFactor100')
     baseFreeXPValue = baseFreeXP.getRecord('boosterFreeXP', 'boosterFreeXPFactor100')
     premiumFreeXPValue = premiumFreeXP.getRecord('boosterFreeXP', 'boosterFreeXPFactor100')
     if baseXPValue or premiumXPValue or baseFreeXPValue or premiumFreeXPValue:
         baseCanBeFaded = not self.isPremium
         premiumCanBeFaded = self.isPremium
         columns = {'column1': style.makeXpLabel(baseXPValue, canBeFaded=baseCanBeFaded),
          'column3': style.makeXpLabel(premiumXPValue, canBeFaded=premiumCanBeFaded),
          'column2': style.makeFreeXpLabel(baseFreeXPValue, canBeFaded=baseCanBeFaded),
          'column4': style.makeFreeXpLabel(premiumFreeXPValue, canBeFaded=premiumCanBeFaded)}
         self._addStatsRow('boosters', **columns)
Esempio n. 6
0
 def __addBaseXPs(self, baseXP, premiumXP, baseFreeXP, premiumFreeXP):
     if baseXP.getRecord('isHighScope'):
         label, htmlKey = ('', 'xpRecord')
     else:
         label, htmlKey = ('base', '')
     baseXPValue, premiumXPValue, baseFreeXPValue, premiumFreeXPValue = self.__getBaseXPs(baseXP, premiumXP, baseFreeXP, premiumFreeXP)
     baseCanBeFaded = not self.isPremium
     premiumCanBeFaded = self.isPremium
     columns = {'column1': style.makeXpLabel(baseXPValue, canBeFaded=baseCanBeFaded),
      'column3': style.makeXpLabel(premiumXPValue, canBeFaded=premiumCanBeFaded),
      'column2': style.makeFreeXpLabel(baseFreeXPValue, canBeFaded=baseCanBeFaded),
      'column4': style.makeFreeXpLabel(premiumFreeXPValue, canBeFaded=premiumCanBeFaded)}
     self._addStatsRow(label, htmlKey=htmlKey, **columns)
 def __getSquadXPDetails(self, baseXP, premiumXP):
     squadXP = baseXP.getRecord('squadXPFactor100')
     premiumSquadXP = premiumXP.getRecord('squadXPFactor100')
     baseLabel = style.makeXpLabel(squadXP, canBeFaded=not self.isPremium)
     premiumLabel = style.makeXpLabel(premiumSquadXP,
                                      canBeFaded=not self.isPremium)
     if squadXP < 0 or premiumSquadXP < 0:
         label = 'squadXPPenalty'
         if self.isPremium:
             baseLabel = None
         else:
             premiumLabel = None
     else:
         label = 'squadXP'
     columns = {'column1': baseLabel, 'column3': premiumLabel}
     self._addStatsRow(label, **columns)
     return
Esempio n. 8
0
 def __setShowButtonState(self):
     self.statusBonusLabel = ''
     self.statusBonusTooltip = ''
     bonusValue = self.__battleResults.getAdditionalXPValue(
         self.__arenaUniqueID)
     self.xpValue = style.makeXpLabel(bonusValue,
                                      isDiff=True,
                                      useBigIcon=True)
Esempio n. 9
0
 def __addNYXPs(self, baseXP, premiumXP, baseFreeXP, premiumFreeXP, vehicleNation):
     baseXPValue, premiumXPValue, baseFreeXPValue, premiumFreeXPValue = self.__getBaseXPs(baseXP, premiumXP, baseFreeXP, premiumFreeXP)
     newYearFactor = baseXP.getFactor('newYearXPFactor100')
     newYearFreeXPFactor = baseFreeXP.getFactor('newYearFreeXPFactor100')
     if newYearFactor != 1.0 or newYearFreeXPFactor != 1.0:
         newYearFactor = 0 if newYearFactor == 1.0 else newYearFactor
         newYearFreeXPFactor = 0 if newYearFreeXPFactor == 1.0 else newYearFreeXPFactor
         baseNYXPValue = int(round(baseXPValue * newYearFactor))
         premiumNYXPValue = int(round(premiumXPValue * newYearFactor))
         baseFreeNYXPValue = int(round(baseFreeXPValue * newYearFreeXPFactor))
         premiumFreeNYXPValue = int(round(premiumFreeXPValue * newYearFreeXPFactor))
         baseCanBeFaded = not self.isPremium
         premiumCanBeFaded = self.isPremium
         settingLabel = _getNewYearBonusLabelByVehicleNation(vehicleNation)
         columns = {'column1': style.makeXpLabel(baseNYXPValue, canBeFaded=baseCanBeFaded),
          'column3': style.makeXpLabel(premiumNYXPValue, canBeFaded=premiumCanBeFaded),
          'column2': style.makeFreeXpLabel(baseFreeNYXPValue, canBeFaded=baseCanBeFaded),
          'column4': style.makeFreeXpLabel(premiumFreeNYXPValue, canBeFaded=premiumCanBeFaded)}
         self._addStatsRow(settingLabel, **columns)
Esempio n. 10
0
 def __addBaseXPs(self, baseXP, premiumXP, baseFreeXP, premiumFreeXP):
     if baseXP.getRecord('isHighScope'):
         label, htmlKey = ('', 'xpRecord')
     else:
         label, htmlKey = ('base', '')
     baseXPValue = baseXP.getRecord('originalXP')
     baseXPValue -= baseXP.getRecord('achievementXP')
     premiumXPValue = premiumXP.getRecord('originalXP', 'appliedPremiumXPFactor10')
     premiumXPValue -= premiumXP.getRecord('achievementXP')
     baseFreeXPValue = baseFreeXP.getRecord('originalFreeXP')
     baseFreeXPValue -= baseFreeXP.getRecord('achievementFreeXP')
     premiumFreeXPValue = premiumFreeXP.getRecord('originalFreeXP', 'appliedPremiumXPFactor10')
     premiumFreeXPValue -= premiumFreeXP.getRecord('achievementFreeXP')
     baseCanBeFaded = not self.isPremium
     premiumCanBeFaded = self.isPremium
     columns = {'column1': style.makeXpLabel(baseXPValue, canBeFaded=baseCanBeFaded),
      'column3': style.makeXpLabel(premiumXPValue, canBeFaded=premiumCanBeFaded),
      'column2': style.makeFreeXpLabel(baseFreeXPValue, canBeFaded=baseCanBeFaded),
      'column4': style.makeFreeXpLabel(premiumFreeXPValue, canBeFaded=premiumCanBeFaded)}
     self.__addStatsRowMethod(label, htmlKey=htmlKey, **columns)
Esempio n. 11
0
 def setRecord(self, result, reusable):
     canBeFaded = reusable.isPostBattlePremium and reusable.canResourceBeFaded
     isDiffShow = reusable.canUpgradeToPremium
     for records in reusable.personal.getXPRecords():
         baseXP, premiumXP = records[:2]
         xp = premiumXP.getRecord('xpToShow')
         if isDiffShow:
             value = xp - baseXP.getRecord('xpToShow')
         else:
             value = xp
         value = style.makeXpLabel(value, canBeFaded=canBeFaded, isDiff=isDiffShow)
         self.addNextComponent(base.DirectStatsItem('', value))
 def getVO(self):
     stats = self.__itemsCache.items.stats
     self.isGetPremium = self.__canUpgradeToBasic and self.__xpDiff > 0 and self.__creditsDiff > 0 and not stats.isPremium
     self.isUpgradeToPremiumPlus = self.__canUpgradeToPlus and not stats.isActivePremium(PREMIUM_TYPE.PLUS)
     self.__setPremiumBonusData()
     if self.__xpDiff < 0 or self.__creditsDiff < 0:
         self.creditsPremiumBonusStr = ''
         self.xpPremiumBonusStr = ''
     else:
         self.creditsPremiumBonusStr = style.makeCreditsLabel(self.__creditsDiff, isDiff=True, useBigIcon=True)
         self.xpPremiumBonusStr = style.makeXpLabel(self.__xpDiff, isDiff=True, useBigIcon=True)
     player = BigWorld.player()
     self.inBattleQueue = player.isInBattleQueue()
     self.visibleDetailsBtn = bool(GUI_SETTINGS.premiumInfo.get('baseURL'))
     return super(PremiumInfoBlock, self).getVO()
Esempio n. 13
0
 def setRecord(self, result, reusable):
     isPremuim = not reusable.isPostBattlePremium and reusable.canResourceBeFaded
     for records in reusable.personal.getBaseXPRecords():
         value = style.makeXpLabel(records.getRecord('xpToShow'),
                                   canBeFaded=isPremuim)
         self.addNextComponent(base.DirectStatsItem('', value))