本文整理汇总了Python中pirates.piratesbase.PLocalizer.makeHeadingString方法的典型用法代码示例。如果您正苦于以下问题:Python PLocalizer.makeHeadingString方法的具体用法?Python PLocalizer.makeHeadingString怎么用?Python PLocalizer.makeHeadingString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pirates.piratesbase.PLocalizer
的用法示例。
在下文中一共展示了PLocalizer.makeHeadingString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: checkPlayerInventory
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import makeHeadingString [as 别名]
def checkPlayerInventory(self, itemId, extraQty = 0):
if self.available:
inventory = base.localAvatar.getInventory()
currStock = inventory.getStackQuantity(itemId)
currStockLimit = inventory.getStackLimit(itemId)
if currStock == 0:
if base.cr.newsManager.getHoliday(21):
pass
if not (itemId in InventoryType.WinterHolidaySongs):
self.name = PLocalizer.makeHeadingString(PLocalizer.SongTitleUnknown, 2)
self.nameTag['text'] = PLocalizer.makeHeadingString(PLocalizer.SongTitleUnknown, 2)
self.itemTypeName['text'] = PLocalizer.makeHeadingString(PLocalizer.SongComingSoon, 1)
self.disable()
not (itemId in InventoryType.WinterHolidaySongs)
示例2: __init__
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import makeHeadingString [as 别名]
def __init__(self, uid):
SimpleEconomyItem.__init__(self, uid)
self.icon = self.Icons.find('**/%s' % EconomyGlobals.getItemIcons(uid))
if uid in range(InventoryType.begin_PistolPouches, InventoryType.end_PistolPouches):
self.shortDesc = PLocalizer.makeHeadingString(PLocalizer.InventoryItemClassNames.get(ItemType.PISTOL), 1)
elif uid in range(InventoryType.begin_DaggerPouches, InventoryType.end_DaggerPouches):
self.shortDesc = PLocalizer.makeHeadingString(PLocalizer.InventoryItemClassNames.get(ItemType.DAGGER), 1)
elif uid in range(InventoryType.begin_GrenadePouches, InventoryType.end_GrenadePouches):
self.shortDesc = PLocalizer.makeHeadingString(PLocalizer.GrenadeShort, 1)
elif uid in range(InventoryType.begin_CannonPouches, InventoryType.end_CannonPouches):
self.shortDesc = PLocalizer.makeHeadingString(PLocalizer.ShipCannonShort, 1)
else:
self.shortDesc = PLocalizer.makeHeadingString(self.itemType, 1)
self.itemName = self.shortDesc
self.longDesc = self.shortDesc
示例3: loadData
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import makeHeadingString [as 别名]
def loadData(self):
itemId = self.data[0]
(item, quantity) = self.data
self.quantity = quantity
itemType = EconomyGlobals.getItemType(itemId)
if itemType <= ItemType.WAND:
itemTypeName = PLocalizer.getItemSubtypeName(ItemGlobals.getSubtype(itemId))
else:
itemTypeName = PLocalizer.InventoryItemClassNames.get(itemType)
if itemType <= ItemType.WAND or itemType == ItemType.POTION:
name = PLocalizer.getItemName(itemId)
self.price = ItemGlobals.getGoldCost(itemId)
else:
name = PLocalizer.InventoryTypeNames.get(item)
self.price = EconomyGlobals.getItemCost(item)
if self.sell:
self.price /= 2
if self.buy:
if itemType > ItemType.WAND and itemType != ItemType.POTION:
self.quantity = EconomyGlobals.getItemQuantity(itemId)
self.price *= self.quantity
self.price = int(self.price)
self.name = PLocalizer.makeHeadingString(name, 2)
self.itemType = itemTypeName
if itemType != ItemType.FISHING_LURE:
if itemType != ItemType.POTION:
self.minLvl = ItemGlobals.getWeaponRequirement(itemId)
else:
self.minLvl = 0
else:
self.minLvl = EconomyGlobals.getItemMinLevel(self.data[0])
示例4: createGui
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import makeHeadingString [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()
示例5: __init__
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import makeHeadingString [as 别名]
def __init__(self, category, width = 0.40000000000000002):
DirectFrame.__init__(self, parent = NodePath(), relief = None)
self.initialiseoptions(ReputationMeter)
self.category = category
self.level = 0
self.value = 0
self.max = 0
self.masteredIval = None
name = PLocalizer.makeHeadingString(self.getCategoryName(), 2)
self.categoryLabel = DirectLabel(parent = self, relief = None, text = name, text_scale = PiratesGuiGlobals.TextScaleLarge, text_align = TextNode.ALeft, text_shadow = PiratesGuiGlobals.TextShadow, pos = (-width * 0.5, 0, 0.02), textMayChange = 1)
self.levelLabel = DirectLabel(parent = self, relief = None, text = '', text_scale = PiratesGuiGlobals.TextScaleLarge, text_align = TextNode.ARight, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, pos = (width * 0.5, 0, 0.02), textMayChange = 1)
gui = loader.loadModel('models/gui/ship_battle')
guiModel = loader.loadModel('models/gui/toplevel_gui')
self.meter = DirectWaitBar(parent = self, relief = DGG.FLAT, state = DGG.DISABLED, range = self.max, value = self.value, frameSize = (-width * 0.5, width * 0.5, -0.01, 0.01), frameColor = (65 / 255.0, 40 / 255.0, 8 / 255.0, 1), barColor = (223 / 255.0, 137 / 255.0, 28 / 255.0, 1), pos = (0, 0, 0.0))
self.meterFrame = DirectFrame(parent = self.meter, relief = None, image = gui.find('**/ship_battle_speed_bar*'), image_scale = (width * 0.75, 1.0, 0.59999999999999998), pos = (0, 0, 0.0))
self.clamp1 = DirectFrame(parent = self.meter, relief = None, image = guiModel.find('**/groggy_clamp'), image_scale = (0.14999999999999999, 1.0, 0.40000000000000002), image_color = (0.80000000000000004, 0.80000000000000004, 0.80000000000000004, 1.0), pos = (-width * 0.33300000000000002, 0, 0))
self.clamp2 = DirectFrame(parent = self.meter, relief = None, image = guiModel.find('**/groggy_clamp'), image_scale = (0.14999999999999999, 1.0, 0.40000000000000002), image_color = (0.80000000000000004, 0.80000000000000004, 0.80000000000000004, 1.0), pos = (-width * 0.16700000000000001, 0, 0))
self.clamp3 = DirectFrame(parent = self.meter, relief = None, image = guiModel.find('**/groggy_clamp'), image_scale = (0.14999999999999999, 1.0, 0.40000000000000002), image_color = (0.80000000000000004, 0.80000000000000004, 0.80000000000000004, 1.0), pos = (0, 0, 0))
self.clamp4 = DirectFrame(parent = self.meter, relief = None, image = guiModel.find('**/groggy_clamp'), image_scale = (0.14999999999999999, 1.0, 0.40000000000000002), image_color = (0.80000000000000004, 0.80000000000000004, 0.80000000000000004, 1.0), pos = (width * 0.16700000000000001, 0, 0))
self.clamp5 = DirectFrame(parent = self.meter, relief = None, image = guiModel.find('**/groggy_clamp'), image_scale = (0.14999999999999999, 1.0, 0.40000000000000002), image_color = (0.80000000000000004, 0.80000000000000004, 0.80000000000000004, 1.0), pos = (width * 0.33300000000000002, 0, 0))
self.valueLabel = DirectLabel(parent = self.meter, relief = None, text = '', text_scale = PiratesGuiGlobals.TextScaleMed, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_font = PiratesGlobals.getInterfaceFont(), text_pos = (0, 0.032000000000000001), pos = (0, 0, -0.01), textMayChange = 1)
logoModel = loader.loadModel('models/gui/potcLogo')
self.levelCapScroll = DirectFrame(parent = self.meter, relief = None, image = guiModel.find('**/main_gui_quest_scroll'))
self.levelCapScroll.setPos(0.0, 0.0, 0.01)
self.levelCapScroll.setScale(0.115, 1.0, 0.050000000000000003)
self.levelCapScroll.hide()
self.levelCapIcon = DirectFrame(parent = self.meter, relief = None, image = logoModel.find('**/skull'))
self.levelCapIcon.setPos(0.0, 0.0, 0.025000000000000001)
self.levelCapIcon.setScale(0.40000000000000002)
self.levelCapIcon.setBin('gui-popup', 0)
self.levelCapIcon.hide()
self.masteredLabel = DirectLabel(parent = self.meter, relief = None, text = PLocalizer.RepCapText_Skill, text_scale = 0.044999999999999998, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, text_font = PiratesGlobals.getInterfaceFont())
self.masteredLabel.setPos(0.0, 0.0, -0.01)
self.masteredLabel.hide()
self.levelCapScroll.setTransparency(1)
self.levelCapIcon.setTransparency(1)
self.masteredLabel.setTransparency(1)
self.update(self.value)
self.flattenStrong()
示例6: loadData
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import makeHeadingString [as 别名]
def loadData(self):
itemId = self.data[0]
if UberDogGlobals.InventoryId.isStackable(itemId):
(item, quantity) = self.data
name = PLocalizer.InventoryTypeNames.get(item)
self.quantity = 1
itemType = None
itemTypeName = None
self.price = 5
else:
(category, doId) = self.data
name = PLocalizer.InventoryCategoryNames.get(category)
self.quantity = 1
itemTypeName = 'Object'
self.price = 5
if self.buy:
self.price *= self.quantity
self.price = int(self.price)
self.name = PLocalizer.makeHeadingString(name, 2)
self.itemType = itemTypeName
self.minLvl = EconomyGlobals.getItemMinLevel(self.data[0])
示例7: createGui
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import makeHeadingString [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)
示例8: setShipClass
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import makeHeadingString [as 别名]
def setShipClass(self, shipClass):
self.classLabel["text"] = PLocalizer.makeHeadingString(PLocalizer.ShipClassNames.get(shipClass), 1)
示例9: setShipName
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import makeHeadingString [as 别名]
def setShipName(self, name, team=None):
self.nameLabel["text"] = PLocalizer.makeHeadingString(name, 2)
示例10: __init__
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import makeHeadingString [as 别名]
def __init__(self, shipPage, shipId, **kwargs):
self.shipPage = shipPage
self.emptyBottle = True
self.setShipId(shipId)
self.timer = None
self.lBroadsideLimit = 0
self.rBroadsideLimit = 0
kwargs.setdefault("relief", None)
kwargs.setdefault("frameSize", (0, self.Width, 0, self.Height))
DirectFrame.__init__(self, **None)
self.initialiseoptions(ShipPanel)
gui = loader.loadModel("models/gui/toplevel_gui")
inventoryGui = loader.loadModel("models/gui/gui_icons_inventory")
chestIcon = inventoryGui.find("**/pir_t_ico_trs_chest_01*")
cannonIcon = gui.find("**/topgui_icon_ship_cannon_single")
skillIcons = loader.loadModel("models/textureCards/skillIcons")
broadsideId = InventoryType.CannonRoundShot
ammoIconName = WeaponGlobals.getSkillIcon(broadsideId)
broadsideIcon = skillIcons.find("**/%s" % ammoIconName)
crewIcon = (gui.find("**/pir_t_gui_gen_friends_pirates"),)
self.bottleFrame = ShipFrameBottle(
parent=self,
shipId=shipId,
relief=None,
state=DGG.DISABLED,
pos=(0.074999999999999997, 0, 0.75),
scale=0.83499999999999996,
)
gui = loader.loadModel("models/gui/gui_ship_window")
bottleImage = gui.find("**/ship_bottle")
self.shipBottle = DirectLabel(
parent=self.bottleFrame,
relief=None,
state=DGG.DISABLED,
geom=bottleImage,
geom_scale=0.29999999999999999,
geom_pos=(0, 0, 0),
pos=(0.5, 0, -0.0),
)
self.nameLabel = DirectLabel(
parent=self,
relief=None,
state=DGG.DISABLED,
text=PLocalizer.makeHeadingString(PLocalizer.EmptyBottle, 2),
text_fg=PiratesGuiGlobals.TextFG1,
text_scale=PiratesGuiGlobals.TextScaleTitleSmall,
text_align=TextNode.ACenter,
text_shadow=(0, 0, 0, 1),
text_wordwrap=30,
textMayChange=1,
text_font=PiratesGlobals.getPirateFont(),
pos=(0.55000000000000004, 0, 1.22),
)
self.classLabel = DirectLabel(
parent=self,
relief=None,
state=DGG.DISABLED,
text=PLocalizer.makeHeadingString(PLocalizer.EmptyBottleDesc, 1),
text_scale=PiratesGuiGlobals.TextScaleMed,
text_align=TextNode.ACenter,
text_fg=PiratesGuiGlobals.TextFG2,
text_shadow=(0, 0, 0, 1),
text_wordwrap=30,
textMayChange=1,
text_font=PiratesGlobals.getInterfaceFont(),
pos=(0.55000000000000004, 0, 1.1799999999999999),
)
self.timer = PiratesTimer.PiratesTimer(
showMinutes=True, mode=None, titleText="", titleFg="", infoText="", cancelText="", cancelCallback=None
)
self.timer.setFontColor(PiratesGuiGlobals.TextFG2)
self.timer.reparentTo(self)
self.timer.setPos(0.45000000000000001, 0, 0.93999999999999995)
self.timer.setScale(0.59999999999999998)
self.timer.stash()
self.hpMeter = DirectWaitBar(
parent=self,
relief=DGG.RAISED,
state=DGG.DISABLED,
range=1,
value=0,
frameColor=(0.0, 0.0, 0.0, 0.0),
barColor=(0.10000000000000001, 0.69999999999999996, 0.10000000000000001, 1),
frameSize=(0, 0.31, 0, 0.018599999999999998),
text="",
text_align=TextNode.ARight,
text_scale=0.029999999999999999,
text_fg=(1, 1, 1, 1),
text_shadow=(0, 0, 0, 1),
text_pos=(0.29999999999999999, 0.029999999999999999),
pos=(0.55000000000000004, 0.0, 0.45000000000000001),
scale=1.2,
)
hpLabel = DirectLabel(
parent=self.hpMeter,
relief=None,
state=DGG.DISABLED,
text=PLocalizer.HP,
text_scale=0.029999999999999999,
text_align=TextNode.ALeft,
#.........这里部分代码省略.........
示例11: loadData
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import makeHeadingString [as 别名]
def loadData(self):
itemId = self.data[0]
name = PLocalizer.LocationNames[itemId]
self.price = EconomyGlobals.StowawayCost[itemId]
self.name = PLocalizer.makeHeadingString(name, 2)
self.minLvl = EconomyGlobals.getItemMinLevel(self.data[0])
示例12: createTextBox
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import makeHeadingString [as 别名]
def createTextBox(self):
if self.infoBox:
return None
globalPos = self.getPos(base.a2dLeftCenter)
self.infoBox = None
self.infoBox = BorderFrame(parent = base.a2dLeftCenter, frameSize = (-0.040000000000000001, 0.5, -0.25, 0.050000000000000003), pos = (globalPos.getX() + 0.12, 0, globalPos.getZ()), state = DGG.DISABLED)
self.label = DirectLabel(parent = self.infoBox, relief = None, text = PLocalizer.CannonDefenseAmmoDesc % (PLocalizer.makeHeadingString(PLocalizer.InventoryTypeNames[self.skillId], 2), self.cost, self.amount, PLocalizer.CannonDefenseAmmoTypeDesc[self.skillId]), text_align = TextNode.ALeft, text_scale = PiratesGuiGlobals.TextScaleLarge, text_fg = PiratesGuiGlobals.TextFG2, text_wordwrap = 12, textMayChange = 1)
if self.locked:
memberText = ''
if self.skillId > CannonDefenseGlobals.FREEBOOTER_LAST_AMMO_AVAILABLE:
memberText = PLocalizer.VR_AuthAccess
self.label['text'] = PLocalizer.CannonDefenseAmmoUnlockedAt % (CannonDefenseGlobals.getLevelUnlockedAt(self.skillId), memberText)
self.infoBox.setBin('gui-cannonDefense', 4)
示例13: __init__
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import makeHeadingString [as 别名]
def __init__(self, shipPage, shipId, **kwargs):
self.shipPage = shipPage
self.setShipId(shipId)
self.timer = None
self.crewDots = []
self.lBroadsideLimit = 0
self.rBroadsideLimit = 0
kwargs.setdefault('relief', None)
kwargs.setdefault('frameSize', (0, self.Width, 0, self.Height))
DirectFrame.__init__(self)
self.initialiseoptions(ShipPanel)
gui = loader.loadModel('models/gui/toplevel_gui')
chestIcon = gui.find('**/icon_crate')
cannonIcon = gui.find('**/topgui_icon_ship_cannon_single')
broadsideIcon = gui.find('**/topgui_icon_ship_cannon_multiple')
self.bottleFrame = ShipFrameBottle(parent = self, shipId = shipId, relief = None, state = DGG.DISABLED, pos = (0.074999999999999997, 0, 0.75), scale = 0.83499999999999996)
ornament = loader.loadModel('models/gui/gui_ship_window')
ornament.reparentTo(self)
ornament.setScale(0.29999999999999999)
ornament.setPos(0.54000000000000004, 0, 0.72999999999999998)
ornament.flattenStrong()
self.nameLabel = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = PLocalizer.makeHeadingString(PLocalizer.EmptyBottle, 2), text_fg = PiratesGuiGlobals.TextFG1, text_scale = PiratesGuiGlobals.TextScaleTitleSmall, text_align = TextNode.ACenter, text_shadow = (0, 0, 0, 1), text_wordwrap = 30, textMayChange = 1, text_font = PiratesGlobals.getPirateFont(), pos = (0.55000000000000004, 0, 1.22))
self.classLabel = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = PLocalizer.makeHeadingString(PLocalizer.EmptyBottleDesc, 1), text_scale = PiratesGuiGlobals.TextScaleMed, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = (0, 0, 0, 1), text_wordwrap = 30, textMayChange = 1, text_font = PiratesGlobals.getInterfaceFont(), pos = (0.55000000000000004, 0, 1.1799999999999999))
self.timer = PiratesTimer.PiratesTimer(showMinutes = True, mode = None, titleText = '', titleFg = '', infoText = '', cancelText = '', cancelCallback = None)
self.timer.setFontColor(PiratesGuiGlobals.TextFG2)
self.timer.reparentTo(self)
self.timer.setPos(0.45000000000000001, 0, 0.93999999999999995)
self.timer.setScale(0.59999999999999998)
self.timer.stash()
self.hpMeter = DirectWaitBar(parent = self, relief = DGG.RAISED, state = DGG.DISABLED, range = 1, value = 0, frameColor = (0.0, 0.0, 0.0, 0.0), barColor = (0.10000000000000001, 0.69999999999999996, 0.10000000000000001, 1), frameSize = (0, 0.31, 0, 0.018599999999999998), text = '', text_align = TextNode.ARight, text_scale = 0.029999999999999999, text_fg = (1, 1, 1, 1), text_shadow = (0, 0, 0, 1), text_pos = (0.29999999999999999, 0.029999999999999999), pos = (0.36099999999999999, 0.0, 0.621), scale = 1.2)
hpLabel = DirectLabel(parent = self.hpMeter, relief = None, state = DGG.DISABLED, text = PLocalizer.HP, text_scale = 0.029999999999999999, text_align = TextNode.ALeft, text_pos = (0.014999999999999999, 0.029999999999999999), text_fg = (1, 1, 1, 1), text_shadow = (0, 0, 0, 1))
self.speedMeter = DirectWaitBar(parent = self, relief = DGG.RAISED, state = DGG.DISABLED, range = 1, value = 0, frameColor = (0.0, 0.0, 0.0, 0.0), barColor = (0.69999999999999996, 0.69999999999999996, 0.10000000000000001, 1), frameSize = (0, 0.31, 0, 0.018599999999999998), text = '', text_align = TextNode.ARight, text_scale = 0.029999999999999999, text_fg = (1, 1, 1, 1), text_shadow = (0, 0, 0, 1), text_pos = (0.29999999999999999, 0.029999999999999999), pos = (0.36099999999999999, 0.0, 0.55000000000000004), scale = 1.2)
speedLabel = DirectLabel(parent = self.speedMeter, relief = None, state = DGG.DISABLED, text = PLocalizer.Speed, text_scale = 0.029999999999999999, text_align = TextNode.ALeft, text_pos = (0.014999999999999999, 0.029999999999999999), text_fg = (1, 1, 1, 1), text_shadow = (0, 0, 0, 1))
textPos = (0.0, -0.16)
self.plunderLimit = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, geom = chestIcon, geom_scale = 0.10000000000000001, text = '', text_scale = 0.044999999999999998, text_align = TextNode.ACenter, text_pos = textPos, text_fg = (1, 1, 1, 1), text_shadow = (0, 0, 0, 1), textMayChange = 1, text_font = PiratesGlobals.getInterfaceOutlineFont(), pos = (0.20000000000000001, 0, 0.31))
plunderLabel = DirectLabel(parent = self.plunderLimit, relief = None, state = DGG.DISABLED, text = PLocalizer.Cargo, text_scale = 0.035999999999999997, text_align = TextNode.ACenter, text_pos = (0, 0.14999999999999999), text_fg = (1, 1, 1, 1), text_shadow = (0, 0, 0, 1))
self.cannonLimit = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, geom = cannonIcon, geom_scale = 0.45000000000000001, text = '', text_scale = 0.044999999999999998, text_align = TextNode.ACenter, text_pos = textPos, text_fg = (1, 1, 1, 1), text_shadow = (0, 0, 0, 1), textMayChange = 1, text_font = PiratesGlobals.getInterfaceOutlineFont(), pos = (0.37, 0, 0.31))
cannonLabel = DirectLabel(parent = self.cannonLimit, relief = None, state = DGG.DISABLED, text = PLocalizer.Cannon, text_scale = 0.035999999999999997, text_align = TextNode.ACenter, text_pos = (0, 0.14999999999999999), text_fg = (1, 1, 1, 1), text_shadow = (0, 0, 0, 1))
self.broadsideLeftLimit = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, geom = broadsideIcon, geom_scale = (-0.45000000000000001, 0.45000000000000001, 0.45000000000000001), text = '', text_scale = 0.044999999999999998, text_align = TextNode.ACenter, text_pos = textPos, text_fg = (1, 1, 1, 1), text_shadow = (0, 0, 0, 1), textMayChange = 1, text_font = PiratesGlobals.getInterfaceOutlineFont(), pos = (0.73999999999999999, 0, 0.31))
self.broadsideRightLimit = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, geom = broadsideIcon, geom_scale = 0.45000000000000001, text = '', text_scale = 0.044999999999999998, text_align = TextNode.ACenter, text_pos = textPos, text_fg = (1, 1, 1, 1), text_shadow = (0, 0, 0, 1), textMayChange = 1, text_font = PiratesGlobals.getInterfaceOutlineFont(), pos = (0.88500000000000001, 0, 0.31))
broadsideLabel = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = PLocalizer.Broadsides, text_scale = 0.035999999999999997, text_align = TextNode.ACenter, text_fg = (1, 1, 1, 1), text_shadow = (0, 0, 0, 1), pos = (0.81000000000000005, 0, 0.46000000000000002))
crewLabel = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = PLocalizer.Crew, text_scale = 0.035999999999999997, text_align = TextNode.ALeft, text_pos = (0.47499999999999998, 0.46000000000000002), text_fg = (1, 1, 1, 1), text_shadow = (0, 0, 0, 1))
self.crewLimit = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = '', text_scale = 0.044999999999999998, text_align = TextNode.ACenter, text_pos = (0.56000000000000005, 0.14999999999999999), text_fg = (1, 1, 1, 1), text_shadow = (0, 0, 0, 1), textMayChange = 1, text_font = PiratesGlobals.getInterfaceOutlineFont())
shipOV = base.cr.getOwnerView(self.shipId)
if shipOV:
self.setShipName(shipOV.name)
self.setShipClass(shipOV.shipClass)
self.setShipHp(shipOV.Hp, shipOV.maxHp)
self.setShipSp(shipOV.Sp, shipOV.maxSp)
self.setShipCrew(shipOV.crew, shipOV.maxCrew)
self.setShipCargo([], shipOV.maxCargo)
if hasattr(shipOV, 'cannonConfig'):
self.setShipMaxCannons(shipOV.cannonConfig)
self.setShipMaxLeftBroadside(shipOV.lBroadsideConfig)
self.setShipMaxRightBroadside(shipOV.rBroadsideConfig)
self.accept('setName-%s' % self.shipId, self.setShipName)
self.accept('setShipClass-%s' % self.shipId, self.setShipClass)
self.accept('setShipHp-%s' % self.shipId, self.setShipHp)
self.accept('setShipSp-%s' % self.shipId, self.setShipSp)
self.accept('setShipCargo-%s' % self.shipId, self.setShipCargo)
self.accept('setShipCrew-%s' % self.shipId, self.setShipCrew)
self.accept('setShipTimer-%s' % self.shipId, self.setShipTimer)
self.accept('setHullCannonConfig-%s' % self.shipId, self.setShipMaxCannons)
self.accept('setHullLeftBroadsideConfig-%s' % self.shipId, self.setShipMaxLeftBroadside)
self.accept('setHullRightBroadsideConfig-%s' % self.shipId, self.setShipMaxRightBroadside)
if base.config.GetBool('want-deploy-button', 0):
pass
1
示例14: setCategory
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import makeHeadingString [as 别名]
def setCategory(self, category):
self.category = category
name = PLocalizer.makeHeadingString(self.getCategoryName(), 2)
self.categoryLabel["text"] = name
示例15: createGui
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import makeHeadingString [as 别名]
def createGui(self):
ShipFrame.createGui(self)
self.nameLabel = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = PLocalizer.makeHeadingString(self['shipName'], 2), text_align = TextNode.ALeft, text_scale = 0.050000000000000003, text_pos = (0.059999999999999998, 0.014999999999999999), text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, textMayChange = 1, frameColor = PiratesGuiGlobals.ButtonColor1[3], frameSize = (self['frameSize'][0] + 0.040000000000000001, self['frameSize'][1] - 0.029999999999999999, -0.0, 0.050000000000000003), pos = (0, 0, self['frameSize'][3] - 0.089999999999999997))
self.classLabel = DirectLabel(parent = self.nameLabel, relief = None, state = DGG.DISABLED, text = PLocalizer.makeHeadingString(PLocalizer.ShipClassNames.get(self['shipClass']), 1), text_font = PiratesGlobals.getInterfaceFont(), text_scale = PiratesGuiGlobals.TextScaleMed, text_align = TextNode.ALeft, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = (0, 0, 0, 1), textMayChange = 1, text_pos = (self.nameLabel['frameSize'][0] + 0.02, -0.029999999999999999))
self.typeLabel = DirectLabel(parent = self.nameLabel, relief = None, state = DGG.DISABLED, text = '', text_pos = (0.59999999999999998, -0.029999999999999999), text_font = PiratesGlobals.getInterfaceFont(), text_scale = 0.032000000000000001, text_align = TextNode.ARight, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = (0, 0, 0, 1), textMayChange = 0)
self.stateLabel = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = '', text_font = PiratesGlobals.getInterfaceFont(), text_align = TextNode.ALeft, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = (0, 0, 0, 1), text_pos = (0.19, 0.070000000000000007), text_scale = PiratesGuiGlobals.TextScaleLarge, textMayChange = 0)
gui = loader.loadModel('models/gui/toplevel_gui')
geomCheck = gui.find('**/generic_check')
self.button = GuiButton(parent = self, pos = (0.73999999999999999, 0, 0.080000000000000002), text = PLocalizer.SelectShip, text_scale = PiratesGuiGlobals.TextScaleLarge, text_font = PiratesGlobals.getInterfaceFont(), text_pos = (0.035000000000000003, -0.014), geom = (geomCheck,) * 4, geom_pos = (-0.059999999999999998, 0, 0), geom_scale = 0.5, geom0_color = PiratesGuiGlobals.ButtonColor6[0], geom1_color = PiratesGuiGlobals.ButtonColor6[1], geom2_color = PiratesGuiGlobals.ButtonColor6[2], geom3_color = PiratesGuiGlobals.ButtonColor6[3], image3_color = (0.80000000000000004, 0.80000000000000004, 0.80000000000000004, 1), helpPos = (-0.40000000000000002, 0, 0.029999999999999999), helpDelay = 0.29999999999999999, command = self['command'], extraArgs = self['extraArgs'])