本文整理汇总了Python中pirates.piratesbase.PLocalizer.getInventoryTypeName方法的典型用法代码示例。如果您正苦于以下问题:Python PLocalizer.getInventoryTypeName方法的具体用法?Python PLocalizer.getInventoryTypeName怎么用?Python PLocalizer.getInventoryTypeName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pirates.piratesbase.PLocalizer
的用法示例。
在下文中一共展示了PLocalizer.getInventoryTypeName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: checkSkillReq
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import getInventoryTypeName [as 别名]
def checkSkillReq(self, skillId):
if skillId in range(InventoryType.begin_FishingLures, InventoryType.end_FishingLures):
return None
if skillId:
if base.localAvatar.getSkillQuantity(skillId) < 2:
skillName = PLocalizer.getInventoryTypeName(skillId)
self.highlightRed(PLocalizer.SkillRequirement % skillName)
示例2: checkSkillReq
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import getInventoryTypeName [as 别名]
def checkSkillReq(self, skillId):
if skillId:
if base.localAvatar.getSkillQuantity(skillId) < 2:
skillName = PLocalizer.getInventoryTypeName(skillId)
self.highlightRed(PLocalizer.SkillRequirement % skillName)
示例3: createHelpbox
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import getInventoryTypeName [as 别名]
#.........这里部分代码省略.........
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)
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
示例4: showDetails
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import getInventoryTypeName [as 别名]
def showDetails(self, cell, detailsPos, detailsHeight, event = None):
self.notify.debug('Item showDetails')
if self.manager.heldItem and self.manager.locked and cell.isEmpty() and self.isEmpty() or not (self.itemTuple):
self.notify.debug(' early exit')
return None
inv = localAvatar.getInventory()
if not inv:
return None
itemId = self.getId()
self.helpFrame = DirectFrame(parent = self.manager, relief = None, state = DGG.DISABLED, sortOrder = 1)
self.helpFrame.setBin('gui-popup', -5)
detailGui = loader.loadModel('models/gui/gui_card_detail')
topGui = loader.loadModel('models/gui/toplevel_gui')
coinImage = topGui.find('**/treasure_w_coin*')
self.SkillIcons = loader.loadModel('models/textureCards/skillIcons')
self.BuffIcons = loader.loadModel('models/textureCards/buff_icons')
border = self.SkillIcons.find('**/base')
halfWidth = 0.29999999999999999
halfHeight = 0.20000000000000001
basePosX = cell.getX(aspect2d)
basePosZ = cell.getZ(aspect2d)
cellSizeX = 0.0
cellSizeZ = 0.0
if cell:
cellSizeX = cell.cellSizeX
cellSizeZ = cell.cellSizeZ
textScale = PiratesGuiGlobals.TextScaleMed
titleScale = PiratesGuiGlobals.TextScaleTitleSmall
if len(self.getName()) >= 30:
titleNameScale = PiratesGuiGlobals.TextScaleLarge
else:
titleNameScale = PiratesGuiGlobals.TextScaleExtraLarge
subtitleScale = PiratesGuiGlobals.TextScaleMed
iconScalar = 1.5
borderScaler = 0.25
splitHeight = 0.01
vMargin = 0.029999999999999999
runningVertPosition = 0.29999999999999999
runningSize = 0.0
labels = []
titleColor = PiratesGuiGlobals.TextFG6
rarity = ItemGlobals.getRarity(itemId)
rarityText = PLocalizer.getItemRarityName(rarity)
subtypeText = PLocalizer.getItemSubtypeName(ItemGlobals.getSubtype(itemId))
if rarity == ItemGlobals.CRUDE:
titleColor = PiratesGuiGlobals.TextFG24
elif rarity == ItemGlobals.COMMON:
titleColor = PiratesGuiGlobals.TextFG13
elif rarity == ItemGlobals.RARE:
titleColor = PiratesGuiGlobals.TextFG4
elif rarity == ItemGlobals.FAMED:
titleColor = PiratesGuiGlobals.TextFG5
titleLabel = DirectLabel(parent = self, relief = None, text = self.getName(), text_scale = titleNameScale, text_fg = titleColor, text_shadow = PiratesGuiGlobals.TextShadow, text_align = TextNode.ACenter, pos = (0.0, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
self.bg.setColor(titleColor)
tHeight = 0.070000000000000007
titleLabel.setZ(runningVertPosition)
runningVertPosition -= tHeight
runningSize += tHeight
labels.append(titleLabel)
subtitleLabel = DirectLabel(parent = self, relief = None, text = 'slant%s %s' % (rarityText, subtypeText), text_scale = subtitleScale, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_align = TextNode.ACenter, pos = (0.0, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
subtHeight = 0.050000000000000003
subtitleLabel.setZ(subtHeight * 0.5 + runningVertPosition)
runningVertPosition -= subtHeight
runningSize += subtHeight
labels.append(subtitleLabel)
itemType = ItemGlobals.getType(itemId)
itemSubtype = ItemGlobals.getSubtype(itemId)
model = ItemGlobals.getModel(itemId)
if model:
self.realItem = loader.loadModel('models/inventory/' + model)
if self.realItem:
posHpr = ItemGlobals.getModelPosHpr(model)
if posHpr:
self.realItem.setPos(posHpr[0], posHpr[1], posHpr[2])
self.realItem.setHpr(posHpr[3], posHpr[4], posHpr[5])
elif itemSubtype == ItemGlobals.RAM:
self.realItem.setPos(-1.5, 1.5, -0.59999999999999998)
self.realItem.setHpr(70, 160, -90)
else:
self.realItem.setPos(0.0, 1.5, -0.059999999999999998)
self.realItem.setHpr(0, 90, 0)
self.realItem.reparentTo(self.portraitSceneGraph)
iHeight = 0.17999999999999999
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)
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(), pos = (-halfWidth + 0.12 + textScale * 0.5, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
#.........这里部分代码省略.........