From da14e7400b6dcd1a8cd59f772a6112d2dedd8444 Mon Sep 17 00:00:00 2001 From: torhal Date: Sun, 24 May 2009 16:35:12 +0000 Subject: [PATCH] Made the clickable tooltip acquire when needed and release when done. Moved its callback handler setting to its Acquire point. --- ARLFrame.lua | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ARLFrame.lua b/ARLFrame.lua index a37a40c..24e71fe 100644 --- a/ARLFrame.lua +++ b/ARLFrame.lua @@ -3217,7 +3217,7 @@ end ------------------------------------------------------------------------------- -- Alt-Tradeskills tooltip ------------------------------------------------------------------------------- -local clicktip = QTipClick:Acquire("ARL_Clickable", 1, "CENTER") +local clicktip ------------------------------------------------------------------------------- -- Data used in HandleTTClick() and GenerateClickableTT() @@ -3356,8 +3356,6 @@ local function HandleTTClick(event, cell, arg, button) end end -clicktip:SetCallback("OnMouseDown", HandleTTClick) - -- Description: Creates the initial frame to display recipes into function addon:CreateFrame( @@ -4598,24 +4596,24 @@ function addon:CreateFrame( ARL_MiscAltBtn:RegisterForClicks("LeftButtonUp") ARL_MiscAltBtn:SetScript("OnClick", function(this, button) - clicktip:SetParent(this) - - if clicktip:IsShown() then + if clicktip then if not click_info.modified then - clicktip:Hide() + clicktip = QTipClick:Release(clicktip) twipe(click_info) else twipe(click_info) GenerateClickableTT(this) end else + clicktip = QTipClick:Acquire("ARL_Clickable", 1, "CENTER") + clicktip:SetCallback("OnMouseDown", HandleTTClick) twipe(click_info) GenerateClickableTT(this) end end) ARL_MiscAltBtn:SetScript("OnHide", function(this, button) - clicktip:Hide() + clicktip = QTipClick:Release(clicktip) twipe(click_info) end) -- 1.7.9.5