- Mesaj
- 207
- Çözümler
- 9
- Beğeni
- 69
- Puan
- 464
- Ticaret Puanı
- 0
şöyleki envanter tamamen dolduğunda 2. envantere geçiş yapmıyor ve şöyle bir uyarı veriyor
Kod:
PageItemSlot, iPos = self.GetGridCachePosItemID(size, items[index]["id"])
if iPos < 0:
chat.AppendChat(1, "Bazı itemler pazarda gösterilmeyebilir, bunun nedeni yetersiz alan olmasıdır..")
return
item yine ekleniyor ama 2. envanterde gözükmüyor 1. envanterden item satıldıkça açılan boşluğa item geliyor
bunun önüne geçmek için 2. envanter kısmını iptal etmek istiyorum ve 1. envanter dolduğunda envanter doldu diye bir uyarı versin
fakat bunu sadece python üzerinden yapmam yeterli olurmu ve nasıl bir yol izleyip nasıl bir değişiklik yapmam gerekiyor yardımcı olurmusunuz ?
ilgili olduunu düşündüğüm kod bloğu:
def RefreshItemSlot(self):
items = []
if self.wBoard[PAGE_MYSHOP].IsShow() or self.wBoard[PAGE_SHOP].IsShow():
items = self.wndShop.ShopItemForSale
elif self.wBoard[PAGE_SAFEBOX].IsShow():
items = self.wndShop.ShopSafeboxItems
for itemSlotIdx in xrange(len(self.itemSlot)):
for index in xrange(OFFLINESHOP_SLOT_COUNT):
self.itemSlot[itemSlotIdx].ClearSlot(index)
self.itemSlot[itemSlotIdx].ClearGrid()
self.itemSlot[itemSlotIdx].Hide()
self.itemSlot[self.PageGrid].Show()
TotalPrice = 0
self.itemStock = {}
if self.wBoard[PAGE_BUILDER].IsShow():
for page in xrange(1):
for i in xrange(OFFLINESHOP_SLOT_COUNT):
if not i in self.itemStockBuilder[page]:
self.itemSlot[page].ClearSlot(i)
continue
window, pos, price = self.itemStockBuilder[page][i]
vnum = player.GetItemIndex(window, pos)
if vnum <= 0:
continue
self.itemSlot[page].SetItemSlot(i, vnum, player.GetItemCount(window, pos))
item.SelectItem(vnum)
_, size = item.GetItemSize()
self.itemSlot[page].PutItemGrid(i, size)
self.itemSlot[self.PageGrid].RefreshSlot()
return
for index in xrange(len(items)):
itemVnum = items[index]["vnum"]
itemCount = items[index]["count"]
if itemVnum <= 0:
continue
item.SelectItem(itemVnum)
_, size = item.GetItemSize()
PageItemSlot, iPos = self.GetGridCachePosItemID(size, items[index]["id"])
if iPos < 0:
chat.AppendChat(1, "Bazı itemler pazarda gösterilmeyebilir, bunun nedeni yetersiz alan olmasıdır..")
return
self.itemSlot[PageItemSlot].PutItemGrid(iPos, size)
itemCountGrid = itemCount if itemCount > 1 else 0
self.itemSlot[PageItemSlot].SetItemSlot(iPos, itemVnum, itemCountGrid)
sockets = [items[index]["socket"][num] for num in xrange(player.METIN_SOCKET_MAX_NUM)]
attrs = [(items[index]["attr"][num]['type'], items[index]["attr"][num]['value']) for num in xrange(player.ATTRIBUTE_SLOT_MAX_NUM)]
ItemPrice = 0
if items[index].has_key("price"):
ItemPrice = int(items[index]["price"])
TotalPrice += int(items[index]["price"])
transmutation = 0
if items[index].has_key("trans"):
transmutation = items[index]["trans"]
if PageItemSlot == self.PageGrid:
self.itemStock[iPos] = (items[index]["id"], itemVnum, itemCount, transmutation, ItemPrice, sockets, attrs)
if not CACHE_ITEMS_ID.has_key(PageItemSlot):
CACHE_ITEMS_ID[PageItemSlot] = {}
CACHE_ITEMS_ID[PageItemSlot][items[index]["id"]] = iPos
self.wndTotalPrice.SetText("|cFFF1E6C0Toplam Kazanç: |cffffcc00" + str(localeInfo.NumberToMoneyString(TotalPrice)))
if self.PriceInputBoard and self.wBoard[PAGE_MYSHOP].IsShow():
CurrentPageGrid = self.PriceInputBoard.CurrentPageGrid
targetSlotPos = self.PriceInputBoard.targetSlotPos
isEditMode = self.PriceInputBoard.isEditMode
self.itemSlot[self.PageGrid].RefreshSlot()