View Single Post
01-16-15, 07:51 AM   #14
Tonyleila
A Molten Giant
 
Tonyleila's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 758
Thank you, but it gives this error and nothing is happening :S but the code is still awesome!

Code:
2x LinkHover\LinkHover-1.3.lua:52: 'for' limit must be a number
LinkHover\LinkHover-1.3.lua:52: in function <LinkHover\LinkHover.lua:50>

Locals:
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[linkData:match("^(.-):")]
  23.     if normal == true then
  24.         GameTooltip:SetOwner(WorldFrame, "ANCHOR_BOTTOMLEFT", 30, 310)
  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, linkData, link)
  34.     local normal = showLinkType[linkData:match("^(.-):")]
  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_FRAMES 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
__________________
  Reply With Quote