コード例 #1
0
 def __getConfirmator(self, withoutBenefits, period, price):
     if withoutBenefits:
         return plugins.HtmlMessageConfirmator(
             'buyPremWithoutBenefitsConfirmation',
             'html_templates:lobby/dialogs',
             'confirmBuyPremWithoutBenefeits', {
                 'days':
                 text_styles.stats(period),
                 Currency.GOLD:
                 text_styles.concatStylesWithSpace(
                     text_styles.gold(BigWorld.wg_getGoldFormat(price)),
                     icons.makeImageTag(
                         RES_ICONS.MAPS_ICONS_LIBRARY_GOLDICON_2))
             })
     localKey = 'premiumContinueConfirmation' if self.wasPremium else 'premiumBuyConfirmation'
     return plugins.MessageConfirmator(
         localKey,
         ctx={
             'days':
             text_styles.stats(period),
             Currency.GOLD:
             text_styles.concatStylesWithSpace(
                 text_styles.gold(BigWorld.wg_getGoldFormat(price)),
                 icons.makeImageTag(
                     RES_ICONS.MAPS_ICONS_LIBRARY_GOLDICON_2))
         })
コード例 #2
0
 def __init__(self, gold, withConfirm=True):
     self.gold = gold
     self.credits = int(gold) * self.itemsCache.items.shop.exchangeRate
     super(GoldToCreditsExchanger, self).__init__()
     if withConfirm:
         self.addPlugin(plugins.HtmlMessageConfirmator('exchangeGoldConfirmation', 'html_templates:lobby/dialogs', 'confirmExchange', {'primaryCurrencyAmount': backport.getGoldFormat(self.gold),
          'resultCurrencyAmount': backport.getIntegralFormat(self.credits)}))
     self.addPlugin(plugins.MoneyValidator(Money(gold=self.gold)))
コード例 #3
0
 def __makeConfirmator(self):
     xpLimit = self.itemsCache.items.shop.freeXPConversionLimit
     extra = {'resultCurrencyAmount': BigWorld.wg_getIntegralFormat(self.xp),
      'primaryCurrencyAmount': BigWorld.wg_getGoldFormat(self.gold)}
     if self.__freeConversion:
         sourceKey = 'XP_EXCHANGE_FOR_FREE'
         extra['freeXPLimit'] = BigWorld.wg_getIntegralFormat(xpLimit)
     else:
         sourceKey = 'XP_EXCHANGE_FOR_GOLD'
     return plugins.HtmlMessageConfirmator('exchangeXPConfirmation', 'html_templates:lobby/dialogs', 'confirmExchangeXP', extra, sourceKey=sourceKey)
コード例 #4
0
 def __init__(self, gold):
     self.gold = gold
     self.credits = int(gold) * g_itemsCache.items.shop.exchangeRate
     super(GoldToCreditsExchanger,
           self).__init__(plugins=(plugins.HtmlMessageConfirmator(
               'exchangeGoldConfirmation', 'html_templates:lobby/dialogs',
               'confirmExchange', {
                   'primaryCurrencyAmount':
                   BigWorld.wg_getGoldFormat(self.gold),
                   'resultCurrencyAmount':
                   BigWorld.wg_getIntegralFormat(self.credits)
               }), plugins.MoneyValidator(Money(gold=self.gold))))
コード例 #5
0
 def __getConfirmator(self, withoutBenefits, period, price):
     if withoutBenefits:
         return plugins.HtmlMessageConfirmator(
             'buyPremWithoutBenefitsConfirmation',
             'html_templates:lobby/dialogs',
             'confirmBuyPremWithoutBenefeits', {
                 'days': int(period),
                 'gold': BigWorld.wg_getGoldFormat(price)
             })
     else:
         localKey = 'premiumContinueConfirmation' if self.wasPremium else 'premiumBuyConfirmation'
         return plugins.MessageConfirmator(
             localKey,
             ctx={
                 'days': int(period),
                 'gold': BigWorld.wg_getGoldFormat(price)
             })