View Single Post
10-28-16, 01:20 PM   #27
Tonyleila
A Molten Giant
 
Tonyleila's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 758
Thanks for the reply Phanx! I think I made exactly the changes you posted but I still get exactly the same error, so I guess its something different going on here. I also disable all other addons.
Code:
13x LinkHover\LinkHover-1.6.lua:34: attempt to index local 'link' (a nil value)
LinkHover\LinkHover-1.6.lua:34: in function <LinkHover\LinkHover.lua:33>

.........
New code:

Lua Code:
  1. local showLinkType = {
  2.             -- Normal tooltip things:
  3.             achievement  = true,
  4.             enchant      = true,
  5.             glyph        = true,
  6.             item         = true,
  7.             instancelock = true,
  8.             quest        = true,
  9.             spell        = true,
  10.             talent       = true,
  11.             unit         = true,
  12.             currency       = true,
  13.             -- Special tooltip things:
  14.             battlepet           = false,
  15.             battlePetAbil       = false,
  16.             garrfollowerability = false,
  17.             garrfollower        = false,
  18.             garrmission         = false,
  19.         }
  20.          
  21.         local function OnHyperlinkEnter(frame, link, text)
  22.             local normal = showLinkType[link:match("(%a+):%d+")]
  23.             if normal == true then
  24.                 GameTooltip:SetOwner(ChatFrame1Tab, "ANCHOR_TOPLEFT", 20, 20)
  25.                 GameTooltip:SetHyperlink(link)
  26.                 GameTooltip:Show()
  27.             elseif normal == false then
  28.                 -- Uses a special tooltip, just let the default function handle it.
  29.                 SetItemRef(link, text, "LeftButton", frame)
  30.             end
  31.         end
  32.      
  33.         local function OnHyperlinkLeave(frame, link, text)
  34.             local normal = showLinkType[link:match("(%a+):%d+")]
  35.             if normal == true then
  36.                 GameTooltip:Hide()
  37.             elseif normal == false then
  38.                 -- Uses a special tooltip, just let the default function handle it.
  39.                 SetItemRef(link, text, "LeftButton", frame)
  40.             end
  41.         end
  42.          
  43.         local function RegisterFrame(frame)
  44.             frame:SetScript("OnHyperlinkEnter", OnHyperlinkEnter)
  45.             frame:SetScript("OnHyperlinkLeave", OnHyperlinkLeave)
  46.         end
  47.          
  48.         local f = CreateFrame("Frame")
  49.         f:RegisterEvent("PLAYER_LOGIN")
  50.         f:SetScript("OnEvent", function(self, event, name)
  51.             if event == "PLAYER_LOGIN" then
  52.                 for i = 1, NUM_CHAT_WINDOWS do
  53.                     RegisterFrame(_G["ChatFrame"..i])
  54.                 end
  55.             end
  56.             if GuildBankMessageFrame then
  57.                 RegisterFrame(GuildBankMessageFrame)
  58.                 self:UnregisterAllEvents()
  59.                 self:SetScript("OnEvent", nil)
  60.                 RegisterFrame = nil
  61.             else
  62.                 self:RegisterEvent("ADDON_LOADED")
  63.             end
  64.         end)
__________________
Author of: LeilaUI and Aurora: Missing Textures
__________________

Last edited by Tonyleila : 10-28-16 at 01:23 PM.
  Reply With Quote