# HG changeset patch # User Nenue # Date 1531874879 14400 # Node ID 5005aecc2dc8298566f02f38f948bddb2b64bc75 # Parent 73810564e4b819071ad5f02f85b4520f1480f870 more 8.0.1 fire spotting diff -r 73810564e4b8 -r 5005aecc2dc8 KeyButton.lua --- a/KeyButton.lua Tue Jul 17 16:18:31 2018 -0400 +++ b/KeyButton.lua Tue Jul 17 20:47:59 2018 -0400 @@ -202,91 +202,93 @@ local name, icon, _, macroName, macroText local pickupID, pickupBook - if actionType == 'spell' then - local realName = GetSpellInfo(subData) - name, _, icon, _, _, _, actionID = GetSpellInfo(subData) + if actionType == 'spell' then + local realName = GetSpellInfo(subData) + name, _, icon, _, _, _, actionID = GetSpellInfo(subData) - if TALENT_SPELLS[actionID] then - name = TALENT_SPELLS[actionID].actionName - actionID = TALENT_SPELLS[actionID].actionID - icon = TALENT_SPELLS[actionID].icon - elseif actionType == 'macro' then - name, icon, macroText = GetMacroInfo(actionID) - macroName = name - elseif actionType == 'petaction' then - if CURSOR_SPELLSLOT and CURSOR_BOOKTYPE then + if TALENT_SPELLS[actionID] then + name = TALENT_SPELLS[actionID].actionName + actionID = TALENT_SPELLS[actionID].actionID + icon = TALENT_SPELLS[actionID].icon + elseif actionType == 'macro' then + name, icon, macroText = GetMacroInfo(actionID) + macroName = name + elseif actionType == 'petaction' then + if CURSOR_SPELLSLOT and CURSOR_BOOKTYPE then - local spellType, spellID = GetSpellBookItemInfo(CURSOR_SPELLSLOT, CURSOR_BOOKTYPE) - local spellName, spellText = GetSpellBookItemName(CURSOR_SPELLSLOT, CURSOR_BOOKTYPE) - if spellType == 'PETACTION' then - name = spellName - actionID = spellText - icon = CURSOR_TEXTURE + local spellType, spellID = GetSpellBookItemInfo(CURSOR_SPELLSLOT, CURSOR_BOOKTYPE) + local spellName, spellText = GetSpellBookItemName(CURSOR_SPELLSLOT, CURSOR_BOOKTYPE) + if spellType == 'PETACTION' then + name = spellName + actionID = spellText + icon = CURSOR_TEXTURE + else + name, _, icon = GetSpellInfo(spellID) + actionID = spellID + end + + pickupID = CURSOR_SPELLSLOT + pickupBook = CURSOR_BOOKTYPE else - name, _, icon = GetSpellInfo(spellID) - actionID = spellID + + end - pickupID = CURSOR_SPELLSLOT - pickupBook = CURSOR_BOOKTYPE - else + elseif actionType == 'mount' then + if subType == 0 then + name, _, icon = GetSpellInfo(SUMMON_RANDOM_FAVORITE_MOUNT_SPELL) + actionID = 0 + else + name, _, icon = GetMountInfoByID(actionID) + end + elseif actionType == 'item' then + name = GetItemInfo(actionID) + icon = GetItemIcon(actionID) + elseif actionType == 'battlepet' then + local speciesID, customName, level, xp, maxXp, displayID, isFavorite, petName, petIcon, petType, creatureID = GetPetInfoByPetID(actionID) + name = customName or petName + icon = petIcon end + local _, macroBody, command = kb.RegisterAction(actionType, actionID, name) + local slotInfo = { + command = command, + actionName = name, + iconPath = icon, + actionType = actionType, + actionID = actionID, + macroName = macroName, + macroText = macroText or macroBody, + spellbookSlot = pickupID, + spellbookType = pickupBook, + assignedKeys = {GetBindingKey(command)} + } - elseif actionType == 'mount' then - if subType == 0 then - name, _, icon = GetSpellInfo(SUMMON_RANDOM_FAVORITE_MOUNT_SPELL) - actionID = 0 + local isAssigned, isBound, assignedBy, boundBy = kb.IsCommandBound(self, command) + if isAssigned then + local popup = StaticPopupDialogs["SKELETONKEY_CONFIRM_ASSIGN_SLOT"] + popup.slot = self + popup.text = "Currently assigned in |cFFFFFF00"..tostring(kb.configHeaders[assignedBy]).."|r. Are you sure?" + popup.oldProfile = assignedBy + popup.args = {slotInfo} + SkeletonKey:SetScript('OnMouseWheel', nil) -- disable scrolling + StaticPopup_Show('SKELETONKEY_CONFIRM_ASSIGN_SLOT') else - name, _, icon = GetMountInfoByID(actionID) + kb.currentProfile.buttons[self:GetID()] = slotInfo + kb.LoadBinding(slotInfo) + self:SetSlot(slotInfo) + self:UpdateSlot() + self.active = nil + ClearCursor() + ResetCursor() end - elseif actionType == 'item' then - name = GetItemInfo(actionID) - icon = GetItemIcon(actionID) - elseif actionType == 'battlepet' then - - local speciesID, customName, level, xp, maxXp, displayID, isFavorite, petName, petIcon, petType, creatureID = GetPetInfoByPetID(actionID) - name = customName or petName - icon = petIcon - - end - local _, macroBody, command = kb.RegisterAction(actionType, actionID, name) - local slotInfo = { - command = command, - actionName = name, - iconPath = icon, - actionType = actionType, - actionID = actionID, - macroName = macroName, - macroText = macroText or macroBody, - spellbookSlot = pickupID, - spellbookType = pickupBook, - assignedKeys = {GetBindingKey(command)} - } - - local isAssigned, isBound, assignedBy, boundBy = kb.IsCommandBound(self, command) - if isAssigned then - local popup = StaticPopupDialogs["SKELETONKEY_CONFIRM_ASSIGN_SLOT"] - popup.slot = self - popup.text = "Currently assigned in |cFFFFFF00"..tostring(kb.configHeaders[assignedBy]).."|r. Are you sure?" - popup.oldProfile = assignedBy - popup.args = {slotInfo} - SkeletonKey:SetScript('OnMouseWheel', nil) -- disable scrolling - StaticPopup_Show('SKELETONKEY_CONFIRM_ASSIGN_SLOT') - else - kb.currentProfile.buttons[self:GetID()] = slotInfo - kb.LoadBinding(slotInfo) - self:SetSlot(slotInfo) - self:UpdateSlot() - self.active = nil - ClearCursor() - ResetCursor() end end end + do local PickupAction = { spell = _G.PickupSpell, diff -r 73810564e4b8 -r 5005aecc2dc8 SkeletonKey.xml --- a/SkeletonKey.xml Tue Jul 17 16:18:31 2018 -0400 +++ b/SkeletonKey.xml Tue Jul 17 20:47:59 2018 -0400 @@ -326,7 +326,7 @@ - +