self.UI_Elements["SKILL_GRID_SLOT"].SetSelectEmptySlotEvent(ui.__mem_func__(self.MoveInOutSkillSlot))
self.UI_Elements["SKILL_GRID_SLOT"].SetSelectItemSlotEvent(ui.__mem_func__(self.MoveInOutSkillSlot))
self.UI_Elements["SKILL_GRID_SLOT"].SetUnselectItemSlotEvent(ui.__mem_func__(self.MoveInOutSkillSlot))
def MoveInOutSkillSlot(self, selectedSlot):
if mouseModule.mouseController.isAttached():
attachedType = mouseModule.mouseController.GetAttachedType()
attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()
attachedItemSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
skillIndex = 0
if player.SLOT_TYPE_QUICK_SLOT == attachedType:
(quickSlotType, position) = player.GetGlobalQuickSlot(attachedItemSlotPos)
if quickSlotType == player.SLOT_TYPE_SKILL:
skillIndex = player.GetSkillIndex(position)
elif player.SLOT_TYPE_SKILL == attachedType:
skillIndex = player.GetSkillIndex(attachedItemSlotPos)
else:
chat.AppendChat(1, "Unknown window type")
mouseModule.mouseController.DeattachObject()
return
if not skillIndex:
chat.AppendChat(1, "Unknown skill index")
mouseModule.mouseController.DeattachObject()
return
skillRealSlot = player.GetSkillSlotIndex(skillIndex)
(coolTime, elapsedTime) = player.GetSkillCoolTime(skillRealSlot)