From 5e26a6f1863f1066509a1e7de831a676a40db834 Mon Sep 17 00:00:00 2001 From: Ackis Date: Thu, 6 Nov 2008 16:57:35 +0000 Subject: [PATCH] Ackis Recipe List: - Link the tool tip to the ARL Frame - Rename the ARL frame from addon.Frame to AckisRecipeList.Frame - Stop adding the spell link to the tooltip - Add the spell info to a second tooltip anchored to the first one - Dry-coded (Compiles with luac -p) --- ARLFrame.lua | 25 ++++++++++++------------- AckisRecipeList.lua | 3 ++- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ARLFrame.lua b/ARLFrame.lua index 8e01d33..38fa343 100644 --- a/ARLFrame.lua +++ b/ARLFrame.lua @@ -78,6 +78,7 @@ local allSpecTable = {} local playerData = {} local arlTooltip = _G["arlTooltip"] +local arlTooltip2 = _G["arlTooltip2"] -- To make tabbing between professions easier local SortedProfessions = { @@ -1686,24 +1687,20 @@ local function GenerateTooltipContent(owner, rIndex, playerFaction, exclude) clr1 = addon:hexcolor("NORMAL") + gttAdd(0, -1, 0, 0, L["ALT_CLICK"], clr1) + gttAdd(0, -1, 0, 1, L["CTRL_CLICK"], clr1) + gttAdd(0, -1, 0, 1, L["SHIFT_CLICK"], clr1) + local spelllink = recipeDB[rIndex]["RecipeLink"] if (spelllink) then - gttAdd(0, 0, 0, 0, spelllink, clr1) + arlTooltip2:SetHyperlink(spelllink) end - -- Spacer - gttAdd(0, 0, 0, 0, ".", addon:hexcolor("BLACK")) - - clr1 = addon:hexcolor("NORMAL") - - gttAdd(0, -1, 0, 0, L["ALT_CLICK"], clr1) - gttAdd(0, -1, 0, 1, L["CTRL_CLICK"], clr1) - gttAdd(0, -1, 0, 1, L["SHIFT_CLICK"], clr1) - arlTooltip:Show() + arlTooltip2:Show() end @@ -3083,10 +3080,10 @@ function addon:CreateFrame( if (not addon.Frame) then -- Create the main frame - addon.Frame = CreateFrame("Frame", "addon.Frame", UIParent) + addon.Frame = CreateFrame("Frame", "AckisRecipeList.Frame", UIParent) --Allows ARL to be closed with the Escape key - tinsert(UISpecialFrames, "addon.Frame") + tinsert(UISpecialFrames, "AckisRecipeList.Frame") addon.Frame:SetWidth(293) addon.Frame:SetHeight(447) @@ -3261,7 +3258,9 @@ function addon:CreateFrame( ARL_ProgressBarText:SetText(pbCur .. " / " .. pbMax .. " - " .. math.floor(pbCur / pbMax * 100) .. "%") -- I'm going to use my own tooltip for recipebuttons - arlTooltip = CreateFrame("GameTooltip", "arlTooltip", nil, "GameTooltipTemplate") + arlTooltip = CreateFrame("GameTooltip", "arlTooltip", addon.Frame, "GameTooltipTemplate") + arlTooltip2 = CreateFrame("GameTooltip", "arlTooltip2", arlTooltip, "GameTooltipTemplate") + arlTooltip2:SetPoint("TOPLEFT", arlTooltip, "TOPRIGHT") -- The main recipe list buttons and scrollframe addon.PlusListButton = {} diff --git a/AckisRecipeList.lua b/AckisRecipeList.lua index 977c02c..9adff40 100644 --- a/AckisRecipeList.lua +++ b/AckisRecipeList.lua @@ -73,7 +73,8 @@ addon.ScanButton = nil addon.Frame = nil -- tooltip needs to be global so I can access individual lines in it and -- modify then -_G["arlTooltip"]= nil +_G["arlTooltip"] = nil +_G["arlTooltip2"] = nil -- Make global API calls local to speed things up -- 1.7.9.5