def RefreshBagSlotWindow(self):
getItemVNum=player.GetItemIndex
getItemCount=player.GetItemCount
setItemVNum=self.wndItem.SetItemSlot
for i in xrange(player.INVENTORY_PAGE_SIZE):
slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)
itemCount = getItemCount(slotNumber)
# itemCount == 0ÀÌ¸é ¼ÒÄÏÀ» ºñ¿î´Ù.
if 0 == itemCount:
self.wndItem.ClearSlot(i)
continue
elif 1 == itemCount:
itemCount = 0
itemVnum = getItemVNum(slotNumber)
setItemVNum(i, itemVnum, itemCount)
if constInfo.IS_AUTO_POTION(itemVnum):
metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]
isActivated = 0 != metinSocket[0]
if isActivated:
self.wndItem.ActivateSlot(i)
potionType = 0
if constInfo.IS_AUTO_POTION_HP(itemVnum):
potionType = player.AUTO_POTION_TYPE_HP
elif constInfo.IS_AUTO_POTION_SP(itemVnum):
potionType = player.AUTO_POTION_TYPE_SP
usedAmount = int(metinSocket[1])
totalAmount = int(metinSocket[2])
player.SetAutoPotionInfo(potionType, isActivated, (totalAmount - usedAmount), totalAmount, self.__InventoryLocalSlotPosToGlobalSlotPos(i))
else:
self.wndItem.DeactivateSlot(i)
## ÀÚµ¿¹°¾à (HP: #72723 ~ #72726, SP: #72727 ~ #72730) Ư¼öó¸® - ¾ÆÀÌÅÛÀε¥µµ ½½·Ô¿¡ È°¼ºÈ/ºñÈ°¼ºÈ Ç¥½Ã¸¦ À§ÇÑ ÀÛ¾÷ÀÓ - [hyo]
# if constInfo.IS_AUTO_POTION(itemVnum):
# metinSocket - [0] : È°¼ºÈ ¿©ºÎ, [1] : »ç¿ëÇÑ ¾ç, [2] : ÃÖ´ë ¿ë·®
# metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]
# if slotNumber >= player.INVENTORY_PAGE_SIZE*self.inventoryPageIndex: #fixme auto pot
# slotNumber -= player.INVENTORY_PAGE_SIZE*self.inventoryPageIndex
# isActivated = 0 != metinSocket[0]
# if isActivated:
# self.wndItem.ActivateSlot(slotNumber)
# potionType = 0;
# if constInfo.IS_AUTO_POTION_HP(itemVnum):
# potionType = player.AUTO_POTION_TYPE_HP
# elif constInfo.IS_AUTO_POTION_SP(itemVnum):
# potionType = player.AUTO_POTION_TYPE_SP
# usedAmount = int(metinSocket[1])
# totalAmount = int(metinSocket[2])
# player.SetAutoPotionInfo(potionType, isActivated, (totalAmount - usedAmount), totalAmount, self.__InventoryLocalSlotPosToGlobalSlotPos(i))
# else:
# self.wndItem.DeactivateSlot(slotNumber)
if app.ENABLE_ACCE_SYSTEM:
slotNumberChecked = 0
if not constInfo.IS_AUTO_POTION(itemVnum):
if app.ENABLE_HIGHLIGHT_ITEM:
if not slotNumber in self.liHighlightedItems:
self.wndItem.DeactivateSlotOld(i)
else:
self.wndItem.DeactivateSlotOld(i)
for j in xrange(acce.WINDOW_MAX_MATERIALS):
(isHere, iCell) = acce.GetAttachedItem(j)
if isHere:
if iCell == slotNumber:
self.wndItem.ActivateSlot(i, (36.00 / 255.0), (222.00 / 255.0), (3.00 / 255.0), 1.0)
if not slotNumber in self.listAttachedAcces:
self.listAttachedAcces.append(slotNumber)
slotNumberChecked = 1
else:
if slotNumber in self.listAttachedAcces and not slotNumberChecked:
self.wndItem.DeactivateSlot(i)
self.listAttachedAcces.remove(slotNumber)
#elif app.ENABLE_HIGHLIGHT_NEW_ITEM and not constInfo.IS_AUTO_POTION(itemVnum):
#if not slotNumber in self.liHighlightedItems:
# self.wndItem.DeactivateSlot(i)
self.wndItem.RefreshSlot()
if app.ENABLE_HIGHLIGHT_ITEM:
self.__RefreshHighlights()
if self.wndBelt:
self.wndBelt.RefreshSlot()