Beispiel #1
0
 def description(self):
     from gui.Scaleform.daapi.view.lobby.fortifications.fort_utils.FortViewHelper import FortViewHelper
     if self.isSpecialMission:
         awardText = i18n.makeString(FORTIFICATIONS.ORDERS_SPECIALMISSION_POSSIBLEAWARD) + ' '
         bonusDescr = i18n.makeString(FORTIFICATIONS.orders_specialmission_possibleaward_description_level(self.level))
         return ''.join((text_styles.neutral(awardText), text_styles.main(bonusDescr)))
     elif self.isConsumable:
         return fort_formatters.getBonusText('', FortViewHelper.getBuildingUIDbyID(self.buildingID), ctx=dict(self.getParams()))
     else:
         effectValueStr = '+' + str(abs(self.effectValue))
         return fort_formatters.getBonusText('%s%%' % effectValueStr, FortViewHelper.getBuildingUIDbyID(self.buildingID))
Beispiel #2
0
 def description(self):
     from gui.Scaleform.daapi.view.lobby.fortifications.fort_utils.FortViewHelper import FortViewHelper
     if self.isSpecialMission:
         awardText = i18n.makeString(FORTIFICATIONS.ORDERS_SPECIALMISSION_POSSIBLEAWARD) + ' '
         bonusDescr = i18n.makeString(FORTIFICATIONS.orders_specialmission_possibleaward_description_level(self.level))
         return ''.join((text_styles.neutral(awardText), text_styles.main(bonusDescr)))
     elif self.isConsumable:
         return fort_formatters.getBonusText('', FortViewHelper.getBuildingUIDbyID(self.buildingID), ctx=dict(self.getParams()))
     else:
         effectValueStr = '+' + str(abs(self.effectValue))
         return fort_formatters.getBonusText('%s%%' % effectValueStr, FortViewHelper.getBuildingUIDbyID(self.buildingID))
Beispiel #3
0
 def description(self):
     from gui.Scaleform.daapi.view.lobby.fortifications.fort_utils.FortViewHelper import FortViewHelper
     if self.isSpecialMission:
         awardText = i18n.makeString(FORTIFICATIONS.ORDERS_SPECIALMISSION_POSSIBLEAWARD) + ' '
         bonusDescr = i18n.makeString(FORTIFICATIONS.orders_specialmission_possibleaward_description_level(self.level))
         return self.app.utilsManager.textManager.concatStyles(((TEXT_MANAGER_STYLES.NEUTRAL_TEXT, awardText), (TEXT_MANAGER_STYLES.MAIN_TEXT, bonusDescr)))
     elif self.isConsumable:
         return fort_formatters.getBonusText('', FortViewHelper.getBuildingUIDbyID(self.buildingID), ctx=dict(self.getParams()))
     else:
         effectValueStr = '+' + str(abs(self.effectValue))
         return fort_formatters.getBonusText('%s%%' % effectValueStr, FortViewHelper.getBuildingUIDbyID(self.buildingID))
 def __prepareOrderInfo(self, increment = False, orderCount = 0, orderLevel = 1):
     result = {}
     if self.intBuildingID == FORT_BUILDING_TYPE.MILITARY_BASE:
         if increment:
             building_bonus = i18n.makeString(FORTIFICATIONS.BUILDINGPOPOVER_HEADER_LEVELSLBL, buildLevel=fort_formatters.getTextLevel(min(self.__baseBuildingLevel + 1, MAX_FORTIFICATION_LEVEL)))
             defresDescr = self.app.utilsManager.textManager.concatStyles(((TEXT_MANAGER_STYLES.NEUTRAL_TEXT, building_bonus + ' '), (TEXT_MANAGER_STYLES.MAIN_TEXT, i18n.makeString(FORTIFICATIONS.BUILDINGS_MODERNIZATIONDESCR_BASE_BUILDING))))
         else:
             building_bonus = i18n.makeString(FORTIFICATIONS.BUILDINGPOPOVER_HEADER_LEVELSLBL, buildLevel=fort_formatters.getTextLevel(self.__baseBuildingLevel))
             defresDescr = self.app.utilsManager.textManager.concatStyles(((TEXT_MANAGER_STYLES.STANDARD_TEXT, building_bonus + ' '), (TEXT_MANAGER_STYLES.STANDARD_TEXT, i18n.makeString(FORTIFICATIONS.BUILDINGS_MODERNIZATIONDESCR_BASE_BUILDING))))
     else:
         orderTypeID = self.fortCtrl.getFort().getBuildingOrder(self.intBuildingID)
         _, _, foundedLevel, orderData = self.fortCtrl.getFort().getOrderData(orderTypeID)
         if increment:
             bodyTextColor = TEXT_MANAGER_STYLES.MAIN_TEXT
             bonusTextColor = TEXT_MANAGER_STYLES.NEUTRAL_TEXT
             foundedLevel += 1
             _, _, _, orderData = self.fortCtrl.getFort().getOrderData(orderTypeID, foundedLevel)
             textPadding = '     '
         else:
             bodyTextColor = TEXT_MANAGER_STYLES.STANDARD_TEXT
             bonusTextColor = TEXT_MANAGER_STYLES.STANDARD_TEXT
             textPadding = ''
         if orderTypeID == FORT_ORDER_TYPE.SPECIAL_MISSION:
             awardText = textPadding + i18n.makeString(FORTIFICATIONS.ORDERS_SPECIALMISSION_POSSIBLEAWARD) + ' '
             bonusDescr = i18n.makeString(FORTIFICATIONS.orders_specialmission_possibleaward_description_level(foundedLevel))
             defresDescr = self.app.utilsManager.textManager.concatStyles(((bonusTextColor, awardText), (bodyTextColor, bonusDescr)))
         elif orderTypeID in FORT_ORDER_TYPE.CONSUMABLES:
             colorStyle = (bonusTextColor, bodyTextColor)
             battleOrder = FortOrder(orderTypeID, level=orderLevel)
             defresDescr = fort_formatters.getBonusText(textPadding, self.__uid, ctx=dict(battleOrder.getParams()), textsStyle=colorStyle)
         else:
             colorStyle = (bonusTextColor, bodyTextColor)
             bonus = str(abs(orderData.effectValue))
             defresDescr = fort_formatters.getBonusText('%s+%s%%' % (textPadding, bonus), self.__uid, colorStyle)
     result['ordersCount'] = orderCount
     result['description'] = defresDescr
     result['buildingType'] = self.__uid
     result['showAlertIcon'] = False
     isCombatOrderBuilding = self.__uid in [FORTIFICATION_ALIASES.FORT_ARTILLERY_SHOP_BUILDING, FORTIFICATION_ALIASES.FORT_BOMBER_SHOP_BUILDING]
     result['descriptionLink'] = increment and isCombatOrderBuilding
     if self.__uid != FORTIFICATION_ALIASES.FORT_BASE_BUILDING:
         order = self.fortCtrl.getFort().getOrder(self._buildingDescr.typeRef.orderType)
         result['iconSource'] = order.icon
         result['iconLevel'] = order.level if not increment else order.level + 1
     if increment and self.__uid != FORTIFICATION_ALIASES.FORT_BASE_BUILDING:
         result['infoIconSource'] = RES_ICONS.MAPS_ICONS_LIBRARY_INFORMATIONICON
         toolTipData = {}
         toolTipData['header'] = i18n.makeString(TOOLTIPS.FORTIFICATION_DEFRESICONINFO_HEADER)
         toolTipData['body'] = i18n.makeString(TOOLTIPS.FORTIFICATION_DEFRESICONINFO_BODY, testData='test py var')
         result['infoIconToolTipData'] = toolTipData
     return result
 def __prepareOrderInfo(self, increment = False, orderCount = 0, orderLevel = 1):
     result = {}
     if self.intBuildingID == FORT_BUILDING_TYPE.MILITARY_BASE:
         if increment:
             building_bonus = i18n.makeString(FORTIFICATIONS.BUILDINGPOPOVER_HEADER_LEVELSLBL, buildLevel=fort_formatters.getTextLevel(min(self.__baseBuildingLevel + 1, MAX_FORTIFICATION_LEVEL)))
             defresDescr = ''.join((text_styles.neutral(building_bonus + ' '), text_styles.main(i18n.makeString(FORTIFICATIONS.BUILDINGS_MODERNIZATIONDESCR_BASE_BUILDING))))
         else:
             building_bonus = i18n.makeString(FORTIFICATIONS.BUILDINGPOPOVER_HEADER_LEVELSLBL, buildLevel=fort_formatters.getTextLevel(self.__baseBuildingLevel))
             defresDescr = ''.join((text_styles.standard(building_bonus + ' '), text_styles.standard(i18n.makeString(FORTIFICATIONS.BUILDINGS_MODERNIZATIONDESCR_BASE_BUILDING))))
     else:
         orderTypeID = self.fortCtrl.getFort().getBuildingOrder(self.intBuildingID)
         _, _, foundedLevel, orderData = self.fortCtrl.getFort().getOrderData(orderTypeID)
         if increment:
             bodyStyle = text_styles.main
             bonusStyle = text_styles.neutral
             foundedLevel += 1
             _, _, _, orderData = self.fortCtrl.getFort().getOrderData(orderTypeID, foundedLevel)
             textPadding = '     '
         else:
             bodyStyle = text_styles.standard
             bonusStyle = text_styles.standard
             textPadding = ''
         if orderTypeID == FORT_ORDER_TYPE.SPECIAL_MISSION:
             awardText = textPadding + i18n.makeString(FORTIFICATIONS.ORDERS_SPECIALMISSION_POSSIBLEAWARD) + ' '
             bonusDescr = i18n.makeString(FORTIFICATIONS.orders_specialmission_possibleaward_description_level(foundedLevel))
             defresDescr = ''.join((bonusStyle(awardText), bodyStyle(bonusDescr)))
         elif orderTypeID in FORT_ORDER_TYPE.CONSUMABLES:
             battleOrder = FortOrder(orderTypeID, level=orderLevel)
             defresDescr = fort_formatters.getBonusText(textPadding, self.__uid, ctx=dict(battleOrder.getParams()), textsStyle=(bonusStyle, bodyStyle))
         else:
             colorStyle = (bonusStyle, bodyStyle)
             bonus = str(abs(orderData.effectValue))
             defresDescr = fort_formatters.getBonusText('%s+%s%%' % (textPadding, bonus), self.__uid, colorStyle)
     result['ordersCount'] = orderCount
     result['description'] = defresDescr
     result['buildingType'] = self.__uid
     result['showAlertIcon'] = False
     isCombatOrderBuilding = self.__uid in [FORTIFICATION_ALIASES.FORT_ARTILLERY_SHOP_BUILDING, FORTIFICATION_ALIASES.FORT_BOMBER_SHOP_BUILDING]
     result['descriptionLink'] = increment and isCombatOrderBuilding
     if self.__uid != FORTIFICATION_ALIASES.FORT_BASE_BUILDING:
         order = self.fortCtrl.getFort().getOrder(self._buildingDescr.typeRef.orderType)
         result['iconSource'] = order.icon
         result['iconLevel'] = order.level if not increment else order.level + 1
     if increment and self.__uid != FORTIFICATION_ALIASES.FORT_BASE_BUILDING:
         result['infoIconSource'] = RES_ICONS.MAPS_ICONS_LIBRARY_INFORMATIONICON
         result['infoIconToolTip'] = makeTooltip(TOOLTIPS.FORTIFICATION_DEFRESICONINFO_HEADER, TOOLTIPS.FORTIFICATION_DEFRESICONINFO_BODY)
     return result
 def __prepareOrderInfo(self, increment=False, orderCount=0, orderLevel=1):
     result = {}
     if self.intBuildingID == FORT_BUILDING_TYPE.MILITARY_BASE:
         if increment:
             building_bonus = i18n.makeString(
                 FORTIFICATIONS.BUILDINGPOPOVER_HEADER_LEVELSLBL,
                 buildLevel=fort_formatters.getTextLevel(
                     min(self.__baseBuildingLevel + 1,
                         MAX_FORTIFICATION_LEVEL)))
             defresDescr = ''.join(
                 (text_styles.neutral(building_bonus + ' '),
                  text_styles.main(
                      i18n.makeString(
                          FORTIFICATIONS.
                          BUILDINGS_MODERNIZATIONDESCR_BASE_BUILDING))))
         else:
             building_bonus = i18n.makeString(
                 FORTIFICATIONS.BUILDINGPOPOVER_HEADER_LEVELSLBL,
                 buildLevel=fort_formatters.getTextLevel(
                     self.__baseBuildingLevel))
             defresDescr = ''.join(
                 (text_styles.standard(building_bonus + ' '),
                  text_styles.standard(
                      i18n.makeString(
                          FORTIFICATIONS.
                          BUILDINGS_MODERNIZATIONDESCR_BASE_BUILDING))))
     else:
         orderTypeID = self.fortCtrl.getFort().getBuildingOrder(
             self.intBuildingID)
         _, _, foundedLevel, orderData = self.fortCtrl.getFort(
         ).getOrderData(orderTypeID)
         if increment:
             bodyStyle = text_styles.main
             bonusStyle = text_styles.neutral
             foundedLevel += 1
             _, _, _, orderData = self.fortCtrl.getFort().getOrderData(
                 orderTypeID, foundedLevel)
             textPadding = '     '
         else:
             bodyStyle = text_styles.standard
             bonusStyle = text_styles.standard
             textPadding = ''
         if orderTypeID == FORT_ORDER_TYPE.SPECIAL_MISSION:
             awardText = textPadding + i18n.makeString(
                 FORTIFICATIONS.ORDERS_SPECIALMISSION_POSSIBLEAWARD) + ' '
             bonusDescr = i18n.makeString(
                 FORTIFICATIONS.
                 orders_specialmission_possibleaward_description_level(
                     foundedLevel))
             defresDescr = ''.join(
                 (bonusStyle(awardText), bodyStyle(bonusDescr)))
         elif orderTypeID in FORT_ORDER_TYPE.CONSUMABLES:
             battleOrder = FortOrder(orderTypeID, level=orderLevel)
             defresDescr = fort_formatters.getBonusText(
                 textPadding,
                 self.__uid,
                 ctx=dict(battleOrder.getParams()),
                 textsStyle=(bonusStyle, bodyStyle))
         else:
             colorStyle = (bonusStyle, bodyStyle)
             bonus = str(abs(orderData.effectValue))
             defresDescr = fort_formatters.getBonusText(
                 '%s+%s%%' % (textPadding, bonus), self.__uid, colorStyle)
     result['ordersCount'] = orderCount
     result['description'] = defresDescr
     result['buildingType'] = self.__uid
     result['showAlertIcon'] = False
     isCombatOrderBuilding = self.__uid in [
         FORTIFICATION_ALIASES.FORT_ARTILLERY_SHOP_BUILDING,
         FORTIFICATION_ALIASES.FORT_BOMBER_SHOP_BUILDING
     ]
     result['descriptionLink'] = increment and isCombatOrderBuilding
     if self.__uid != FORTIFICATION_ALIASES.FORT_BASE_BUILDING:
         order = self.fortCtrl.getFort().getOrder(
             self._buildingDescr.typeRef.orderType)
         result['iconSource'] = order.icon
         result[
             'iconLevel'] = order.level if not increment else order.level + 1
     if increment and self.__uid != FORTIFICATION_ALIASES.FORT_BASE_BUILDING:
         result[
             'infoIconSource'] = RES_ICONS.MAPS_ICONS_LIBRARY_INFORMATIONICON
         result['infoIconToolTip'] = makeTooltip(
             TOOLTIPS.FORTIFICATION_DEFRESICONINFO_HEADER,
             TOOLTIPS.FORTIFICATION_DEFRESICONINFO_BODY)
     return result