Compare commits

...

4 Commits
1.4 ... 1.4.2

View File

@ -18,6 +18,38 @@ local AdditionalMillableItems = {
109127,
109128,
109129,
-- Legion herbs
124101,
124102,
124103,
124104,
124105,
124106,
128304,
}
local AdditionalProspectableItems = {
-- Legion ore
123918,
123919,
}
local MassMilling = {
-- wod
[109124] = 190381,
[109125] = 190382,
[109126] = 190383,
[109127] = 190384,
[109128] = 190385,
[109129] = 190386,
-- legion
[124101] = 209658,
[124102] = 209659,
[124103] = 209660,
[124104] = 209661,
[124105] = 209662,
[124106] = 209664,
[128304] = 210116,
}
local UnProspectableItems = {
@ -578,7 +610,7 @@ function Breakables:CreateButtonFrame()
frame:SetScript("OnMouseUp", frame.OnMouseUpFunc)
frame:SetClampedToScreen(true)
local spellName, _, texture = GetSpellInfo(self:GetSpellIdFromProfessionButton(frame))
local spellName, _, texture = GetSpellInfo(self:GetSpellIdFromProfessionButton(frame.type))
frame:SetAttribute("type1", "spell")
frame:SetAttribute("spell1", spellName)
@ -605,10 +637,16 @@ function Breakables:CreateButtonFrame()
end
end
function Breakables:GetSpellIdFromProfessionButton(btn)
return (btn.type == BREAKABLE_HERB and MillingId)
or (btn.type == BREAKABLE_ORE and ProspectingId)
or (btn.type == BREAKABLE_DE and DisenchantId)
function Breakables:GetSpellIdFromProfessionButton(itemType, itemId)
if itemType == BREAKABLE_HERB and itemId ~= nil then
if MassMilling[itemId] ~= nil and IsSpellKnown(MassMilling[itemId]) then
return MassMilling[itemId]
end
end
return (itemType == BREAKABLE_HERB and MillingId)
or (itemType == BREAKABLE_ORE and ProspectingId)
or (itemType == BREAKABLE_DE and DisenchantId)
or PickLockId
end
@ -758,10 +796,11 @@ function Breakables:FindBreakables(bag)
btn.text:SetText(foundBreakables[i][IDX_COUNT] .. appendText)
end
local BreakableAbilityName = GetSpellInfo((foundBreakables[i][IDX_BREAKABLETYPE] == BREAKABLE_HERB and MillingId)
or (foundBreakables[i][IDX_BREAKABLETYPE] == BREAKABLE_ORE and ProspectingId)
or (foundBreakables[i][IDX_BREAKABLETYPE] == BREAKABLE_DE and DisenchantId)
or PickLockId)
local BreakableAbilityName = GetSpellInfo(self:GetSpellIdFromProfessionButton(foundBreakables[i][IDX_BREAKABLETYPE], self:GetItemIdFromLink(foundBreakables[i][IDX_LINK])))
--GetSpellInfo((foundBreakables[i][IDX_BREAKABLETYPE] == BREAKABLE_HERB and MillingId)
--or (foundBreakables[i][IDX_BREAKABLETYPE] == BREAKABLE_ORE and ProspectingId)
--or (foundBreakables[i][IDX_BREAKABLETYPE] == BREAKABLE_DE and DisenchantId)
--or PickLockId)
btn:SetAttribute("spell", BreakableAbilityName)
if isLockedItem then
@ -825,7 +864,7 @@ end
function Breakables:OnEnterProfessionButton(btn)
GameTooltip:SetOwner(btn, "ANCHOR_BOTTOMLEFT")
GameTooltip:SetSpellByID(self:GetSpellIdFromProfessionButton(btn))
GameTooltip:SetSpellByID(self:GetSpellIdFromProfessionButton(btn.type))
GameTooltip:AddLine(" ")
GameTooltip:AddLine(L["Hold shift and left-click to drag the Breakables bar around."], 1, 1, 1, 1)
@ -947,10 +986,19 @@ function Breakables:FindBreakablesInSlot(bagId, slotId)
end
end
if CanProspect and prospectable then
for i=1,#UnProspectableItems do
if UnProspectableItems[i] == itemId then
prospectable = false
if CanProspect then
if not prospectable then
for i=1,#AdditionalProspectableItems do
if AdditionalProspectableItems[i] == itemId then
prospectable = true
end
end
end
if prospectable then
for i=1,#UnProspectableItems do
if UnProspectableItems[i] == itemId then
prospectable = false
end
end
end
end