From be37050db82600a5267347f4bbee85f46c866cba Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Mon, 25 Aug 2014 00:27:16 +0200 Subject: [PATCH] Add support for lockpicking in the TradeFrame --- Molinari.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Molinari.lua b/Molinari.lua index ef09de9..490feeb 100644 --- a/Molinari.lua +++ b/Molinari.lua @@ -24,7 +24,11 @@ local function ApplyButton(itemLink, spell, r, g, b) local slot = parent:GetID() local bag = parent:GetParent():GetID() - if(GetContainerItemLink(bag, slot) == itemLink) then + local show = true + if(GetTradeTargetItemLink(7) == itemLink) then + Molinari:SetAttribute('alt-type1', 'macro') + Molinari:SetAttribute('macrotext', string.format('/cast %s\n/run ClickTargetTradeButton(7)', spell)) + elseif(GetContainerItemLink(bag, slot) == itemLink) then if(type(spell) == 'number') then Molinari:SetAttribute('alt-type1', 'item') Molinari:SetAttribute('item', GetItemInfo(spell)) @@ -35,6 +39,11 @@ local function ApplyButton(itemLink, spell, r, g, b) Molinari:SetAttribute('target-bag', bag) Molinari:SetAttribute('target-slot', slot) + else + show = false + end + + if(show) then Molinari:SetAllPoints(parent) Molinari:Show() -- 1.7.9.5