Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.14 KB | None | 0 0
  1.     def RefreshBagSlotWindow(self):
  2.         getItemVNum=player.GetItemIndex
  3.         getItemCount=player.GetItemCount
  4.         setItemVNum=self.wndItem.SetItemSlot
  5.        
  6.         for i in xrange(player.INVENTORY_PAGE_SIZE):
  7.             slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)
  8.            
  9.             itemCount = getItemCount(slotNumber)
  10.             if 0 == itemCount:
  11.                 self.wndItem.ClearSlot(i)
  12.                 continue
  13.             elif 1 == itemCount:
  14.                 itemCount = 0
  15.                
  16.             itemVnum = getItemVNum(slotNumber)
  17.             setItemVNum(i, itemVnum, itemCount)
  18.    
  19.             if constInfo.IS_AUTO_POTION(itemVnum):
  20.                 metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]  
  21.                
  22.                 if slotNumber >= player.INVENTORY_PAGE_SIZE*self.inventoryPageIndex:
  23.                     slotNumber -= player.INVENTORY_PAGE_SIZE*self.inventoryPageIndex
  24.                    
  25.                 isActivated = 0 != metinSocket[0]
  26.                
  27.                 if isActivated:
  28.                     self.wndItem.ActivateSlotOld(slotNumber)
  29.                     potionType = 0;
  30.                     if constInfo.IS_AUTO_POTION_HP(itemVnum):
  31.                         potionType = player.AUTO_POTION_TYPE_HP
  32.                     elif constInfo.IS_AUTO_POTION_SP(itemVnum):
  33.                         potionType = player.AUTO_POTION_TYPE_SP                    
  34.                    
  35.                     usedAmount = int(metinSocket[1])
  36.                     totalAmount = int(metinSocket[2])                  
  37.                     player.SetAutoPotionInfo(potionType, isActivated, (totalAmount - usedAmount), totalAmount, self.__InventoryLocalSlotPosToGlobalSlotPos(i))
  38.                    
  39.                 else:
  40.                     self.wndItem.DeactivateSlotOld(slotNumber)         
  41.            
  42.             if app.ENABLE_SASH_SYSTEM:
  43.                 slotNumberChecked = 0
  44.                 if not constInfo.IS_AUTO_POTION(itemVnum):
  45.                     self.wndItem.DeactivateSlot(i)
  46.                
  47.                 for j in xrange(sash.WINDOW_MAX_MATERIALS):
  48.                     (isHere, iCell) = sash.GetAttachedItem(j)
  49.                     if isHere:
  50.                         if iCell == slotNumber:
  51.                             self.wndItem.ActivateSlot(i, (36.00 / 255.0), (222.00 / 255.0), (3.00 / 255.0), 1.0)
  52.                             if not slotNumber in self.listAttachedSashs:
  53.                                 self.listAttachedSashs.append(slotNumber)
  54.                            
  55.                             slotNumberChecked = 1
  56.                     else:
  57.                         if slotNumber in self.listAttachedSashs and not slotNumberChecked:
  58.                             self.wndItem.DeactivateSlot(i)
  59.                             self.listAttachedSashs.remove(slotNumber)
  60.  
  61.         self.wndItem.RefreshSlot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement