本文整理汇总了Python中pirates.economy.EconomyGlobals.getItemTrainingReq方法的典型用法代码示例。如果您正苦于以下问题:Python EconomyGlobals.getItemTrainingReq方法的具体用法?Python EconomyGlobals.getItemTrainingReq怎么用?Python EconomyGlobals.getItemTrainingReq使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pirates.economy.EconomyGlobals
的用法示例。
在下文中一共展示了EconomyGlobals.getItemTrainingReq方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createGui
# 需要导入模块: from pirates.economy import EconomyGlobals [as 别名]
# 或者: from pirates.economy.EconomyGlobals import getItemTrainingReq [as 别名]
def createGui(self):
itemId = self.data[0]
self.nameTag = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = self.name, text_scale = PiratesGuiGlobals.TextScaleSmall * PLocalizer.getHeadingScale(2), text_align = TextNode.ALeft, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, pos = (0.16, 0, 0.105), text_font = PiratesGlobals.getInterfaceFont())
if itemId in range(InventoryType.begin_PistolPouches, InventoryType.end_PistolPouches):
self.itemTypeFormatted = PLocalizer.makeHeadingString(PLocalizer.InventoryItemClassNames.get(ItemType.PISTOL), 1)
elif itemId in range(InventoryType.begin_DaggerPouches, InventoryType.end_DaggerPouches):
self.itemTypeFormatted = PLocalizer.makeHeadingString(PLocalizer.InventoryItemClassNames.get(ItemType.DAGGER), 1)
elif itemId in range(InventoryType.begin_GrenadePouches, InventoryType.end_GrenadePouches):
self.itemTypeFormatted = PLocalizer.makeHeadingString(PLocalizer.GrenadeShort, 1)
elif itemId in range(InventoryType.begin_CannonPouches, InventoryType.end_CannonPouches):
self.itemTypeFormatted = PLocalizer.makeHeadingString(PLocalizer.ShipCannonShort, 1)
else:
self.itemTypeFormatted = PLocalizer.makeHeadingString(self.itemType, 1)
self.itemTypeName = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = self.itemTypeFormatted, text_scale = PiratesGuiGlobals.TextScaleSmall, text_align = TextNode.ALeft, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_font = PiratesGlobals.getInterfaceFont(), pos = (0.16, 0, 0.065000000000000002))
self.miscText = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = '', text_scale = PiratesGuiGlobals.TextScaleSmall, text_align = TextNode.ALeft, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 11, pos = (0.16, 0, 0.025000000000000001))
if self.minLvl > 0:
repId = WeaponGlobals.getRepId(itemId)
if repId:
self.checkLevel(repId, self.minLvl)
self.checkFreebooter(itemId, base.localAvatar.getDoId())
trainingReq = EconomyGlobals.getItemTrainingReq(itemId)
if trainingReq:
self.checkTrainingReq(trainingReq)
if EconomyGlobals.getItemCategory(itemId) == ItemType.AMMO:
skillId = WeaponGlobals.getSkillIdForAmmoSkillId(itemId)
self.checkSkillReq(skillId)
self.checkInfamyReq(itemId)
if self.buy:
self.checkPlayerInventory(itemId)
self.costText = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, image = InventoryListItem.coinImage, image_scale = 0.12, image_pos = Vec3(-0.01, 0, 0.01), text = str(self.price), text_scale = PiratesGuiGlobals.TextScaleSmall, text_align = TextNode.ARight, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 11, text_pos = (-0.029999999999999999, 0, 0), pos = (self.width - 0.035000000000000003, 0, 0.065000000000000002), text_font = PiratesGlobals.getInterfaceFont())
if self.quantity and self.quantity > 1:
self.quantityLabel = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = str(self.quantity), frameColor = (0, 0, 0, 1), frameSize = (-0.01, 0.02, -0.01, 0.025000000000000001), text_scale = 0.0275, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 11, pos = (0.02, 0, 0.025000000000000001), text_font = PiratesGlobals.getPirateBoldOutlineFont())
geomParams = InventoryItemGui.getGeomParams(itemId)
self.picture = DirectFrame(parent = self, relief = None, state = DGG.DISABLED, geom = geomParams['geom'], geom_pos = geomParams['geom_pos'], geom_scale = geomParams['geom_scale'], pos = (0.01, 0, 0.01))
self.flattenStrong()
示例2: getItemRequirements
# 需要导入模块: from pirates.economy import EconomyGlobals [as 别名]
# 或者: from pirates.economy.EconomyGlobals import getItemTrainingReq [as 别名]
def getItemRequirements(self, itemType, otherAdds = []):
if not itemType:
return None
results = { }
if game.process == 'client':
paidStatus = Freebooter.getPaidStatus(self.ownerId)
else:
paidStatus = Freebooter.getPaidStatusAI(self.ownerId)
rarity = ItemGlobals.getRarity(itemType)
if rarity != ItemConstants.CRUDE and not paidStatus:
results['paidStatus'] = (rarity != ItemConstants.CRUDE, False)
itemClass = ItemGlobals.getClass(itemType)
if itemClass == InventoryType.ItemTypeWeapon or itemClass == InventoryType.ItemTypeCharm:
itemRepId = ItemGlobals.getItemRepId(itemType)
itemRep = self.getReputation(itemRepId)
itemLevel = ReputationGlobals.getLevelFromTotalReputation(itemRepId, itemRep)[0]
weaponReq = ItemGlobals.getWeaponRequirement(itemType)
trainingToken = EconomyGlobals.getItemTrainingReq(itemType)
trainingAmt = self.getItemQuantity(trainingToken)
for currAdd in otherAdds:
otherAdd = InvItem(currAdd)
if otherAdd.getCat() == trainingToken and otherAdd.getCount() > 0:
trainingAmt += otherAdd.getCount()
continue
if not weaponReq == None:
pass
weaponLevelPass = itemLevel >= weaponReq
if not trainingToken == 0 and trainingToken == None:
pass
weaponTrainPass = trainingAmt > 0
if weaponLevelPass:
pass
results['itemLevel'] = (weaponReq, weaponTrainPass)
else:
results['itemLevel'] = (0, True)
return results
示例3: handleBuyItem
# 需要导入模块: from pirates.economy import EconomyGlobals [as 别名]
# 或者: from pirates.economy.EconomyGlobals import getItemTrainingReq [as 别名]
def handleBuyItem(self, data, useCode):
itemId = data[0]
if not itemId:
return None
itemType = EconomyGlobals.getItemType(itemId)
if itemType <= ItemType.WAND or itemType == ItemType.POTION:
data[1] = 1
else:
data[1] = EconomyGlobals.getItemQuantity(itemId)
inventory = base.localAvatar.getInventory()
if not inventory:
return None
itemQuantity = self.purchaseInventory.getItemQuantity(itemId)
currStock = inventory.getStackQuantity(itemId)
currStockLimit = inventory.getStackLimit(itemId)
if useCode == PiratesGuiGlobals.InventoryAdd:
itemTypeName = PLocalizer.InventoryItemClassNames.get(itemType)
trainingReq = EconomyGlobals.getItemTrainingReq(itemId)
if trainingReq:
amt = inventory.getStackQuantity(trainingReq)
if not amt:
base.localAvatar.guiMgr.createWarning(PLocalizer.NoTrainingWarning % itemTypeName, PiratesGuiGlobals.TextFG6)
return None
itemType = EconomyGlobals.getItemType(itemId)
if itemType != ItemType.POTION:
minLvl = ItemGlobals.getWeaponRequirement(itemId)
else:
minLvl = 0
repId = WeaponGlobals.getRepId(itemId)
repAmt = inventory.getAccumulator(repId)
if minLvl > ReputationGlobals.getLevelFromTotalReputation(repId, repAmt)[0]:
base.localAvatar.guiMgr.createWarning(PLocalizer.LevelReqWarning % (minLvl, itemTypeName), PiratesGuiGlobals.TextFG6)
return None
if itemId in ItemGlobals.getAllWeaponIds():
locatables = []
for dataInfo in self.purchaseInventory.inventory:
dataId = dataInfo[0]
if dataId in ItemGlobals.getAllWeaponIds():
locatables.append(InvItem([
InventoryType.ItemTypeWeapon,
dataId,
0]))
continue
locatables.append(InvItem([
InventoryType.ItemTypeWeapon,
itemId,
0]))
locationIds = inventory.canAddLocatables(locatables)
for locationId in locationIds:
if locationId in (Locations.INVALID_LOCATION, Locations.NON_LOCATION):
base.localAvatar.guiMgr.createWarning(PLocalizer.InventoryFullWarning, PiratesGuiGlobals.TextFG6)
return None
continue
elif itemId in ItemGlobals.getAllConsumableIds():
itemQuantity = self.purchaseInventory.getItemQuantity(itemId)
currStock = inventory.getItemQuantity(InventoryType.ItemTypeConsumable, itemId)
currStockLimit = inventory.getItemLimit(InventoryType.ItemTypeConsumable, itemId)
if currStock + itemQuantity >= currStockLimit:
base.localAvatar.guiMgr.createWarning(PLocalizer.TradeItemFullWarning, PiratesGuiGlobals.TextFG6)
return None
if currStock == 0:
locatables = []
dataIds = { }
for dataInfo in self.purchaseInventory.inventory:
dataId = dataInfo[0]
if dataId in ItemGlobals.getAllConsumableIds():
if dataIds.has_key(dataId):
dataIds[dataId] += 1
else:
dataIds[dataId] = 1
dataIds.has_key(dataId)
if dataIds.has_key(itemId):
dataIds[itemId] += 1
else:
dataIds[itemId] = 1
for dataId in dataIds:
locatables.append(InvItem([
InventoryType.ItemTypeConsumable,
dataId,
0,
dataIds[dataId]]))
locationIds = inventory.canAddLocatables(locatables)
for locationId in locationIds:
if locationId in (Locations.INVALID_LOCATION, Locations.NON_LOCATION):
base.localAvatar.guiMgr.createWarning(PLocalizer.InventoryFullWarning, PiratesGuiGlobals.TextFG6)
return None
continue
else:
#.........这里部分代码省略.........
示例4: createGui
# 需要导入模块: from pirates.economy import EconomyGlobals [as 别名]
# 或者: from pirates.economy.EconomyGlobals import getItemTrainingReq [as 别名]
def createGui(self):
itemId = self.data[0]
self.picture = DirectFrame(parent = self, relief = None, state = DGG.DISABLED, pos = (0.01, 0, 0.01))
self.nameTag = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = self.name, text_scale = PiratesGuiGlobals.TextScaleSmall * PLocalizer.getHeadingScale(2), text_align = TextNode.ALeft, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, pos = (0.050000000000000003, 0, 0.105), text_font = PiratesGlobals.getInterfaceFont())
itemTypeFormatted = ''
self.itemTypeName = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = itemTypeFormatted, text_scale = PiratesGuiGlobals.TextScaleSmall, text_align = TextNode.ALeft, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_font = PiratesGlobals.getInterfaceFont(), pos = (0.050000000000000003, 0, 0.065000000000000002))
self.miscText = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = '', text_scale = PiratesGuiGlobals.TextScaleSmall, text_align = TextNode.ALeft, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 11, pos = (0.050000000000000003, 0, 0.025000000000000001))
if self.minLvl > 0:
repId = WeaponGlobals.getRepId(itemId)
if repId:
self.checkLevel(repId, self.minLvl)
trainingReq = EconomyGlobals.getItemTrainingReq(itemId)
if trainingReq:
self.checkTrainingReq(trainingReq)
if EconomyGlobals.getItemCategory(itemId) == ItemType.AMMO:
skillId = WeaponGlobals.getSkillIdForAmmoSkillId(itemId)
self.checkSkillReq(skillId)
if self.buy:
self.checkPlayerInventory(itemId)
self.costText = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, image = SongListItem.coinImage, image_scale = 0.12, image_pos = Vec3(-0.01, 0, 0.01), text = str(self.price), text_scale = PiratesGuiGlobals.TextScaleSmall, text_align = TextNode.ARight, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 11, text_pos = (-0.029999999999999999, 0, 0), pos = (self.width - 0.035000000000000003, 0, 0.105), text_font = PiratesGlobals.getInterfaceFont())
if self.quantity and self.quantity > 1:
self.quantityLabel = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = str(self.quantity), frameColor = (0, 0, 0, 1), frameSize = (-0.01, 0.02, -0.01, 0.025000000000000001), text_scale = 0.0275, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 11, pos = (0.02, 0, 0.025000000000000001), text_font = PiratesGlobals.getPirateBoldOutlineFont())
itemClass = EconomyGlobals.getItemCategory(itemId)
if itemClass == ItemType.WEAPON or itemClass == ItemType.POUCH:
asset = EconomyGlobals.getItemIcons(itemId)
if asset:
self.picture['geom'] = SongItemGui.weaponIcons.find('**/%s*' % asset)
self.picture['geom_scale'] = 0.11
self.picture['geom_pos'] = (0.080000000000000002, 0, 0.068000000000000005)
elif itemClass == ItemType.CONSUMABLE:
asset = EconomyGlobals.getItemIcons(itemId)
if asset:
self.picture['geom'] = SongItemGui.skillIcons.find('**/%s*' % asset)
self.picture['geom_scale'] = 0.11
self.picture['geom_pos'] = (0.080000000000000002, 0, 0.068000000000000005)
if not InventoryType.begin_WeaponCannonAmmo <= itemId or itemId <= InventoryType.end_WeaponCannonAmmo:
if (InventoryType.begin_WeaponPistolAmmo <= itemId or itemId <= InventoryType.end_WeaponGrenadeAmmo or InventoryType.begin_WeaponDaggerAmmo <= itemId) and itemId <= InventoryType.end_WeaponDaggerAmmo:
skillId = WeaponGlobals.getSkillIdForAmmoSkillId(itemId)
if skillId:
asset = WeaponGlobals.getSkillIcon(skillId)
if asset:
self.picture['geom'] = SongListItem.skillIcons.find('**/%s' % asset)
self.picture['geom_scale'] = 0.14999999999999999
self.picture['geom_pos'] = (0.069000000000000006, 0, 0.069000000000000006)
elif InventoryType.SmallBottle <= itemId and itemId <= InventoryType.LargeBottle:
self.picture['geom'] = SongListItem.topGui.find('**/main_gui_ship_bottle')
self.picture['geom_scale'] = 0.10000000000000001
self.picture['geom_pos'] = (0.069000000000000006, 0, 0.069000000000000006)
self.flattenStrong()
示例5: createHelpbox
# 需要导入模块: from pirates.economy import EconomyGlobals [as 别名]
# 或者: from pirates.economy.EconomyGlobals import getItemTrainingReq [as 别名]
#.........这里部分代码省略.........
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
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:
示例6: showDetails
# 需要导入模块: from pirates.economy import EconomyGlobals [as 别名]
# 或者: from pirates.economy.EconomyGlobals import getItemTrainingReq [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)
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)
middlePanel.setScale(0.080000000000000002)
middlePanel.reparentTo(self.helpFrame)