Пример #1
0
 def _getUnlockConfirmMeta(self, itemCD, costCtx):
     itemTypeID, nationID, itemID = vehicles.parseIntCompactDescr(itemCD)
     ctx = {
         'xpCost': BigWorld.wg_getIntegralFormat(costCtx['xpCost']),
         'freeXP': BigWorld.wg_getIntegralFormat(costCtx['freeXP']),
         'typeString': getTypeInfoByIndex(itemTypeID)['userString']
     }
     if itemTypeID == _VEHICLE:
         key = 'confirmUnlockVehicle'
         ctx['userString'] = vehicles.getVehicleType(itemCD).userString
     else:
         key = 'confirmUnlockItem'
         ctx['userString'] = vehicles.getDictDescr(itemCD)['userString']
     return HtmlMessageLocalDialogMeta('html_templates:lobby/dialogs',
                                       key,
                                       ctx=ctx)
Пример #2
0
 def _makeMeta(self):
     data = self.itemsCache.items.getItems(
         GUI_ITEM_TYPE.OPTIONALDEVICE,
         REQ_CRITERIA.VEHICLE.SUITABLE(
             [self.__vehicle], [GUI_ITEM_TYPE.OPTIONALDEVICE])).values()
     optDevicesList = [
         device for device in data
         if self.__battleBooster.isOptionalDeviceCompatible(device)
     ]
     ctx = {
         'devices':
         ', '.join([device.userName for device in optDevicesList])
     }
     localeKey = self.localeKey if optDevicesList else self.__notSuitableLocaleKey
     return I18nConfirmDialogMeta(localeKey,
                                  meta=HtmlMessageLocalDialogMeta(
                                      'html_templates:lobby/dialogs',
                                      localeKey,
                                      ctx=ctx))
Пример #3
0
 def _makeMeta(self):
     return I18nConfirmDialogMeta(self.localeKey,
                                  meta=HtmlMessageLocalDialogMeta(
                                      'html_templates:lobby/dialogs',
                                      self.localeKey,
                                      ctx=self.ctx))