Exemple #1
0
 def __init__(self, showConfirm=True, showWarning=True):
     self.__hasDiscounts = bool(
         self.itemsCache.items.shop.personalSlotDiscounts)
     self.__frozenSlotPrice = None
     slotCost = self.__getSlotPrice()
     if self.__hasDiscounts and not slotCost:
         confirmationType = 'freeSlotConfirmation'
         ctx = {}
     else:
         confirmationType = 'buySlotConfirmation'
         ctx = {
             'goldCost':
             text_styles.concatStylesWithSpace(
                 text_styles.gold(str(slotCost.gold)),
                 icons.makeImageTag(
                     RES_ICONS.MAPS_ICONS_LIBRARY_GOLDICON_2))
         }
     super(VehicleSlotBuyer, self).__init__(
         (proc_plugs.MessageInformator(
             'buySlotNotEnoughCredits',
             activeHandler=lambda: not proc_plugs.MoneyValidator(
                 slotCost).validate().success,
             isEnabled=showWarning),
          proc_plugs.MessageConfirmator(confirmationType,
                                        isEnabled=showConfirm,
                                        ctx=ctx),
          proc_plugs.MoneyValidator(slotCost)))
     return
Exemple #2
0
 def __init__(self, showConfirm = True, showWarning = True):
     self.__hasDiscounts = bool(g_itemsCache.items.shop.personalSlotDiscounts)
     self.__frozenSlotPrice = None
     slotCost = self.__getSlotPrice()
     if self.__hasDiscounts and slotCost.gold == 0:
         confirmationType = 'freeSlotConfirmation'
         ctx = {}
     else:
         confirmationType = 'buySlotConfirmation'
         ctx = {'gold': slotCost[1]}
     super(VehicleSlotBuyer, self).__init__((plugins.MessageInformator('buySlotNotEnoughCredits', activeHandler=lambda : not plugins.MoneyValidator(slotCost).validate().success, isEnabled=showWarning), plugins.MessageConfirmator(confirmationType, isEnabled=showConfirm, ctx=ctx), plugins.MoneyValidator(slotCost)))
Exemple #3
0
 def __init__(self, berthsPrice, berthsCount):
     super(TankmanBerthsBuyer, self).__init__(
         (plugins.MessageInformator(
             'barracksExpandNotEnoughMoney',
             activeHandler=lambda: not plugins.MoneyValidator(
                 berthsPrice).validate().success),
          plugins.MessageConfirmator('barracksExpand',
                                     ctx={
                                         'price': berthsPrice.gold,
                                         'count': berthsCount
                                     }),
          plugins.MoneyValidator(berthsPrice)))
     self.berthsPrice = berthsPrice
Exemple #4
0
 def __init__(self, berthsPrice, berthsCount):
     super(TankmanBerthsBuyer, self).__init__(
         (plugins.MessageInformator(
             'barracksExpandNotEnoughMoney',
             activeHandler=lambda: not plugins.MoneyValidator(
                 berthsPrice).validate().success),
          plugins.MessageConfirmator(
              'barracksExpand',
              ctx={
                  'price':
                  text_styles.concatStylesWithSpace(
                      text_styles.gold(str(berthsPrice.gold)),
                      icons.makeImageTag(
                          RES_ICONS.MAPS_ICONS_LIBRARY_GOLDICON_2)),
                  'count':
                  text_styles.stats(berthsCount)
              }), plugins.MoneyValidator(berthsPrice)))
     self.berthsPrice = berthsPrice
Exemple #5
0
 def __init__(self, showConfirm = True, showWarning = True):
     slotCost = self.__getSlotPrice()
     super(VehicleSlotBuyer, self).__init__((plugins.MessageInformator('buySlotNotEnoughCredits', activeHandler=lambda : not plugins.MoneyValidator(slotCost).validate().success, isEnabled=showWarning), plugins.MessageConfirmator('buySlotConfirmation', isEnabled=showConfirm, ctx={'gold': slotCost[1]}), plugins.MoneyValidator(slotCost)))