Пример #1
0
 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])
 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])
Пример #3
0
 def createGui(self):
     item, quantity = self.data
     name = PLocalizer.InventoryTypeNames[item]
     self.price = EconomyGlobals.getItemCost(item)
     repId = InventoryType.SailingRep
     itemTypeName = PLocalizer.InventoryTypeNames.get(repId)
     self.itemType = itemTypeName
     if self.sell:
         self.price /= 2
     card = loader.loadModel('models/textureCards/shipCatalog')
     renderName = self.shipImageDict.get(item, 'Catalog_War_Brig')
     myTexCard = card.find('**/%s*' % renderName)
     myTex = myTexCard.findAllTextures()[0]
     card.removeNode()
     del card
     self.minLvl = EconomyGlobals.getItemMinLevel(item)
     self.miscText = None
     self.picture = DirectFrame(parent=self, relief=None, state=DGG.DISABLED, image=myTex, image_scale=(0.07,
                                                                                                        1.0,
                                                                                                        0.06))
     self.picture.setPos(0.1, 0, 0.08)
     self.picture.setTransparency(1)
     self.nameTag = DirectLabel(parent=self, state=DGG.DISABLED, relief=None, text=name, text_scale=PiratesGuiGlobals.TextScaleMed * PLocalizer.getHeadingScale(2), text_align=TextNode.ALeft, text_fg=PiratesGuiGlobals.TextFG1, text_shadow=PiratesGuiGlobals.TextShadow, textMayChange=0)
     self.nameTag.setPos(0.2, 0, 0.1)
     self.costText = DirectLabel(parent=self, relief=None, state=DGG.DISABLED, geom=self.coinImage, geom_scale=0.12, geom_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.03, 0, 0), text_font=PiratesGlobals.getInterfaceFont())
     self.costText.setPos(0.48, 0, 0.04)
     return
Пример #4
0
    def createGui(self):
        (item, quantity) = self.data
        name = PLocalizer.InventoryTypeNames[item]
        self.price = EconomyGlobals.getItemCost(item)
        repId = InventoryType.SailingRep
        itemTypeName = PLocalizer.InventoryTypeNames.get(repId)
        self.itemType = itemTypeName
        if self.sell:
            self.price /= 2

        card = loader.loadModel("models/textureCards/shipCatalog")
        renderName = self.shipImageDict.get(item, "Catalog_War_Brig")
        myTexCard = card.find("**/%s*" % renderName)
        myTex = myTexCard.findAllTextures()[0]
        card.removeNode()
        del card
        self.minLvl = EconomyGlobals.getItemMinLevel(item)
        self.miscText = None
        self.picture = DirectFrame(
            parent=self,
            relief=None,
            state=DGG.DISABLED,
            image=myTex,
            image_scale=(0.070000000000000007, 1.0, 0.059999999999999998),
        )
        self.picture.setPos(0.10000000000000001, 0, 0.080000000000000002)
        self.picture.setTransparency(1)
        self.nameTag = DirectLabel(
            parent=self,
            state=DGG.DISABLED,
            relief=None,
            text=name,
            text_scale=PiratesGuiGlobals.TextScaleMed * PLocalizer.getHeadingScale(2),
            text_align=TextNode.ALeft,
            text_fg=PiratesGuiGlobals.TextFG1,
            text_shadow=PiratesGuiGlobals.TextShadow,
            textMayChange=0,
        )
        self.nameTag.setPos(0.20000000000000001, 0, 0.10000000000000001)
        self.costText = DirectLabel(
            parent=self,
            relief=None,
            state=DGG.DISABLED,
            geom=self.coinImage,
            geom_scale=0.12,
            geom_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),
            text_font=PiratesGlobals.getInterfaceFont(),
        )
        self.costText.setPos(0.47999999999999998, 0, 0.040000000000000001)
Пример #5
0
    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])
 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])
    def createGui(self):
        (item, quantity) = self.data
        name = PLocalizer.InventoryTypeNames[item]
        self.price = EconomyGlobals.getItemCost(item)
        repId = InventoryType.SailingRep
        itemTypeName = PLocalizer.InventoryTypeNames.get(repId)
        self.itemType = itemTypeName
        if self.sell:
            self.price /= 2

        card = loader.loadModel('models/textureCards/shipRenders')
        if item in [
            ItemId.INTERCEPTOR_L1,
            ItemId.INTERCEPTOR_L2,
            ItemId.INTERCEPTOR_L3]:
            myTexCard = card.find('**/Interceptor_Render*')
        elif item in [
            ItemId.MERCHANT_L1,
            ItemId.MERCHANT_L2,
            ItemId.MERCHANT_L3]:
            myTexCard = card.find('**/Merchant_Render*')
        elif item in [
            ItemId.WARSHIP_L1,
            ItemId.WARSHIP_L2,
            ItemId.WARSHIP_L3]:
            myTexCard = card.find('**/Warship_Render*')
        else:
            myTexCard = card.find('**/Warship_Render*')
        myTex = myTexCard.findAllTextures()[0]
        card.removeNode()
        del card
        self.minLvl = EconomyGlobals.getItemMinLevel(item)
        self.miscText = None
        self.picture = DirectFrame(parent = self, relief = None, state = DGG.DISABLED, image = myTex, image_scale = 0.059999999999999998, pos = (0.085000000000000006, 0, 0.074999999999999997))
        self.picture.setTransparency(1)
        self.nameTag = DirectLabel(parent = self, state = DGG.DISABLED, relief = None, text = name, text_scale = PiratesGuiGlobals.TextScaleMed * PLocalizer.getHeadingScale(2), text_align = TextNode.ALeft, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, pos = (0.16, 0, 0.105), textMayChange = 0)
        self.costText = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, geom = self.coinImage, geom_scale = 0.12, geom_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.105), text_font = PiratesGlobals.getInterfaceFont())
Пример #8
0
 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])
    def createGui(self):
        (item, quantity) = self.data
        name = PLocalizer.InventoryTypeNames[item]
        self.price = EconomyGlobals.getItemCost(item)
        repId = InventoryType.SailingRep
        itemTypeName = PLocalizer.InventoryTypeNames.get(repId)
        self.itemType = itemTypeName
        if self.sell:
            self.price /= 2

        card = loader.loadModel('models/textureCards/shipRenders')
        if item in [
                ItemId.INTERCEPTOR_L1, ItemId.INTERCEPTOR_L2,
                ItemId.INTERCEPTOR_L3
        ]:
            myTexCard = card.find('**/Interceptor_Render*')
        elif item in [
                ItemId.MERCHANT_L1, ItemId.MERCHANT_L2, ItemId.MERCHANT_L3
        ]:
            myTexCard = card.find('**/Merchant_Render*')
        elif item in [ItemId.WARSHIP_L1, ItemId.WARSHIP_L2, ItemId.WARSHIP_L3]:
            myTexCard = card.find('**/Warship_Render*')
        else:
            myTexCard = card.find('**/Warship_Render*')
        myTex = myTexCard.findAllTextures()[0]
        card.removeNode()
        del card
        self.minLvl = EconomyGlobals.getItemMinLevel(item)
        self.miscText = None
        self.picture = DirectFrame(parent=self,
                                   relief=None,
                                   state=DGG.DISABLED,
                                   image=myTex,
                                   image_scale=0.059999999999999998,
                                   pos=(0.085000000000000006, 0,
                                        0.074999999999999997))
        self.picture.setTransparency(1)
        self.nameTag = DirectLabel(parent=self,
                                   state=DGG.DISABLED,
                                   relief=None,
                                   text=name,
                                   text_scale=PiratesGuiGlobals.TextScaleMed *
                                   PLocalizer.getHeadingScale(2),
                                   text_align=TextNode.ALeft,
                                   text_fg=PiratesGuiGlobals.TextFG1,
                                   text_shadow=PiratesGuiGlobals.TextShadow,
                                   pos=(0.16, 0, 0.105),
                                   textMayChange=0)
        self.costText = DirectLabel(
            parent=self,
            relief=None,
            state=DGG.DISABLED,
            geom=self.coinImage,
            geom_scale=0.12,
            geom_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.105),
            text_font=PiratesGlobals.getInterfaceFont())
 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])