本文整理汇总了Python中pirates.piratesbase.Freebooter.pruneFreebooterSkills方法的典型用法代码示例。如果您正苦于以下问题:Python Freebooter.pruneFreebooterSkills方法的具体用法?Python Freebooter.pruneFreebooterSkills怎么用?Python Freebooter.pruneFreebooterSkills使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pirates.piratesbase.Freebooter
的用法示例。
在下文中一共展示了Freebooter.pruneFreebooterSkills方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pirates.piratesbase import Freebooter [as 别名]
# 或者: from pirates.piratesbase.Freebooter import pruneFreebooterSkills [as 别名]
def __init__(self, rep, weaponMode):
self.rep = rep
self.weaponMode = weaponMode
localAvatar.cr.targetMgr.reticle.hide()
if self.weaponMode in (WeaponGlobals.MELEE, WeaponGlobals.COMBAT, WeaponGlobals.THROWING):
target = base.cr.targetMgr.takeAim(localAvatar)
if target:
localAvatar.guiMgr.combatTray.beginAimAssist(target)
base.win.movePointer(0, base.win.getXSize() / 2, base.win.getYSize() / 2)
localAvatar.guiMgr.setSeaChestAllowed(False)
self.radial = { }
self.rframe = { }
self.ammoAmt = { }
self.rstatus = { }
self.rstatus[0] = 0
self.rframe[0] = SkillRing(Vec4(1, 0.80000000000000004, 0.5, 1), Vec4(0, 0, 0, 1.0))
skillRing = SkillRing(Vec4(1, 0.80000000000000004, 0.5, 1), Vec4(0, 0, 0, 1.0))
skillRing.reparentTo(aspect2d)
skillRing.setPos(0.01, 0, 0.01)
if not self.SkillIcons:
self.SkillIcons = loader.loadModel('models/textureCards/skillIcons')
icons = loader.loadModel('models/gui/gui_icons_weapon')
icons.reparentTo(self.SkillIcons)
if self.rep == InventoryType.DollRep and localAvatar.hasStickyTargets():
asset = getSkillIconName(self.rep, 1)
else:
asset = getSkillIconName(self.rep, 0)
self.radial[0] = DirectFrame(parent = aspect2d, relief = None, image = self.SkillIcons.find('**/%s' % asset), image_scale = ImageScale(self.rep), image_pos = (0.059999999999999998, 0, 0.059999999999999998), pos = (-0.050000000000000003, 0, -0.050000000000000003), sortOrder = 10)
self.radial[0].setTransparency(1)
origMap = ActiveSkills(self.rep, 2)
self.radialSkillMap = Freebooter.pruneFreebooterSkills(origMap)
self.numberOfItems = len(self.radialSkillMap)
for i in range(self.numberOfItems):
(x, y) = InnerRingOffset(i + 1)
self.rstatus[i + 1] = 0
self.rframe[i + 1] = SkillRing(Vec4(1, 0.80000000000000004, 0.5, 1), Vec4(0, 0, 0, 1.0))
skillRing = SkillRing(Vec4(1, 0.80000000000000004, 0.5, 1), Vec4(0, 0, 0, 1.0))
skillRing.reparentTo(aspect2d)
skillRing.setPos(0.01 + x, 0, 0.01 + y)
asset = getSkillIconName(self.radialSkillMap[i], 0)
self.radial[i + 1] = DirectFrame(parent = aspect2d, relief = None, image = self.SkillIcons.find('**/%s' % asset), image_pos = (0.059999999999999998, 0, 0.059999999999999998), image_scale = ImageScale(self.rep), sortOrder = 100, pos = (-0.050000000000000003 + x, 0, -0.050000000000000003 + y))
self.radial[i + 1].setTransparency(1)
if self.weaponMode in (WeaponGlobals.FIREARM, WeaponGlobals.THROWING, WeaponGlobals.CANNON, WeaponGlobals.GRENADE):
inv = localAvatar.getInventory()
skillId = self.radialSkillMap[i]
maxQuant = WeaponGlobals.getSkillMaxQuantity(skillId)
if maxQuant == WeaponGlobals.INF_QUANT and WeaponGlobals.canUseInfiniteAmmo(localAvatar.currentWeaponId, skillId) or WeaponGlobals.canUseInfiniteAmmo(localAvatar.getCurrentCharm(), skillId):
amtstr = '++'
else:
ammoInvId = WeaponGlobals.getSkillAmmoInventoryId(skillId)
ammoAmt = inv.getStackQuantity(ammoInvId)
ammoMax = inv.getStackLimit(ammoInvId)
amtstr = '%d' % ammoAmt
self.ammoAmt[i + 1] = DirectLabel(parent = aspect2d, relief = None, text = amtstr, text_align = TextNode.ACenter, text_scale = 0.029999999999999999, text_fg = (0.69999999999999996, 1.0, 1.0, 1), text_font = PiratesGlobals.getPirateBoldOutlineFont(), pos = (x + 0.059999999999999998, 0, y + 0.040000000000000001), textMayChange = 1)
continue
self.mouseBasePosX = base.win.getXSize() / 2
self.mouseBasePosY = base.win.getYSize() / 2
self.radialHelp = DirectLabel(parent = aspect2d, relief = None, text = '', text_align = TextNode.ACenter, text_scale = 0.040000000000000001, text_fg = (0.94999999999999996, 1.0, 1.0, 1), text_shadow = PiratesGuiGlobals.TextShadow, pos = (0, 0, 0), textMayChange = 1)
self.radialHelp.hide()
self.radial[0].show()
self.rframe[0].show()
self.hiLiteItem = 0
taskMgr.add(self.radialMenuHeartBeat, 'radialMenuHeartBeat', priority = 40)
messenger.send('openedSpecialMenu')