当前位置: 首页>>代码示例>>Python>>正文


Python PLocalizer.getItemAttributeDescription方法代码示例

本文整理汇总了Python中pirates.piratesbase.PLocalizer.getItemAttributeDescription方法的典型用法代码示例。如果您正苦于以下问题:Python PLocalizer.getItemAttributeDescription方法的具体用法?Python PLocalizer.getItemAttributeDescription怎么用?Python PLocalizer.getItemAttributeDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pirates.piratesbase.PLocalizer的用法示例。


在下文中一共展示了PLocalizer.getItemAttributeDescription方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: createHelpbox

# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import getItemAttributeDescription [as 别名]

#.........这里部分代码省略.........
             specialAttackNameLabel = DirectLabel(parent = self, relief = None, image = border, image_scale = 0.10000000000000001, geom = attackIcon, geom_scale = 0.10000000000000001, image_pos = (-0.070000000000000007, 0.0, -0.050000000000000003), geom_pos = (-0.070000000000000007, 0.0, -0.050000000000000003), text = PLocalizer.getInventoryTypeName(specialAttack), text_scale = PiratesGuiGlobals.TextScaleLarge, text_wordwrap = halfWidth * 2.0 * (0.90000000000000002 / titleScale), text_align = TextNode.ALeft, text_fg = titleColor, text_font = PiratesGlobals.getInterfaceOutlineFont(), text_shadow = PiratesGuiGlobals.TextShadow, pos = (-halfWidth + 0.12 + textScale * 0.5, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
             specialAttackRankLabel = DirectLabel(parent = self, relief = None, text = PLocalizer.ItemRank % ItemGlobals.getSpecialAttackRank(itemId), text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (0.90000000000000002 / titleScale), text_align = TextNode.ARight, pos = (halfWidth - textScale * 0.5, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
             specialAttackType = WeaponGlobals.getSkillTrack(specialAttack)
             if specialAttackType == WeaponGlobals.BREAK_ATTACK_SKILL_INDEX:
                 specialAttackTypeText = PLocalizer.BreakAttackSkill
             elif specialAttackType == WeaponGlobals.DEFENSE_SKILL_INDEX:
                 specialAttackTypeText = PLocalizer.DefenseSkill
             else:
                 specialAttackTypeText = PLocalizer.WeaponSkill
             specialAttackTypeLabel = DirectLabel(parent = self, relief = None, text = specialAttackTypeText, text_scale = 0.033500000000000002, text_wordwrap = halfWidth * 2.7999999999999998 * (0.90000000000000002 / titleScale), text_align = TextNode.ALeft, pos = (-halfWidth + 0.12 + textScale * 0.5, 0.0, runningVertPosition - PiratesGuiGlobals.TextScaleLarge), text_pos = (0.0, -textScale))
             specialAttackInfo = PLocalizer.SkillDescriptions.get(specialAttack)
             specialAttackDescriptionText = specialAttackInfo[1]
             specialAttackDescriptionLabel = DirectLabel(parent = self, relief = None, text = specialAttackDescriptionText, text_scale = textScale, text_wordwrap = halfWidth * 2.7999999999999998 * (0.90000000000000002 / titleScale), text_align = TextNode.ALeft, pos = (-halfWidth + 0.12 + textScale * 0.5, 0.0, runningVertPosition - specialAttackNameLabel.getHeight() + specialAttackTypeLabel.getHeight() - 0.059999999999999998), text_pos = (0.0, -textScale))
             saHeight = specialAttackNameLabel.getHeight() + specialAttackTypeLabel.getHeight() + specialAttackDescriptionLabel.getHeight() - 0.040000000000000001
             runningVertPosition -= saHeight
             runningSize += saHeight
             labels.append(specialAttackNameLabel)
             labels.append(specialAttackRankLabel)
             labels.append(specialAttackTypeLabel)
             labels.append(specialAttackDescriptionLabel)
         
         attributes = ItemGlobals.getAttributes(itemId)
         for i in range(0, len(attributes)):
             attributeIcon = self.SkillIcons.find('**/%s' % ItemGlobals.getAttributeIcon(attributes[i][0]))
             if not attributeIcon:
                 attributeIcon = self.BuffIcons.find('**/%s' % ItemGlobals.getAttributeIcon(attributes[i][0]))
             
             attributeNameLabel = DirectLabel(parent = self, relief = None, image = border, image_scale = 0.050000000000000003, geom = attributeIcon, geom_scale = 0.050000000000000003, image_pos = (-0.070000000000000007, 0.0, -0.029999999999999999), geom_pos = (-0.070000000000000007, 0.0, -0.029999999999999999), text = PLocalizer.getItemAttributeName(attributes[i][0]), text_scale = PiratesGuiGlobals.TextScaleLarge, text_wordwrap = halfWidth * 2.0 * (0.90000000000000002 / titleScale), text_align = TextNode.ALeft, text_fg = titleColor, text_font = PiratesGlobals.getInterfaceOutlineFont(), text_shadow = PiratesGuiGlobals.TextShadow, pos = (-halfWidth + 0.12 + textScale * 0.5, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
             attributeRankLabel = DirectLabel(parent = self, relief = None, text = PLocalizer.ItemRank % attributes[i][1], text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (0.90000000000000002 / titleScale), text_align = TextNode.ARight, pos = (halfWidth - textScale * 0.5, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
             if attributeNameLabel.getHeight() > 0.074999999999999997:
                 attributeNameSpace = 0.080000000000000002
             else:
                 attributeNameSpace = PiratesGuiGlobals.TextScaleLarge
             attributeDescriptionLabel = DirectLabel(parent = self, relief = None, text = PLocalizer.getItemAttributeDescription(attributes[i][0]), text_scale = textScale, text_wordwrap = halfWidth * 2.7999999999999998 * (0.90000000000000002 / titleScale), text_align = TextNode.ALeft, pos = (-halfWidth + 0.12 + textScale * 0.5, 0.0, runningVertPosition - attributeNameSpace), text_pos = (0.0, -textScale))
             aHeight = attributeNameLabel.getHeight() + attributeDescriptionLabel.getHeight()
             runningVertPosition -= aHeight + splitHeight
             runningSize += aHeight + splitHeight
             labels.append(attributeNameLabel)
             labels.append(attributeRankLabel)
             labels.append(attributeDescriptionLabel)
         
         skillBoosts = ItemGlobals.getSkillBoosts(itemId)
         for i in range(0, len(skillBoosts)):
             boostIcon = self.SkillIcons.find('**/%s' % WeaponGlobals.getSkillIcon(skillBoosts[i][0]))
             boostNameLabel = DirectLabel(parent = self, relief = None, image = border, image_scale = 0.050000000000000003, geom = boostIcon, geom_scale = 0.050000000000000003, image_pos = (-0.070000000000000007, 0.0, -0.029999999999999999), geom_pos = (-0.070000000000000007, 0.0, -0.029999999999999999), text = PLocalizer.ItemBoost % PLocalizer.getInventoryTypeName(skillBoosts[i][0]), text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (0.90000000000000002 / titleScale), text_align = TextNode.ALeft, pos = (-halfWidth + 0.12 + textScale * 0.5, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
             boostRankLabel = DirectLabel(parent = self, relief = None, text = '+%s' % str(skillBoosts[i][1]), text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (0.90000000000000002 / titleScale), text_align = TextNode.ARight, pos = (halfWidth - textScale * 0.5, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
             bHeight = boostNameLabel.getHeight()
             runningVertPosition -= bHeight + splitHeight
             runningSize += bHeight + splitHeight
             labels.append(boostNameLabel)
             labels.append(boostRankLabel)
         
         description = PLocalizer.getItemFlavorText(itemId)
         if description != '':
             descriptionLabel = DirectLabel(parent = self, relief = None, text = description, text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (0.94999999999999996 / textScale), text_align = TextNode.ALeft, pos = (-halfWidth + textScale * 0.5, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
             dHeight = descriptionLabel.getHeight() + 0.02
             runningVertPosition -= dHeight
             runningSize += dHeight
             labels.append(descriptionLabel)
         
         inv = localAvatar.getInventory()
         weaponLevel = 0
         weaponRepId = WeaponGlobals.getRepId(itemId)
         weaponRep = inv.getReputation(weaponRepId)
         weaponReq = ItemGlobals.getWeaponRequirement(itemId)
         weaponText = None
开发者ID:TTGhost,项目名称:POTCOR-src,代码行数:70,代码来源:InventoryItemGui.py

示例2: showDetails

# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import getItemAttributeDescription [as 别名]

#.........这里部分代码省略.........
            specialAttackNameLabel = DirectLabel(parent = self, relief = None, image = border, image_scale = 0.10000000000000001, geom = attackIcon, geom_scale = 0.10000000000000001, image_pos = (-0.070000000000000007, 0.0, -0.050000000000000003), geom_pos = (-0.070000000000000007, 0.0, -0.050000000000000003), text = PLocalizer.getInventoryTypeName(specialAttack), text_scale = PiratesGuiGlobals.TextScaleLarge, text_wordwrap = halfWidth * 2.0 * (0.90000000000000002 / titleScale), text_align = TextNode.ALeft, text_fg = titleColor, text_font = PiratesGlobals.getInterfaceOutlineFont(), pos = (-halfWidth + 0.12 + textScale * 0.5, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
            specialAttackRankLabel = DirectLabel(parent = self, relief = None, text = PLocalizer.ItemRank % ItemGlobals.getSpecialAttackRank(itemId), text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (0.90000000000000002 / titleScale), text_align = TextNode.ARight, pos = (halfWidth - textScale * 0.5, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
            specialAttackType = WeaponGlobals.getSkillTrack(specialAttack)
            if specialAttackType == WeaponGlobals.BREAK_ATTACK_SKILL_INDEX:
                specialAttackTypeText = PLocalizer.BreakAttackSkill
            elif specialAttackType == WeaponGlobals.DEFENSE_SKILL_INDEX:
                specialAttackTypeText = PLocalizer.DefenseSkill
            else:
                specialAttackTypeText = PLocalizer.WeaponSkill
            specialAttackTypeLabel = DirectLabel(parent = self, relief = None, text = specialAttackTypeText, text_scale = PiratesGuiGlobals.TextScaleLarge, text_wordwrap = halfWidth * 2.7999999999999998 * (0.90000000000000002 / titleScale), text_align = TextNode.ALeft, pos = (-halfWidth + 0.12 + textScale * 0.5, 0.0, runningVertPosition - PiratesGuiGlobals.TextScaleLarge), text_pos = (0.0, -textScale))
            specialAttackInfo = PLocalizer.SkillDescriptions.get(specialAttack)
            specialAttackDescriptionText = specialAttackInfo[1]
            specialAttackDescriptionLabel = DirectLabel(parent = self, relief = None, text = specialAttackDescriptionText, text_scale = textScale, text_wordwrap = halfWidth * 2.7999999999999998 * (0.90000000000000002 / titleScale), text_align = TextNode.ALeft, pos = (-halfWidth + 0.12 + textScale * 0.5, 0.0, runningVertPosition - specialAttackNameLabel.getHeight() + specialAttackTypeLabel.getHeight() - 0.059999999999999998), text_pos = (0.0, -textScale))
            saHeight = specialAttackNameLabel.getHeight() + specialAttackTypeLabel.getHeight() + specialAttackDescriptionLabel.getHeight() - 0.040000000000000001
            runningVertPosition -= saHeight
            runningSize += saHeight
            labels.append(specialAttackNameLabel)
            labels.append(specialAttackRankLabel)
            labels.append(specialAttackTypeLabel)
            labels.append(specialAttackDescriptionLabel)

        attributes = ItemGlobals.getAttributes(itemId)
        for i in range(0, len(attributes)):
            attributeIcon = self.SkillIcons.find('**/%s' % ItemGlobals.getAttributeIcon(attributes[i][0]))
            if not attributeIcon:
                attributeIcon = self.BuffIcons.find('**/%s' % ItemGlobals.getAttributeIcon(attributes[i][0]))

            attributeNameLabel = DirectLabel(parent = self, relief = None, image = border, image_scale = 0.050000000000000003, geom = attributeIcon, geom_scale = 0.050000000000000003, image_pos = (-0.070000000000000007, 0.0, -0.029999999999999999), geom_pos = (-0.070000000000000007, 0.0, -0.029999999999999999), text = PLocalizer.getItemAttributeName(attributes[i][0]), text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (0.90000000000000002 / titleScale), text_align = TextNode.ALeft, text_fg = titleColor, text_font = PiratesGlobals.getInterfaceOutlineFont(), pos = (-halfWidth + 0.12 + textScale * 0.5, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
            attributeRankLabel = DirectLabel(parent = self, relief = None, text = PLocalizer.ItemRank % attributes[i][1], text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (0.90000000000000002 / titleScale), text_align = TextNode.ARight, pos = (halfWidth - textScale * 0.5, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
            if attributeNameLabel.getHeight() > 0.074999999999999997:
                attributeNameSpace = 0.080000000000000002
            else:
                attributeNameSpace = PiratesGuiGlobals.TextScaleLarge
            attributeDescriptionLabel = DirectLabel(parent = self, relief = None, text = PLocalizer.getItemAttributeDescription(attributes[i][0]), text_scale = textScale, text_wordwrap = halfWidth * 2.7999999999999998 * (0.90000000000000002 / titleScale), text_align = TextNode.ALeft, pos = (-halfWidth + 0.12 + textScale * 0.5, 0.0, runningVertPosition - attributeNameSpace), text_pos = (0.0, -textScale))
            aHeight = attributeNameLabel.getHeight() + attributeDescriptionLabel.getHeight()
            runningVertPosition -= aHeight + splitHeight
            runningSize += aHeight + splitHeight
            labels.append(attributeNameLabel)
            labels.append(attributeRankLabel)
            labels.append(attributeDescriptionLabel)

        skillBoosts = ItemGlobals.getSkillBoosts(itemId)
        for i in range(0, len(skillBoosts)):
            boostIcon = self.SkillIcons.find('**/%s' % WeaponGlobals.getSkillIcon(skillBoosts[i][0]))
            boostNameLabel = DirectLabel(parent = self, relief = None, image = border, image_scale = 0.050000000000000003, geom = boostIcon, geom_scale = 0.050000000000000003, image_pos = (-0.070000000000000007, 0.0, -0.029999999999999999), geom_pos = (-0.070000000000000007, 0.0, -0.029999999999999999), text = PLocalizer.ItemBoost % PLocalizer.getInventoryTypeName(skillBoosts[i][0]), text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (0.90000000000000002 / titleScale), text_align = TextNode.ALeft, pos = (-halfWidth + 0.12 + textScale * 0.5, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
            boostRankLabel = DirectLabel(parent = self, relief = None, text = '+%s' % str(skillBoosts[i][1]), text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (0.90000000000000002 / titleScale), text_align = TextNode.ARight, pos = (halfWidth - textScale * 0.5, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
            bHeight = boostNameLabel.getHeight()
            runningVertPosition -= bHeight + splitHeight
            runningSize += bHeight + splitHeight
            labels.append(boostNameLabel)
            labels.append(boostRankLabel)

        description = PLocalizer.getItemFlavorText(itemId)
        if description != '':
            descriptionLabel = DirectLabel(parent = self, relief = None, text = description, text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (0.94999999999999996 / textScale), text_align = TextNode.ALeft, pos = (-halfWidth + textScale * 0.5, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
            dHeight = descriptionLabel.getHeight() + 0.02
            runningVertPosition -= dHeight
            runningSize += dHeight
            labels.append(descriptionLabel)

        weaponLevel = 0
        weaponRepId = WeaponGlobals.getRepId(itemId)
        weaponRep = inv.getReputation(weaponRepId)
        weaponReq = ItemGlobals.getWeaponRequirement(itemId)
        weaponText = None
        if weaponReq:
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:70,代码来源:InventoryUICharmItem.py


注:本文中的pirates.piratesbase.PLocalizer.getItemAttributeDescription方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。