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


Python Freebooter.allowedFreebooterWeapon方法代码示例

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


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

示例1: selectPrev

# 需要导入模块: from pirates.piratesbase import Freebooter [as 别名]
# 或者: from pirates.piratesbase.Freebooter import allowedFreebooterWeapon [as 别名]
 def selectPrev(self):
     if len(self.items) < 1:
         return None
     
     self.show()
     if len(self.items) > 1:
         keepTrying = True
     else:
         keepTrying = False
     while keepTrying:
         keepTrying = False
         self.choice = self.choice - 1
         if self.choice < 0 or self.choice > len(self.items) - 1:
             self.choice = len(self.items) - 1
         
         if not Freebooter.getPaidStatus(base.localAvatar.getDoId()):
             if self.items[self.choice]:
                 category = WeaponGlobals.getRepId(self.items[self.choice][0])
                 if not Freebooter.allowedFreebooterWeapon(category):
                     keepTrying = True
                 
             else:
                 keepTrying = True
         self.items[self.choice]
     self.cursor.setPos(self.ICON_WIDTH * self.choice + 0.080000000000000002, 0, 0.071999999999999995)
     taskMgr.remove('BarSelectHideTask' + str(self.getParent()))
     self.hideTask = taskMgr.doMethodLater(self.SelectionDelay, self.confirmSelection, 'BarSelectHideTask' + str(self.getParent()), extraArgs = [])
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:29,代码来源:BarSelectionMenu.py

示例2: loadWeaponButtons

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


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