Esempio n. 1
0
    def OnSelectItemSlot(self, selectedSlotPos):

        isAttached = mouseModule.mouseController.isAttached()
        if isAttached:
            snd.PlaySound("sound/ui/loginfail.wav")
            mouseModule.mouseController.DeattachObject()

        else:
            if not selectedSlotPos in self.itemStock:
                return

            invenType, invenPos = self.itemStock[selectedSlotPos]
            shop.DelPrivateShopItemStock(invenType, invenPos)
            snd.PlaySound("sound/ui/drop.wav")

            if app.ENABLE_SLOT_MARKING_SYSTEM:
                (itemInvenPage,
                 itemSlotPos) = self.lockedItems[selectedSlotPos]
                if itemInvenPage == self.wndInventory.GetInventoryPageIndex():
                    self.wndInventory.wndItem.SetCanMouseEventSlot(itemSlotPos)

                self.lockedItems[selectedSlotPos] = (-1, -1)

            del self.itemStock[selectedSlotPos]

            self.Refresh()
    def AcceptInputPrice(self):

        if not self.priceInputBoard:
            return True

        text = self.priceInputBoard.GetText()

        if not text:
            return True

        if not text.isdigit():
            return True

        if int(text) <= 0:
            return True

        attachedInvenType = self.priceInputBoard.sourceWindowType
        sourceSlotPos = self.priceInputBoard.sourceSlotPos
        targetSlotPos = self.priceInputBoard.targetSlotPos

        for privatePos, (itemWindowType,
                         itemSlotIndex) in self.itemStock.items():
            if itemWindowType == attachedInvenType and itemSlotIndex == sourceSlotPos:
                shop.DelPrivateShopItemStock(itemWindowType, itemSlotIndex)
                del self.itemStock[privatePos]

        price = int(self.priceInputBoard.GetText())

        if IsPrivateShopItemPriceList():
            SetPrivateShopItemPrice(self.priceInputBoard.itemVNum, price)

        shop.AddPrivateShopItemStock(attachedInvenType, sourceSlotPos,
                                     targetSlotPos, price)
        count = player.GetItemCount(attachedInvenType, sourceSlotPos)
        vnum = player.GetItemIndex(attachedInvenType, sourceSlotPos)
        self.SaveFilePrice(vnum, count, price)
        self.itemStock[targetSlotPos] = (attachedInvenType, sourceSlotPos)
        snd.PlaySound("sound/ui/drop.wav")

        self.Refresh()

        #####

        self.priceInputBoard = None
        return True
Esempio n. 3
0
    def OnSelectItemSlot(self, selectedSlotPos):

        isAttached = mouseModule.mouseController.isAttached()
        if isAttached:
            snd.PlaySound("sound/ui/loginfail.wav")
            mouseModule.mouseController.DeattachObject()

        else:
            if not selectedSlotPos in self.itemStock:
                return

            invenType, invenPos = self.itemStock[selectedSlotPos]
            shop.DelPrivateShopItemStock(invenType, invenPos)
            snd.PlaySound("sound/ui/drop.wav")

            del self.itemStock[selectedSlotPos]

            self.Refresh()
Esempio n. 4
0
	def OnSelectItemSlot(self, selectedSlotPos):
		import constInfo, chat
		if constInfo.BlockItemsSystem["Block"] == 1:
			chat.AppendChat(1, "Sicherheitssystem Aktiviert.")
			return

		isAttached = mouseModule.mouseController.isAttached()
		if isAttached:
			snd.PlaySound("sound/ui/loginfail.wav")
			mouseModule.mouseController.DeattachObject()

		else:
			if not selectedSlotPos in self.itemStock:
				return

			invenType, invenPos = self.itemStock[selectedSlotPos]
			shop.DelPrivateShopItemStock(invenType, invenPos)
			snd.PlaySound("sound/ui/drop.wav")

			del self.itemStock[selectedSlotPos]

			self.Refresh()
Esempio n. 5
0
    def AcceptInputPrice(self):

        if not self.priceInputBoard:
            return True

        if app.ENABLE_OFFLINE_SHOP:
            if self.type:
                text = self.priceInputBoard.GetTextPrice1()
                textpricetwo = self.priceInputBoard.GetTextPrice2()
                textpricethree = self.priceInputBoard.GetTextPrice3()
                textpricefour = self.priceInputBoard.GetTextPrice4()
            else:
                text = self.priceInputBoard.GetText()

            if not text:
                self.PopupMsg("Please input price values")
                return True

            if not text.isdigit():
                self.PopupMsg("Please input only number to prices")
                return True
            if self.type:
                if not textpricetwo.isdigit() or not textpricethree.isdigit(
                ) or not textpricefour.isdigit():
                    self.PopupMsg("Please input price values")
                    return True

            if not self.type and int(text) <= 0:
                self.PopupMsg("Please input just only positive price")
                return True
            if self.type:
                if int(textpricetwo) < 0 or int(textpricethree) < 0 or int(
                        textpricefour) < 0:
                    self.PopupMsg("Please input just positive price")
                    return True

                if int(text) == 0 and int(textpricetwo) == 0 and int(
                        textpricethree) == 0 and int(textpricefour) == 0:
                    self.PopupMsg("Please input price values")
                    return True

                if self.priceInputBoard.itemVNum == 80007 and int(
                        textpricethree) > 0:
                    self.PopupMsg("You cannot sell gold bar with gold bar")
                    return True
        else:
            text = self.priceInputBoard.GetText()

            if not text:
                return True

            if not text.isdigit():
                return True

            if int(text) <= 0:
                return True

        attachedInvenType = self.priceInputBoard.sourceWindowType
        sourceSlotPos = self.priceInputBoard.sourceSlotPos
        targetSlotPos = self.priceInputBoard.targetSlotPos

        for privatePos, (itemWindowType,
                         itemSlotIndex) in self.itemStock.items():
            if itemWindowType == attachedInvenType and itemSlotIndex == sourceSlotPos:
                shop.DelPrivateShopItemStock(itemWindowType, itemSlotIndex)
                del self.itemStock[privatePos]

        if app.ENABLE_OFFLINE_SHOP:
            if self.type:
                price = int(self.priceInputBoard.GetTextPrice1())
                price_two = int(self.priceInputBoard.GetTextPrice2())
                price_three = int(self.priceInputBoard.GetTextPrice3())
                price_four = int(self.priceInputBoard.GetTextPrice4())
            else:
                price = int(self.priceInputBoard.GetText())
        else:
            price = int(self.priceInputBoard.GetText())

        if IsPrivateShopItemPriceList():
            SetPrivateShopItemPrice(self.priceInputBoard.itemVNum, price)

        if app.ENABLE_OFFLINE_SHOP:
            if self.type:
                if not constInfo.SHOP_ALLOW_COIN:
                    price_two = 0
                if not constInfo.SHOP_ALLOW_GOLDBAR:
                    price_three = 0
                if not constInfo.SHOP_ALLOW_WON:
                    price_four = 0

                wonFlag = 0
                try:
                    wonFlag = app.ENABLE_CHEQUE_SYSTEM
                except:
                    pass
                if not wonFlag:
                    price_four = 0

            if self.type:
                shop.AddPrivateShopItemStock(attachedInvenType, sourceSlotPos,
                                             targetSlotPos, price, price_two,
                                             price_three, price_four)
            else:
                shop.AddPrivateShopItemStock(attachedInvenType, sourceSlotPos,
                                             targetSlotPos, price)
        else:
            shop.AddPrivateShopItemStock(attachedInvenType, sourceSlotPos,
                                         targetSlotPos, price)

        self.itemStock[targetSlotPos] = (attachedInvenType, sourceSlotPos)
        snd.PlaySound("sound/ui/drop.wav")

        self.Refresh()

        #####
        if app.ENABLE_OFFLINE_SHOP:
            self.priceInputBoard.Close()
        self.priceInputBoard = None
        return True