本文整理汇总了Python中pirates.piratesbase.PLocalizer.getItemRangeName方法的典型用法代码示例。如果您正苦于以下问题:Python PLocalizer.getItemRangeName方法的具体用法?Python PLocalizer.getItemRangeName怎么用?Python PLocalizer.getItemRangeName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pirates.piratesbase.PLocalizer
的用法示例。
在下文中一共展示了PLocalizer.getItemRangeName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createHelpbox
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import getItemRangeName [as 别名]
#.........这里部分代码省略.........
self.realItem.setHpr(0, 90, 180)
elif itemType == ItemGlobals.DAGGER:
self.realItem.setPos(-1.0, 2.0, -0.29999999999999999)
self.realItem.setHpr(90, 170, -90)
elif itemType == ItemGlobals.GRENADE:
self.realItem.setPos(0.0, 3.5, -0.20000000000000001)
self.realItem.setHpr(0, 0, 0)
elif itemType == ItemGlobals.STAFF:
self.realItem.setPos(-0.40000000000000002, 3.0, -0.29999999999999999)
self.realItem.setHpr(-90, 15, -90)
elif itemSubtype == ItemGlobals.RAM:
self.realItem.setPos(-1.5, 1.5, -0.59999999999999998)
self.realItem.setHpr(70, 160, -90)
elif itemType == ItemGlobals.POTION:
self.realItem.setPos(0.0, 2.5, -0.40000000000000002)
self.realItem.setHpr(45, 0, 0)
else:
self.realItem.setPos(0.0, 1.5, -0.059999999999999998)
self.realItem.setHpr(0, 90, 0)
self.realItem.reparentTo(self.portraitSceneGraph)
iHeight = 0.17499999999999999
self.createBuffer()
self.itemCard.setZ(runningVertPosition - 0.059999999999999998)
runningVertPosition -= iHeight
runningSize += iHeight
labels.append(self.itemCard)
goldLabel = DirectLabel(parent = self, relief = None, image = coinImage, image_scale = 0.12, image_pos = Vec3(0.025000000000000001, 0, -0.02), text = str(int(ItemGlobals.getGoldCost(itemId) * ItemGlobals.GOLD_SALE_MULTIPLIER)), text_scale = subtitleScale, text_align = TextNode.ARight, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, pos = (halfWidth - 0.050000000000000003, 0.0, runningVertPosition + 0.080000000000000002), text_pos = (0.0, -textScale))
labels.append(goldLabel)
infoText = PLocalizer.ItemAttackStrength % '\x01%s\x01%s\x02' % (itemColor, ItemGlobals.getPower(itemId))
if itemType == ItemGlobals.GUN:
infoText += ' %s' % PLocalizer.ItemBarrels % '\x01%s\x01%s\x02' % (itemColor, ItemGlobals.getBarrels(itemId))
infoText += ' %s' % PLocalizer.ItemRangeStrength % '\x01%s\x01%s\x02' % (itemColor, PLocalizer.getItemRangeName(WeaponGlobals.getRange(itemId)))
if itemType != ItemGlobals.POTION:
infoLabel = DirectLabel(parent = self, relief = None, text = infoText, text_scale = textScale, text_align = TextNode.ACenter, pos = (0.0, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
iHeight = 0.080000000000000002
runningVertPosition -= iHeight
runningSize += iHeight
labels.append(infoLabel)
specialAttack = None
if itemType != ItemGlobals.POTION:
specialAttack = ItemGlobals.getSpecialAttack(itemId)
if specialAttack:
attackIcon = self.SkillIcons.find('**/%s' % WeaponGlobals.getSkillIcon(specialAttack))
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)