Made the clickable tooltip acquire when needed and release when done. Moved its callback handler setting to its Acquire point.
torhal [05-24-09 - 16:35]
Made the clickable tooltip acquire when needed and release when done. Moved its callback handler setting to its Acquire point.
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)