当前位置: 首页>>代码示例>>Python>>正文


Python ItemGlobals.getIcon方法代码示例

本文整理汇总了Python中pirates.inventory.ItemGlobals.getIcon方法的典型用法代码示例。如果您正苦于以下问题:Python ItemGlobals.getIcon方法的具体用法?Python ItemGlobals.getIcon怎么用?Python ItemGlobals.getIcon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pirates.inventory.ItemGlobals的用法示例。


在下文中一共展示了ItemGlobals.getIcon方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getIcon [as 别名]
    def __init__(self, manager, itemTuple, imageScaleFactor = 1.0):
        InventoryUIItem.InventoryUIItem.__init__(self, manager, itemTuple, imageScaleFactor = imageScaleFactor)
        charmIcons = loader.loadModel('models/gui/gui_icons_inventory')
        itemType = ItemGlobals.getType(itemTuple[1])
        if ItemGlobals.getIcon(itemTuple[1]):
            self['image'] = charmIcons.find('**/%s' % ItemGlobals.getIcon(itemTuple[1]))

        self['image_scale'] = 0.10000000000000001 * imageScaleFactor
        self.helpFrame = None
        self.cm = CardMaker('itemCard')
        self.cm.setFrame(-0.29999999999999999, 0.29999999999999999, -0.089999999999999997, 0.089999999999999997)
        self.buffer = None
        self.lens = PerspectiveLens()
        self.lens.setNear(0.10000000000000001)
        self.lens.setAspectRatio(0.59999999999999998 / 0.17999999999999999)
        self.realItem = None
        self.itemCard = None
        self.portraitSceneGraph = NodePath('PortraitSceneGraph')
        detailGui = loader.loadModel('models/gui/gui_card_detail')
        self.bg = detailGui.find('**/color')
        self.bg.setScale(4)
        self.bg.setPos(0, 17, -6.2999999999999998)
        self.glow = detailGui.find('**/glow')
        self.glow.setScale(3)
        self.glow.setPos(0, 17, -6.2999999999999998)
        self.glow.setColor(1, 1, 1, 0.80000000000000004)
        self.setBin('gui-fixed', 1)
        self.accept('open_main_window', self.createBuffer)
        self.accept('aspectRatioChanged', self.createBuffer)
        self.accept('close_main_window', self.destroyBuffer)
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:32,代码来源:InventoryUICharmItem.py

示例2: getGeomParams

# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getIcon [as 别名]
 def getGeomParams(itemId):
     geomParams = { }
     itemType = EconomyGlobals.getItemType(itemId)
     if itemType <= ItemType.WAND or itemType == ItemType.POTION:
         if itemType == ItemType.POTION:
             geomParams['geom'] = InventoryItemGui.skillIcons.find('**/%s' % ItemGlobals.getIcon(itemId))
         else:
             itemType = ItemGlobals.getType(itemId)
             if ItemGlobals.getIcon(itemId):
                 geomParams['geom'] = InventoryItemGui.weaponIcons.find('**/%s' % ItemGlobals.getIcon(itemId))
             
         geomParams['geom_scale'] = 0.11
         geomParams['geom_pos'] = (0.080000000000000002, 0, 0.068000000000000005)
     else:
         itemClass = EconomyGlobals.getItemCategory(itemId)
         itemType = EconomyGlobals.getItemType(itemId)
         if itemType == ItemType.FISHING_ROD or itemType == ItemType.FISHING_LURE:
             asset = EconomyGlobals.getItemIcons(itemId)
             if asset:
                 geomParams['geom'] = InventoryItemGui.fishingIcons.find('**/%s*' % asset)
                 geomParams['geom_scale'] = 0.11
                 geomParams['geom_pos'] = (0.080000000000000002, 0, 0.068000000000000005)
             
         elif itemClass == ItemType.WEAPON and itemClass == ItemType.POUCH or itemClass == ItemType.AMMO:
             asset = EconomyGlobals.getItemIcons(itemId)
             if asset:
                 geomParams['geom'] = InventoryItemGui.weaponIcons.find('**/%s*' % asset)
                 geomParams['geom_scale'] = 0.11
                 geomParams['geom_pos'] = (0.080000000000000002, 0, 0.068000000000000005)
             
         elif itemClass == ItemType.CONSUMABLE:
             asset = EconomyGlobals.getItemIcons(itemId)
             if asset:
                 geomParams['geom'] = InventoryItemGui.skillIcons.find('**/%s*' % asset)
                 geomParams['geom_scale'] = 0.11
                 geomParams['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:
                     geomParams['geom'] = InventoryListItem.skillIcons.find('**/%s' % asset)
                     geomParams['geom_scale'] = 0.14999999999999999
                     geomParams['geom_pos'] = (0.069000000000000006, 0, 0.069000000000000006)
                 
             
         elif InventoryType.SmallBottle <= itemId and itemId <= InventoryType.LargeBottle:
             geomParams['geom'] = InventoryListItem.topGui.find('**/main_gui_ship_bottle')
             geomParams['geom_scale'] = 0.10000000000000001
             geomParams['geom_pos'] = (0.069000000000000006, 0, 0.069000000000000006)
         
     return geomParams
开发者ID:TTGhost,项目名称:POTCOR-src,代码行数:57,代码来源:InventoryItemGui.py

示例3: __init__

# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getIcon [as 别名]
 def __init__(self, manager, itemTuple, imageScaleFactor = 1.0, showMax = 1):
     InventoryUIStackItem.InventoryUIStackItem.__init__(self, manager, itemTuple, imageScaleFactor = imageScaleFactor, showMax = showMax, update = False)
     self.initialiseoptions(InventoryUIConsumableItem)
     skillIcons = loader.loadModel('models/textureCards/skillIcons')
     self['image'] = skillIcons.find('**/%s' % ItemGlobals.getIcon(self.itemTuple[1]))
     self['image_scale'] = 0.10000000000000001 * imageScaleFactor
     self.helpFrame = None
     self.hasDrunk = False
     self.cm = CardMaker('itemCard')
     self.cm.setFrame(-0.29999999999999999, 0.29999999999999999, -0.089999999999999997, 0.089999999999999997)
     self.buffer = None
     self.lens = PerspectiveLens()
     self.lens.setNear(0.10000000000000001)
     self.lens.setAspectRatio(0.59999999999999998 / 0.17999999999999999)
     self.realItem = None
     self.iconLabel = None
     self.itemCard = None
     self.portraitSceneGraph = NodePath('PortraitSceneGraph')
     detailGui = loader.loadModel('models/gui/gui_card_detail')
     self.bg = detailGui.find('**/color')
     self.bg.setScale(4)
     self.bg.setPos(0, 17, -6.2999999999999998)
     self.glow = detailGui.find('**/glow')
     self.glow.setScale(3)
     self.glow.setPos(0, 17, -6.2999999999999998)
     self.glow.setColor(1, 1, 1, 0.80000000000000004)
     self.setBin('gui-fixed', 1)
     self.accept('open_main_window', self.createBuffer)
     self.accept('aspectRatioChanged', self.createBuffer)
     self.accept('close_main_window', self.destroyBuffer)
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:32,代码来源:InventoryUIConsumableItem.py

示例4: __init__

# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getIcon [as 别名]
 def __init__(self, uid):
     self.itemClass = ItemGlobals.getClass(uid)
     self.itemType = ItemGlobals.getType(uid)
     self.cost = ItemGlobals.getGoldCost(uid)
     SimpleItem.__init__(self, uid)
     self.holidayId = ItemGlobals.getHoliday(uid)
     if self.Icons:
         self.icon = self.Icons.find('**/%s' % ItemGlobals.getIcon(uid))
开发者ID:TTGhost,项目名称:POTCOR-src,代码行数:10,代码来源:SimpleStoreItem.py

示例5: loadWeaponButtons

# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getIcon [as 别名]
 def loadWeaponButtons(self):
     for hotkey in self.hotkeys:
         hotkey.destroy()
     
     self.hotkeys = []
     for icon in self.icons:
         icon.destroy()
     
     self.icons = []
     for repMeter in self.repMeters:
         repMeter.destroy()
     
     self.repMeters = []
     self['frameSize'] = (0, self.ICON_WIDTH * len(self.items) + 0.040000000000000001, 0, self.HEIGHT)
     self.setX(-((self.ICON_WIDTH * len(self.items) + 0.040000000000000001) / 2.0))
     topGui = loader.loadModel('models/gui/toplevel_gui')
     kbButton = topGui.find('**/keyboard_button')
     for i in range(len(self.items)):
         if self.items[i]:
             category = WeaponGlobals.getRepId(self.items[i][0])
             icon = DirectFrame(parent = self, state = DGG.DISABLED, relief = None, frameSize = (0, 0.080000000000000002, 0, 0.080000000000000002), pos = (self.ICON_WIDTH * i + 0.080000000000000002, 0, 0.082000000000000003))
             icon.setTransparency(1)
             hotkeyText = 'F%s' % self.items[i][1]
             hotkey = DirectFrame(parent = icon, state = DGG.DISABLED, relief = None, text = hotkeyText, text_align = TextNode.ACenter, text_scale = 0.044999999999999998, text_pos = (0, 0), text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, image = kbButton, image_scale = 0.059999999999999998, image_pos = (0, 0, 0.01), image_color = (0.5, 0.5, 0.34999999999999998, 1), pos = (0, 0, 0.080000000000000002))
             self.hotkeys.append(hotkey)
             category = WeaponGlobals.getRepId(self.items[i][0])
             if Freebooter.getPaidStatus(base.localAvatar.getDoId()) or Freebooter.allowedFreebooterWeapon(category):
                 asset = ItemGlobals.getIcon(self.items[i][0])
                 if asset:
                     texCard = self.card.find('**/%s' % asset)
                     icon['geom'] = texCard
                     icon['geom_scale'] = 0.080000000000000002
                 
                 icon.resetFrameSize()
                 self.icons.append(icon)
             else:
                 texCard = topGui.find('**/pir_t_gui_gen_key_subscriber*')
                 icon['geom'] = texCard
                 icon['geom_scale'] = 0.20000000000000001
                 icon.resetFrameSize()
                 self.icons.append(icon)
             repMeter = DirectWaitBar(parent = icon, relief = DGG.SUNKEN, state = DGG.DISABLED, borderWidth = (0.002, 0.002), range = 0, value = 0, frameColor = (0.23999999999999999, 0.23999999999999999, 0.20999999999999999, 1), barColor = (0.80000000000000004, 0.80000000000000004, 0.69999999999999996, 1), pos = (-0.050000000000000003, 0, -0.052499999999999998), hpr = (0, 0, 0), frameSize = (0.0050000000000000001, 0.095000000000000001, 0, 0.012500000000000001))
             self.repMeters.append(repMeter)
             inv = base.localAvatar.getInventory()
             if inv:
                 repValue = inv.getReputation(category)
                 (level, leftoverValue) = ReputationGlobals.getLevelFromTotalReputation(category, repValue)
                 max = ReputationGlobals.getReputationNeededToLevel(category, level)
                 repMeter['range'] = max
                 repMeter['value'] = leftoverValue
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:52,代码来源:BarSelectionMenu.py

示例6: __init__

# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getIcon [as 别名]
    def __init__(self, manager, itemTuple, imageScaleFactor = 0.84999999999999998):
        InventoryUIItem.InventoryUIItem.__init__(self, manager, itemTuple, imageScaleFactor = imageScaleFactor)
        self.initialiseoptions(InventoryUITattooItem)
        self['relief'] = None
        tattooGui = loader.loadModel('models/misc/tattoos')
        image = tattooGui.find('**/%s' % ItemGlobals.getIcon(itemTuple[1]))
        if image.isEmpty():
            image = tattooGui.find('**/tattoo_%s' % ItemGlobals.getIcon(itemTuple[1]))

        self['image'] = image
        self['image_scale'] = 0.10000000000000001 * imageScaleFactor
        self.iconColor = (1.0, 1.0, 1.0, 1.0)
        self['image_color'] = (self.iconColor[0], self.iconColor[1], self.iconColor[2], self.iconColor[3])
        self.helpFrame = None
        self.cm = CardMaker('itemCard')
        self.cm.setFrame(-0.29999999999999999, 0.29999999999999999, -0.089999999999999997, 0.089999999999999997)
        self.buffer = None
        self.lens = PerspectiveLens()
        self.lens.setNear(0.10000000000000001)
        self.lens.setAspectRatio(0.59999999999999998 / 0.17999999999999999)
        self.realItem = None
        self.itemCard = None
        self.portraitSceneGraph = NodePath('PortraitSceneGraph')
        detailGui = loader.loadModel('models/gui/gui_card_detail')
        self.bg = detailGui.find('**/color')
        self.bg.setScale(4)
        self.bg.setPos(0, 17, -6.2999999999999998)
        self.glow = detailGui.find('**/glow')
        self.glow.setScale(3)
        self.glow.setPos(0, 17, -6.2999999999999998)
        self.glow.setColor(1, 1, 1, 0.80000000000000004)
        self.setBin('gui-fixed', 1)
        self.accept('open_main_window', self.createBuffer)
        self.accept('aspectRatioChanged', self.createBuffer)
        self.accept('close_main_window', self.destroyBuffer)
        self.displayHuman = self.manager.getDisplayHuman()
        self.masterHuman = self.manager.getMasterHuman()
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:39,代码来源:InventoryUITattooItem.py

示例7: __init__

# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getIcon [as 别名]
 def __init__(self, manager, itemTuple, imageScaleFactor = 1.0):
     InventoryUIItem.InventoryUIItem.__init__(self, manager, itemTuple, imageScaleFactor = imageScaleFactor)
     self.initialiseoptions(InventoryUIClothingItem)
     self['relief'] = None
     tailorGui = loader.loadModel('models/gui/gui_icons_clothing')
     iconName = ItemGlobals.getIcon(itemTuple[1])
     self['image'] = tailorGui.find('**/%s' % iconName)
     self['image_scale'] = 0.10000000000000001 * imageScaleFactor
     iconColorIndex = ItemGlobals.getColor(itemTuple[1])
     dyeColor = itemTuple[3]
     if dyeColor:
         self.iconColor = (DYE_COLORS[dyeColor][0], DYE_COLORS[dyeColor][1], DYE_COLORS[dyeColor][2], 1.0)
     else:
         self.iconColor = (ItemConstants.COLOR_VALUES[iconColorIndex][0], ItemConstants.COLOR_VALUES[iconColorIndex][1], ItemConstants.COLOR_VALUES[iconColorIndex][2], 1.0)
     self['image_color'] = (self.iconColor[0], self.iconColor[1], self.iconColor[2], self.iconColor[3])
     self.helpFrame = None
     self.cm = CardMaker('itemCard')
     self.cm.setFrame(-0.29999999999999999, 0.29999999999999999, -0.089999999999999997, 0.089999999999999997)
     self.buffer = None
     self.lens = PerspectiveLens()
     self.lens.setNear(0.5)
     self.lens.setAspectRatio(0.59999999999999998 / 0.17999999999999999)
     self.realItem = None
     self.itemCard = None
     self.portraitSceneGraph = NodePath('PortraitSceneGraph')
     detailGui = loader.loadModel('models/gui/gui_card_detail')
     self.bg = detailGui.find('**/color')
     self.bg.setScale(4)
     self.bg.setPos(0, 17, -6.2999999999999998)
     self.glow = detailGui.find('**/glow')
     self.glow.setScale(3)
     self.glow.setPos(0, 17, -6.2999999999999998)
     self.glow.setColor(1, 1, 1, 0.80000000000000004)
     self.setBin('gui-fixed', 1)
     self.accept('open_main_window', self.createBuffer)
     self.accept('aspectRatioChanged', self.createBuffer)
     self.accept('close_main_window', self.destroyBuffer)
     self.displayHuman = self.manager.getDisplayHuman()
     self.masterHuman = self.manager.getMasterHuman()
开发者ID:TTGhost,项目名称:POTCOR-src,代码行数:41,代码来源:InventoryUIClothingItem.py

示例8: show

# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getIcon [as 别名]
 def show(self):
     if self.potionName is not None:
         self.potionName.removeNode()
     
     if self.potionDesc is not None:
         self.potionDesc.removeNode()
     
     if self.potionXp is not None:
         self.potionXp.removeNode()
     
     if self.potionImg is not None:
         self.potionImg.removeNode()
     
     self.potionName = DirectLabel(parent = self, relief = None, text = self.potionGame.currentRecipe.name, text_scale = PiratesGuiGlobals.TextScaleTitleMed, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 17, pos = (0.75, 0, 0.65000000000000002), textMayChange = 0)
     self.potionDesc = DirectLabel(parent = self, relief = None, text = self.potionGame.currentRecipe.desc, text_scale = PiratesGuiGlobals.TextScaleExtraLarge, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 34, pos = (0.75, 0, 0.22), textMayChange = 0)
     xpAmt = PotionGlobals.getPotionBuffXP(self.potionGame.currentRecipe.potionID)
     xpAmt = int(math.ceil(float(xpAmt) / 2.0))
     xpBonus = self.potionGame.dist.getXpBonus()
     labelTxt = '+ ' + str(xpAmt) + ' ' + PLocalizer.PotionGui['XPLabel']
     if xpBonus:
         xpAmt = xpAmt + xpBonus
         labelTxt = PLocalizer.PotionGui['XPLabelBonus'] % (str(xpAmt), str(xpBonus))
     
     self.potionXp = DirectLabel(parent = self, relief = None, text = labelTxt, text_scale = PiratesGuiGlobals.TextScaleTitleSmall, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 17, pos = (0.75, 0, 0.28999999999999998), textMayChange = 0)
     asset = ItemGlobals.getIcon(PotionGlobals.potionBuffIdToInventoryTypeId(self.potionGame.currentRecipe.potionID))
     skillIcons = loader.loadModel('models/textureCards/skillIcons')
     geom = skillIcons.find('**/%s' % asset)
     if geom.isEmpty():
         geom = skillIcons.find('**/base')
     
     geom_scale = 0.23999999999999999
     self.potionImg = DirectFrame(parent = self, geom = geom, geom_scale = geom_scale, pos = (0.75, 0, 0.5), image = None, relief = None)
     self.unstash()
     self.potionGame.closeCurrentDialog = self.cleanUp
     self.potionGame.disableButtons()
     skillIcons.removeNode()
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:38,代码来源:PotionResults.py

示例9: showDetails

# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getIcon [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

        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)
        skillIcons = loader.loadModel('models/textureCards/skillIcons')
        if itemSubtype == ItemGlobals.POTION_BUFF:
            self.iconLabel = DirectLabel(parent = self.portraitSceneGraph, relief = None, image = skillIcons.find('**/%s' % ItemGlobals.getIcon(itemId)), pos = (0.0, 2.5, 0.0))
        elif model:
            self.realItem = loader.loadModel('models/inventory/' + model, okMissing = True)
            if not self.realItem:
                self.realItem = loader.loadModel('models/handheld/' + 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])
                else:
                    self.realItem.setPos(0.0, 2.5, -0.40000000000000002)
                    self.realItem.setHpr(45, 0, 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)
        if ItemGlobals.getSubtype(itemId) == 30:
            duration = PotionGlobals.getPotionBuffDuration(WeaponGlobals.getSkillEffectFlag(ItemGlobals.getUseSkill(itemId)))
            if duration >= 3600:
                duration = duration / 3600
                if duration == 1:
#.........这里部分代码省略.........
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:103,代码来源:InventoryUIConsumableItem.py


注:本文中的pirates.inventory.ItemGlobals.getIcon方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。