本文整理汇总了Python中pirates.inventory.ItemGlobals.getName方法的典型用法代码示例。如果您正苦于以下问题:Python ItemGlobals.getName方法的具体用法?Python ItemGlobals.getName怎么用?Python ItemGlobals.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pirates.inventory.ItemGlobals
的用法示例。
在下文中一共展示了ItemGlobals.getName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createGui
# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getName [as 别名]
def createGui(self):
itemId = self.data[0]
(item, quantity) = self.data
name = ItemGlobals.getName(item)
itemType = ItemGlobals.getType(item)
itemTypeName = name
repCategory = ItemGlobals.getItemRepId(itemId)
if quantity:
repValue = localAvatar.getInventory().getReputation(repCategory)
self.repMeter = ReputationMeter(repCategory, width = 0.66000000000000003)
self.repMeter.setPos(0.62, 0, 0.041000000000000002)
self.repMeter.update(repValue)
self.repMeter.reparentTo(self)
self.repMeter.flattenLight()
hotkeyLabel = ''
hotkeys = ()
desc = PLocalizer.WeaponDescriptions.get(itemId)
helpText = PLocalizer.InventoryTypeNames[repCategory]
self.weaponButton = CombatTray.WeaponButton(hotkeys = hotkeys, hotkeyLabel = hotkeyLabel, helpOpaque = True, helpText = helpText, parent = self, showQuant = 0, pos = (0.10000000000000001, 0, -0.02), scale = 1.1000000000000001)
self.weaponButton.ignoreHotkeys()
self.weaponButton.setWeaponId(itemId)
self.weaponButton['extraArgs'] = [
itemId]
self.weaponButton.helpDelay = 0
self.weaponButton.helpPos = (0.12, 0, -0.040000000000000001)
self.desc = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = PLocalizer.WeaponAlreadyUnlocked, text_scale = PiratesGuiGlobals.TextScaleSmall, text_align = TextNode.ALeft, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, pos = (0.28999999999999998, 0, -0.0050000000000000001), text_font = PiratesGlobals.getInterfaceFont())
else:
self.repMeter = None
name = PLocalizer.makeHeadingString(PLocalizer.InventoryTypeNames[repCategory], 2)
self.categoryLabel = DirectLabel(parent = self, relief = None, text = name, text_scale = PiratesGuiGlobals.TextScaleLarge, text_align = TextNode.ALeft, text_shadow = PiratesGuiGlobals.TextShadow, pos = (0.28999999999999998, 0, 0.059999999999999998), textMayChange = 0)
self.weaponButton = CombatTray.WeaponButton(parent = self, state = DGG.DISABLED, showQuant = 0, scale = 1.1000000000000001)
self.weaponButton.setPos(0.10000000000000001, 0, -0.02)
self.weaponButton.setWeaponId(itemId)
self.weaponButton.helpDelay = 0
self.weaponButton.helpPos = (0.12, 0, -0.040000000000000001)
unlockDesc = PLocalizer.WeaponUnlockText[repCategory]
self.desc = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = unlockDesc, text_scale = PiratesGuiGlobals.TextScaleSmall, text_align = TextNode.ALeft, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, pos = (0.28999999999999998, 0, 0.025000000000000001), text_font = PiratesGlobals.getInterfaceFont())
self.setColorScale(0.40000000000000002, 0.40000000000000002, 0.40000000000000002, 1, 1)