Advertisement
Guest User

Fix for the Sash Resetting Scroll - Galet

a guest
Nov 11th, 2015
579
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.68 KB | None | 0 0
  1.     def DetachMetinFromItem(self, scrollSlotPos, targetSlotPos): ## Resetting Sash Stats Fix - Galet - 11/11/2015 - 17h45 - Tribute to the victims of the war
  2.         scrollIndex = player.GetItemIndex(scrollSlotPos)
  3.         targetIndex = player.GetItemIndex(targetSlotPos)
  4.  
  5.         for i in xrange(player.INVENTORY_PAGE_SIZE*2):
  6.             slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)
  7.             getItemVNum=player.GetItemIndex
  8.             itemVnum = getItemVNum(slotNumber)
  9.             if 85009 == itemVnum:
  10.                 item.SelectItem(targetIndex)
  11.                 if item.GetItemSubType() == item.COSTUME_TYPE_ACCE:
  12.                     if self.GetAcceAttribute(targetSlotPos) == 0:
  13.                         return
  14.                    
  15.                     self.questionDialog = uiCommon.QuestionDialog()
  16.                     self.questionDialog.SetText("Would you like to reset your sash shoulder stats?")
  17.                     self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnDetachMetinFromItem))
  18.                     self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  19.                     self.questionDialog.Open()
  20.                     self.questionDialog.sourcePos = scrollSlotPos
  21.                     self.questionDialog.targetPos = targetSlotPos
  22.                 else:
  23.                     return
  24.             else:
  25.                 if not player.CanDetach(scrollIndex, targetSlotPos):
  26.                     chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_METIN_INSEPARABLE_ITEM)
  27.                     return
  28.            
  29.                 self.questionDialog = uiCommon.QuestionDialog()
  30.                 self.questionDialog.SetText(localeInfo.REFINE_DO_YOU_SEPARATE_METIN)
  31.                 self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnDetachMetinFromItem))
  32.                 self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  33.                 self.questionDialog.Open()
  34.                 self.questionDialog.sourcePos = scrollSlotPos
  35.                 self.questionDialog.targetPos = targetSlotPos
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement