コード例 #1
0
ファイル: bonus_panel.py プロジェクト: webiumsk/WOT-0.9.14-CT
    def update(self, updatedSlotsData):
        for qTypeName in QUALIFIER_TYPE_NAMES.iterkeys():
            self.__bonusData[qTypeName]["bonusAppliedCount"] = 0

        self.__restoreInitialTooltipData()
        forEachSlotIn(updatedSlotsData, self.__initialSlotsData, self.__recalculateBonusData)
        self.__setAnimations()
        self.bonusesUpdated(self.__bonusData)
コード例 #2
0
    def update(self, updatedSlotsData):
        for qTypeName in QUALIFIER_TYPE_NAMES.iterkeys():
            self.__bonusData[qTypeName]['bonusAppliedCount'] = 0

        self.__restoreInitialTooltipData()
        forEachSlotIn(updatedSlotsData, self.__initialSlotsData,
                      self.__recalculateBonusData)
        self.__setAnimations()
        self.bonusesUpdated(self.__bonusData)
コード例 #3
0
ファイル: cart.py プロジェクト: webiumsk/WOT0.10.0
 def update(self, updatedSlotsData):
     self.__purchaseData = []
     self.__totalPriceCredits = 0
     self.__totalPriceGold = 0
     forEachSlotIn(updatedSlotsData, self.__initialSlotsData, self.__recalculatePurchaseData)
     self.itemsUpdated(self.__purchaseData)
     self.totalPriceUpdated()
     if not bool(self.__totalPriceCredits + self.__totalPriceGold):
         if self.__isShown:
             self.emptied()
             self.__isShown = False
     elif not self.__isShown:
         self.filled()
         self.__isShown = True
コード例 #4
0
ファイル: cart.py プロジェクト: webiumsk/WOT-0.9.14-CT
 def update(self, updatedSlotsData):
     self.__purchaseData = []
     sortedContainer = [[], [], []]
     forEachSlotIn(updatedSlotsData, self.__initialSlotsData, functools.partial(self.__recalculatePurchaseData, sortedContainer))
     self.__purchaseData = list(itertools.chain(*sortedContainer))
     self.markDuplicates()
     self.recalculateTotalPrice()
     self.itemsUpdated(self.__purchaseData)
     self.totalPriceUpdated()
     if not bool(self.__totalPriceCredits + self.__totalPriceGold):
         if self.__isShown:
             self.emptied()
             self.__isShown = False
     elif not self.__isShown:
         self.filled()
         self.__isShown = True
コード例 #5
0
 def update(self, updatedSlotsData):
     self.__purchaseData = []
     sortedContainer = [[], [], []]
     forEachSlotIn(
         updatedSlotsData, self.__initialSlotsData,
         functools.partial(self.__recalculatePurchaseData, sortedContainer))
     self.__purchaseData = list(itertools.chain(*sortedContainer))
     self.markDuplicates()
     self.recalculateTotalPrice()
     self.itemsUpdated(self.__purchaseData)
     self.totalPriceUpdated()
     if not bool(self.__totalPriceCredits + self.__totalPriceGold):
         if self.__isShown:
             self.emptied()
             self.__isShown = False
     elif not self.__isShown:
         self.filled()
         self.__isShown = True
コード例 #6
0
ファイル: bonus_panel.py プロジェクト: webiumsk/WOT0.10.0
    def setInitialSlotsData(self, iSlotsData):
        if not self.__processingPurchase:
            self.__animationStarted = False
        self.__initialSlotsData = iSlotsData
        self.__bonusData = {}
        for qTypeName in QUALIFIER_TYPE_NAMES.iterkeys():
            self.__bonusData[qTypeName] = {'bonusName': text_styles.main(_getBonusNameByType(qTypeName)),
             'bonusIcon': _getBonusIcon42x42ByType(qTypeName),
             'bonusTotalCount': 0,
             CUSTOMIZATION_TYPE.CAMOUFLAGE: [],
             CUSTOMIZATION_TYPE.EMBLEM: [],
             CUSTOMIZATION_TYPE.INSCRIPTION: [],
             'oldBonusTotalCount': 0,
             'bonusAppliedCount': 0,
             'oldBonusAppliedCount': 0,
             'bonusTotalDescriptionCount': 0,
             'bonusAppliedDescriptionCount': 0}

        forEachSlotIn(iSlotsData, iSlotsData, self.__getInitialBonusData)
        self.__saveInitialTooltipData()
コード例 #7
0
    def setInitialSlotsData(self, iSlotsData):
        if not self.__processingPurchase:
            self.__animationStarted = False
        self.__initialSlotsData = iSlotsData
        self.__bonusData = {}
        for qTypeName in QUALIFIER_TYPE_NAMES.iterkeys():
            self.__bonusData[qTypeName] = {
                'bonusName': text_styles.main(_getBonusNameByType(qTypeName)),
                'bonusIcon': _getBonusIcon42x42ByType(qTypeName),
                'bonusTotalCount': 0,
                CUSTOMIZATION_TYPE.CAMOUFLAGE: [],
                CUSTOMIZATION_TYPE.EMBLEM: [],
                CUSTOMIZATION_TYPE.INSCRIPTION: [],
                'oldBonusTotalCount': 0,
                'bonusAppliedCount': 0,
                'oldBonusAppliedCount': 0,
                'bonusTotalDescriptionCount': 0,
                'bonusAppliedDescriptionCount': 0
            }

        forEachSlotIn(iSlotsData, iSlotsData, self.__getInitialBonusData)
        self.__saveInitialTooltipData()