def __prepareDefResInfo(self):
     result = {}
     icon = None
     level = None
     showAlertIcon = False
     alertIconTooltip = ''
     if self._isBaseBuilding:
         defResTitle = text_styles.middleTitle(i18n.makeString(FORT.BUILDINGPOPOVER_DEFRESINFO_BASEBUILDINGTITLE))
         defresDescr = text_styles.main(i18n.makeString(FORT.buildings_defresinfo(self._buildingUID)))
     else:
         order = self.fortCtrl.getFort().getOrder(self.__orderID)
         icon = order.icon
         level = order.level
         defResTitle = text_styles.middleTitle(i18n.makeString('#fortifications:General/orderType/%s' % self.getOrderUIDbyID(self.__orderID)))
         defresDescr = order.description
         showAlertIcon, alertIconTooltip = self._showOrderAlertIcon(order)
     result['showAlertIcon'] = showAlertIcon
     result['alertIconTooltip'] = alertIconTooltip
     result['title'] = defResTitle
     result['description'] = defresDescr
     result['iconSource'] = icon
     result['iconLevel'] = level
     if self.__orderID in constants.FORT_ORDER_TYPE.CONSUMABLES:
         result['orderID'] = self.__orderID
     return result
 def __prepareDefResInfo(self):
     result = {}
     icon = None
     level = None
     showAlertIcon = False
     alertIconTooltip = ''
     if self._isBaseBuilding:
         defResTitle = text_styles.middleTitle(
             i18n.makeString(
                 FORT.BUILDINGPOPOVER_DEFRESINFO_BASEBUILDINGTITLE))
         defresDescr = text_styles.main(
             i18n.makeString(FORT.buildings_defresinfo(self._buildingUID)))
     else:
         order = self.fortCtrl.getFort().getOrder(self.__orderID)
         icon = order.icon
         level = order.level
         defResTitle = text_styles.middleTitle(
             i18n.makeString('#fortifications:General/orderType/%s' %
                             self.getOrderUIDbyID(self.__orderID)))
         defresDescr = order.description
         showAlertIcon, alertIconTooltip = self._showOrderAlertIcon(order)
     result['showAlertIcon'] = showAlertIcon
     result['alertIconTooltip'] = alertIconTooltip
     result['title'] = defResTitle
     result['description'] = defresDescr
     result['iconSource'] = icon
     result['iconLevel'] = level
     if self.__orderID in constants.FORT_ORDER_TYPE.CONSUMABLES:
         result['orderID'] = self.__orderID
     return result
Esempio n. 3
0
def getBonusText(strValue, buildingID, textsStyle=None, ctx=None):
    ctx = ctx or {}
    textsStyle = textsStyle or (text_styles.neutral, text_styles.main)
    descrStr = i18n.makeString(FORTIFICATIONS.buildings_defresinfo(buildingID),
                               **ctx)
    return ''.join((textsStyle[0](strValue + ' ' if strValue else ''),
                    textsStyle[1](descrStr)))
Esempio n. 4
0
def getBonusText(strValue, buildingID, textsStyle = None, ctx = None):
    ctx = ctx or {}
    textsStyle = textsStyle or (text_styles.neutral, text_styles.main)
    descrStr = i18n.makeString(FORTIFICATIONS.buildings_defresinfo(buildingID), **ctx)
    return ''.join((textsStyle[0](strValue + ' ' if strValue else ''), textsStyle[1](descrStr)))
Esempio n. 5
0
def getBonusText(strValue, buildingID, textsStyle = None, ctx = None):
    ctx = ctx or {}
    textsStyle = textsStyle or (TEXT_MANAGER_STYLES.NEUTRAL_TEXT, TEXT_MANAGER_STYLES.MAIN_TEXT)
    descrStr = i18n.makeString(FORTIFICATIONS.buildings_defresinfo(buildingID), **ctx)
    resultDescr = TextManager.reference().concatStyles(((textsStyle[0], strValue + ' ' if strValue else ''), (textsStyle[1], descrStr)))
    return resultDescr
Esempio n. 6
0
 def __prepareDefResInfo(self):
     result = {}
     icon = None
     level = None
     showAlertIcon = False
     if self._isBaseBuilding:
         defResTitle = self.app.utilsManager.textManager.getText(TextType.MIDDLE_TITLE, i18n.makeString(FORT.BUILDINGPOPOVER_DEFRESINFO_BASEBUILDINGTITLE))
         defresDescr = self.app.utilsManager.textManager.getText(TextType.MAIN_TEXT, i18n.makeString(FORT.buildings_defresinfo(self._buildingUID)))
     else:
         order = self.fortCtrl.getFort().getOrder(self.__orderID)
         icon = order.icon
         level = order.level
         defResTitle = self.app.utilsManager.textManager.getText(TextType.MIDDLE_TITLE, i18n.makeString('#fortifications:General/orderType/%s' % self.getOrderUIDbyID(self.__orderID)))
         defresDescr = order.description
         showAlertIcon = self._showOrderAlertIcon(order)
     result['showAlertIcon'] = showAlertIcon
     result['title'] = defResTitle
     result['description'] = defresDescr
     result['iconSource'] = icon
     result['iconLevel'] = level
     return result