Пример #1
0
    def AskBuyItem(self, slotPos):
        if not app.ENABLE_OFFLINE_SHOP:
            slotPos = self.__GetRealIndex(slotPos)

        itemIndex = shop.GetItemID(slotPos)
        itemPrice = shop.GetItemPrice(slotPos)
        if app.ENABLE_OFFLINE_SHOP:
            itemPriceTwo = shop.GetItemPrice2(slotPos)
            itemPriceThree = shop.GetItemPrice3(slotPos)
            itemPriceFour = shop.GetItemPrice4(slotPos)
        itemCount = shop.GetItemCount(slotPos)

        item.SelectItem(itemIndex)
        itemName = item.GetItemName()

        if app.ENABLE_OFFLINE_SHOP:
            if not itemPriceTwo and not itemPriceThree and not itemPriceFour:
                itemBuyQuestionDialog = uiCommon.QuestionDialog()
                itemBuyQuestionDialog.SetText(
                    localeInfo.DO_YOU_BUY_ITEM(itemName, itemCount, itemPrice))
            else:
                itemBuyQuestionDialog = uiCommon.QuestionDialog2()
                itemBuyQuestionDialog.SetText1(
                    localeInfo.DO_YOU_BUY_ITEM_NEW(
                        itemName, itemCount,
                        localeInfo.NumberToMoneyString(itemPrice),
                        localeInfo.NumberToPriceString(itemPriceTwo, "Coin"),
                        localeInfo.NumberToPriceString(itemPriceThree,
                                                       "Goldbar"),
                        localeInfo.NumberToPriceString(itemPriceFour,
                                                       "Won"))[0])
                itemBuyQuestionDialog.SetText2(
                    localeInfo.DO_YOU_BUY_ITEM_NEW(
                        itemName, itemCount,
                        localeInfo.NumberToMoneyString(itemPrice),
                        localeInfo.NumberToPriceString(itemPriceTwo, "Coin"),
                        localeInfo.NumberToPriceString(itemPriceThree,
                                                       "Goldbar"),
                        localeInfo.NumberToPriceString(itemPriceFour,
                                                       "Won"))[1])
        else:
            itemBuyQuestionDialog = uiCommon.QuestionDialog()
            itemBuyQuestionDialog.SetText(
                localeInfo.DO_YOU_BUY_ITEM(
                    itemName, itemCount,
                    localeInfo.NumberToMoneyString(itemPrice)))

        itemBuyQuestionDialog.SetAcceptEvent(
            lambda arg=True: self.AnswerBuyItem(arg))
        itemBuyQuestionDialog.SetCancelEvent(
            lambda arg=False: self.AnswerBuyItem(arg))
        if app.ENABLE_OFFLINE_SHOP:
            if itemPriceTwo or itemPriceThree or itemPriceFour:
                itemBuyQuestionDialog.SetWidth(550)
        itemBuyQuestionDialog.Open()
        itemBuyQuestionDialog.pos = slotPos
        self.itemBuyQuestionDialog = itemBuyQuestionDialog

        constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
Пример #2
0
 def ScanShop(self, vid):
     self.numShopsSearched += 1
     chr.SelectInstance(vid)
     for x in range(0, self.SLOT_COUNT * shop.GetTabCount()):
         id = shop.GetItemID(x)
         if id != 0:
             price = shop.GetItemPrice(x)
             name = item.GetItemNameByVnum(id)
             if id == 50300:
                 sk = shop.GetItemMetinSocket(x, 0)
                 skill_name = str(skill.GetSkillName(sk))
                 name = str(skill_name) + " " + name
             count = shop.GetItemCount(x)
             it = self.Item(name, vid, count, price, x,
                            shop.GetItemCheque(x))
             self.Items.append(it)
     self.UpdateLabelText()
Пример #3
0
    def AskBuyItem(self, slotPos):
        slotPos = self.__GetRealIndex(slotPos)

        itemIndex = shop.GetItemID(slotPos)
        itemPrice = shop.GetItemPrice(slotPos)
        itemCount = shop.GetItemCount(slotPos)

        item.SelectItem(itemIndex)
        itemName = item.GetItemName()

        itemBuyQuestionDialog = uiCommon.QuestionDialog()
        itemBuyQuestionDialog.SetText(
            locale.DO_YOU_BUY_ITEM(itemName, itemCount,
                                   locale.NumberToMoneyString(itemPrice)))
        itemBuyQuestionDialog.SetAcceptEvent(
            lambda arg=TRUE: self.AnswerBuyItem(arg))
        itemBuyQuestionDialog.SetCancelEvent(
            lambda arg=FALSE: self.AnswerBuyItem(arg))
        itemBuyQuestionDialog.Open()
        itemBuyQuestionDialog.pos = slotPos
        self.itemBuyQuestionDialog = itemBuyQuestionDialog
    def AskBuyItem(self, slotPos):
        slotPos = self.__GetRealIndex(slotPos)

        itemIndex = shop.GetItemID(slotPos)
        itemPrice = shop.GetItemPrice(slotPos)
        itemCount = shop.GetItemCount(slotPos)

        item.SelectItem(itemIndex)
        itemName = item.GetItemName()

        itemBuyQuestionDialog = uiCommon.QuestionDialog()
        itemBuyQuestionDialog.SetText(
            localeInfo.DO_YOU_BUY_ITEM(
                itemName, itemCount,
                localeInfo.NumberToMoneyString(itemPrice)))
        itemBuyQuestionDialog.SetAcceptEvent(
            lambda arg=True: self.AnswerBuyItem(arg))
        itemBuyQuestionDialog.SetCancelEvent(
            lambda arg=False: self.AnswerBuyItem(arg))
        itemBuyQuestionDialog.Open()
        itemBuyQuestionDialog.pos = slotPos
        self.itemBuyQuestionDialog = itemBuyQuestionDialog

        constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)