Exemplo n.º 1
0
 def _packSingleBonus(cls, bonus):
     model = RewardItemModel()
     model.setName(bonus.getName())
     model.setValue(str(cls.getValue(bonus)))
     model.setIcon(bonus.getType())
     model.setBigIcon(bonus.getType())
     return model
Exemplo n.º 2
0
 def _packSingleBonus(cls, bonus):
     model = RewardItemModel()
     cls._packCommon(bonus, model)
     chapter = bonus.getChapter()
     level = bonus.getLevel()
     customizationItem = getStyleForChapter(chapter)
     model.setIcon(cls._ICON_NAME_TEMPLATE.format(level))
     model.setOverlayType(ItemHighlightTypes.PROGRESSION_STYLE_UPGRADED +
                          str(level))
     if customizationItem is not None:
         if level == cls._STYLE_FIRST_LEVEL:
             userName = backport.text(cls._rStyleProgression.newStyle(),
                                      styleName=customizationItem.userName)
         elif level == cls._STYLE_MAX_LEVEL:
             userName = backport.text(cls._rStyleProgression.finalLevel(),
                                      styleName=customizationItem.userName)
         else:
             userName = backport.text(cls._rStyleProgression.newLevel(),
                                      styleName=customizationItem.userName)
         model.setUserName(userName)
         postfix = str(customizationItem.id)
         model.setBigIcon('_'.join(
             [cls._ICON_NAME_TEMPLATE.format(level), postfix]))
     else:
         postfix = 'undefined'
     cls._injectAwardID(model, postfix)
     return model
Exemplo n.º 3
0
 def _packSingleBonus(cls, bonus):
     model = RewardItemModel()
     cls._packCommon(bonus, model)
     model.setIcon(bonus.getName())
     model.setValue(str(bonus.getValue()))
     model.setUserName(str(bonus.getValue()))
     model.setBigIcon(bonus.getName())
     return model
Exemplo n.º 4
0
 def _packSingleBonus(cls, bonus, item, data):
     model = RewardItemModel()
     cls._packCommon(bonus, model)
     customizationItem = bonus.getC11nItem(item)
     iconName = customizationItem.itemTypeName
     if iconName == 'style' and customizationItem.modelsSet:
         iconName = 'style_3d'
     model.setValue(str(data.get('value', '')))
     model.setIcon(iconName)
     model.setUserName(customizationItem.userName)
     if customizationItem.itemTypeName == 'style':
         bigIcon = iconName
     else:
         bigIcon = '_'.join([iconName, str(customizationItem.intCD)])
     model.setBigIcon(bigIcon)
     cls._injectAwardID(model, str(customizationItem.intCD))
     return model
Exemplo n.º 5
0
 def __packTmanTemplateToken(cls, tokenID, bonus):
     recruitInfo = getRecruitInfo(tokenID)
     if recruitInfo is None:
         return
     else:
         if recruitInfo.isFemale():
             bonusImageName = 'tankwoman'
         else:
             bonusImageName = 'tankman'
         model = RewardItemModel()
         cls._packCommon(bonus, model)
         model.setIcon(bonusImageName)
         model.setUserName(recruitInfo.getFullUserName())
         model.setBigIcon('_'.join([bonusImageName, recruitInfo.getGroupName()]))
         cls._injectAwardID(model, recruitInfo.getGroupName())
         return model
Exemplo n.º 6
0
 def _getBonusModel(cls):
     return RewardItemModel()
Exemplo n.º 7
0
 def _packSingleBonus(cls,
                      bonus,
                      dossierIconName,
                      dossierNamePostfix,
                      dossierValue,
                      userName=''):
     model = RewardItemModel()
     model.setName(bonus.getName() + dossierNamePostfix)
     model.setIsCompensation(bonus.isCompensation())
     model.setValue(str(dossierValue))
     model.setIcon(dossierIconName)
     model.setUserName(userName)
     model.setBigIcon(dossierIconName)
     return model
Exemplo n.º 8
0
 def _packSingleBonus(cls, bonus):
     days = bonus.getValue()
     model = RewardItemModel()
     if days in cls._ICONS_AVAILABLE:
         model.setName(bonus.getName())
         model.setBigIcon('_'.join([bonus.getName(), str(days)]))
     else:
         model.setName('premium_universal')
         model.setBigIcon('premium_universal')
     model.setIsCompensation(bonus.isCompensation())
     model.setValue(str(bonus.getValue()))
     model.setUserName(
         backport.text(R.strings.tooltips.awardItem.premium_plus.header()))
     return model
Exemplo n.º 9
0
 def _packSingleBonus(cls, bonus, label):
     model = RewardItemModel()
     model.setName(bonus.getName())
     model.setBigIcon(bonus.getName())
     return model