本文整理汇总了Python中pirates.piratesbase.PLocalizer.getItemTypeName方法的典型用法代码示例。如果您正苦于以下问题:Python PLocalizer.getItemTypeName方法的具体用法?Python PLocalizer.getItemTypeName怎么用?Python PLocalizer.getItemTypeName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pirates.piratesbase.PLocalizer
的用法示例。
在下文中一共展示了PLocalizer.getItemTypeName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createHelpbox
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import getItemTypeName [as 别名]
#.........这里部分代码省略.........
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
trainingToken = EconomyGlobals.getItemTrainingReq(itemId)
trainingAmt = inv.getItemQuantity(trainingToken)
if weaponReq:
weaponLevel = ReputationGlobals.getLevelFromTotalReputation(weaponRepId, weaponRep)[0]
if weaponLevel < weaponReq:
weaponColor = PiratesGuiGlobals.TextFG6
else:
weaponColor = (0.40000000000000002, 0.40000000000000002, 0.40000000000000002, 1.0)
weaponText = PLocalizer.ItemLevelRequirement % (weaponReq, PLocalizer.getItemTypeName(itemType))
elif trainingAmt == 0:
weaponColor = PiratesGuiGlobals.TextFG6
weaponText = PLocalizer.ItemTrainingRequirement % PLocalizer.getItemTypeName(itemType)
if trainingAmt == 0:
if itemType == ItemGlobals.GUN:
base.localAvatar.sendRequestContext(InventoryType.GunTrainingRequired)
elif itemType == ItemGlobals.DOLL:
base.localAvatar.sendRequestContext(InventoryType.DollTrainingRequired)
elif itemType == ItemGlobals.DAGGER:
base.localAvatar.sendRequestContext(InventoryType.DaggerTrainingRequired)
elif itemType == ItemGlobals.STAFF:
base.localAvatar.sendRequestContext(InventoryType.StaffTrainingRequired)
if weaponText:
weaponReqLabel = DirectLabel(parent = self, relief = None, text = weaponText, text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (1.5 / titleScale), text_fg = weaponColor, text_shadow = PiratesGuiGlobals.TextShadow, text_align = TextNode.ACenter, pos = (0.0, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
wHeight = weaponReqLabel.getHeight()
runningVertPosition -= wHeight
runningSize += wHeight
labels.append(weaponReqLabel)
if not Freebooter.getPaidStatus(localAvatar.getDoId()):
if rarity != ItemGlobals.CRUDE:
unlimitedLabel = DirectLabel(parent = self, relief = None, text = PLocalizer.UnlimitedAccessRequirement, text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (1.5 / titleScale), text_fg = PiratesGuiGlobals.TextFG6, text_shadow = PiratesGuiGlobals.TextShadow, text_align = TextNode.ACenter, pos = (0.0, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
uHeight = unlimitedLabel.getHeight()
runningVertPosition -= uHeight
runningSize += uHeight
labels.append(unlimitedLabel)
runningVertPosition -= 0.02
示例2: showDetails
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import getItemTypeName [as 别名]
#.........这里部分代码省略.........
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:
weaponLevel = ReputationGlobals.getLevelFromTotalReputation(weaponRepId, weaponRep)[0]
if weaponLevel < weaponReq:
weaponColor = PiratesGuiGlobals.TextFG6
else:
weaponColor = (0.40000000000000002, 0.40000000000000002, 0.40000000000000002, 1.0)
weaponText = PLocalizer.ItemLevelRequirement % (weaponReq, PLocalizer.getItemTypeName(itemType))
else:
trainingToken = EconomyGlobals.getItemTrainingReq(itemId)
trainingAmt = inv.getItemQuantity(trainingToken)
if trainingAmt == 0:
weaponColor = PiratesGuiGlobals.TextFG6
weaponText = PLocalizer.ItemTrainingRequirement % PLocalizer.getItemTypeName(itemType)
if weaponText:
weaponReqLabel = DirectLabel(parent = self, relief = None, text = weaponText, text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (1.5 / titleScale), text_fg = weaponColor, text_shadow = PiratesGuiGlobals.TextShadow, text_align = TextNode.ACenter, pos = (0.0, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
wHeight = weaponReqLabel.getHeight()
runningVertPosition -= wHeight
runningSize += wHeight
labels.append(weaponReqLabel)
if not Freebooter.getPaidStatus(localAvatar.getDoId()):
if rarity != ItemGlobals.CRUDE:
unlimitedLabel = DirectLabel(parent = self, relief = None, text = PLocalizer.UnlimitedAccessRequirement, text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (1.5 / titleScale), text_fg = PiratesGuiGlobals.TextFG6, text_shadow = PiratesGuiGlobals.TextShadow, text_align = TextNode.ACenter, pos = (0.0, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
uHeight = unlimitedLabel.getHeight()
runningVertPosition -= uHeight
runningSize += uHeight
labels.append(unlimitedLabel)
runningVertPosition -= 0.02
runningSize += 0.02
panels = self.helpFrame.attachNewNode('panels')
topPanel = panels.attachNewNode('middlePanel')
detailGui.find('**/top_panel').copyTo(topPanel)
topPanel.setScale(0.080000000000000002)
topPanel.reparentTo(self.helpFrame)
middlePanel = panels.attachNewNode('middlePanel')
detailGui.find('**/middle_panel').copyTo(middlePanel)