Advertisement
Guest User

Untitled

a guest
Oct 4th, 2015
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.23 KB | None | 0 0
  1.     def SelectItemSlot(self, itemSlotIndex):
  2.         if constInfo.GET_ITEM_DROP_QUESTION_DIALOG_STATUS() == 1:
  3.             return
  4.  
  5.         itemSlotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(itemSlotIndex)
  6.  
  7.         if mouseModule.mouseController.isAttached():
  8.             attachedSlotType = mouseModule.mouseController.GetAttachedType()
  9.             attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  10.             attachedItemVID = mouseModule.mouseController.GetAttachedItemIndex()
  11.            
  12.             itemVnum = player.GetItemIndex(itemSlotIndex)
  13.             item.SelectItem(itemVnum)
  14.             itemType = item.GetItemType()
  15.             itemSubType = item.GetItemSubType()
  16.            
  17.             nook = 0
  18.             if itemType == 2 and itemSubType != 0:
  19.                 nook = 1
  20.             if attachedItemVID == 25100 and itemType >= 1 and itemType <= 2 and nook != 1:
  21.                 x = 0
  22.                 Slots = [player.GetItemMetinSocket(itemSlotIndex, i) for i in xrange(player.METIN_SOCKET_MAX_NUM)]
  23.                 for i in xrange(player.METIN_SOCKET_MAX_NUM):
  24.                     if Slots[i] > 20000:
  25.                         x += 1
  26.                 if x > 0:
  27.                     self.uiSpiritStone = uiSpiritStone.Wyciaganie()
  28.                     self.uiSpiritStone.SetData(itemSlotIndex)
  29.                     self.uiSpiritStone.SetCenterPosition()
  30.                     self.uiSpiritStone.Show_NOW()
  31.                     mouseModule.mouseController.DeattachObject()
  32.                     return
  33.                 if x == 0:
  34.                     chat.AppendChat(chat.CHAT_TYPE_INFO, "[Wyciaganie Kamieni Dusz] Ten przedmiot nie posiada Kamieni Dusz!")
  35.                     mouseModule.mouseController.DeattachObject()
  36.                     return
  37.             if player.SLOT_TYPE_INVENTORY == attachedSlotType:
  38.                 self.__DropSrcItemToDestItemInInventory(attachedItemVID, attachedSlotPos, itemSlotIndex)
  39.  
  40.             mouseModule.mouseController.DeattachObject()
  41.  
  42.         else:
  43.  
  44.             curCursorNum = app.GetCursor()
  45.             if app.SELL == curCursorNum:
  46.                 self.__SellItem(itemSlotIndex)
  47.                
  48.             elif app.BUY == curCursorNum:
  49.                 chat.AppendChat(chat.CHAT_TYPE_INFO, locale.SHOP_BUY_INFO)
  50.  
  51.             elif app.IsPressed(app.DIK_LALT):
  52.                 link = player.GetItemLink(itemSlotIndex)
  53.                 ime.PasteString(link)
  54.  
  55.             elif app.IsPressed(app.DIK_LSHIFT):
  56.                 itemCount = player.GetItemCount(itemSlotIndex)
  57.                
  58.                 if itemCount > 1:
  59.                     self.dlgPickMoney.SetTitleName(locale.PICK_ITEM_TITLE)
  60.                     self.dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickItem))
  61.                     self.dlgPickMoney.Open(itemCount)
  62.                     self.dlgPickMoney.itemGlobalSlotIndex = itemSlotIndex
  63.                 #else:
  64.                     #selectedItemVNum = player.GetItemIndex(itemSlotIndex)
  65.                     #mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum)
  66.  
  67.             elif app.IsPressed(app.DIK_LCONTROL):
  68.                 itemIndex = player.GetItemIndex(itemSlotIndex)
  69.  
  70.                 if TRUE == item.CanAddToQuickSlotItem(itemIndex):
  71.                     player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_INVENTORY, itemSlotIndex)
  72.                 else:
  73.                     chat.AppendChat(chat.CHAT_TYPE_INFO, locale.QUICKSLOT_REGISTER_DISABLE_ITEM)
  74.  
  75.             else:
  76.                 selectedItemVNum = player.GetItemIndex(itemSlotIndex)
  77.                 itemCount = player.GetItemCount(itemSlotIndex)
  78.                 mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
  79.                
  80.                 if self.__IsUsableItemToItem(selectedItemVNum, itemSlotIndex):             
  81.                     self.wndItem.SetUseMode(TRUE)
  82.                 else:                  
  83.                     self.wndItem.SetUseMode(FALSE)
  84.  
  85.                 snd.PlaySound("sound/ui/pick.wav")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement