From 2257d19666e2402bcee3a06a1820c020f1a5354d Mon Sep 17 00:00:00 2001 From: Ignifazius Date: Thu, 3 Sep 2015 13:11:04 +0200 Subject: [PATCH] limiting the ID=0 workaround some other frames also show ID=0 (link QuestMapFrame or TradeFrame), so limit this workaround to profession window --- BagSync.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BagSync.lua b/BagSync.lua index ebcfae9..e6f1c39 100644 --- a/BagSync.lua +++ b/BagSync.lua @@ -831,16 +831,16 @@ local function AddCurrencyToTooltip(frame, currencyName) end end -local function AddItemToTooltip(frame, link) +local function AddItemToTooltip(frame, link) --workaround if (link) then local itemId = tonumber(string.match(link, "item:(%d+):")) -- get itemID // itemID seems to be "0" for every reagent in profession window?! - if (itemId == 0) then + if (itemId == 0 and TradeSkillFrame:IsVisible()) then -- some other frames show ID = 0 aswell, so limit this workaround to the profession window local newItemId - if (GetMouseFocus():GetName()) == "TradeSkillSkillIcon" then --replace TradeSkill + if ((GetMouseFocus():GetName()) == "TradeSkillSkillIcon") then --replace TradeSkill newItemId = tonumber(GetTradeSkillItemLink(TradeSkillFrame.selectedSkill):match("item:(%d+):")) else -- could check if a reagent is under mouse, but since we have to check it 3 lines later again... for i = 1, 12 do -- how many reagents can a reciepe have? lets assume not more than 12 - if (GetMouseFocus():GetName()) == "TradeSkillReagent"..i then --replace TradeSkillReagents + if ((GetMouseFocus():GetName()) == "TradeSkillReagent"..i) then --replace TradeSkillReagents newItemId = tonumber(GetTradeSkillReagentItemLink(TradeSkillFrame.selectedSkill, i):match("item:(%d+):")) break --end loop if correct one already found end -- 1.7.9.5