View Single Post
03-20-13, 04:04 PM   #28
Sharparam
A Flamescale Wyrmkin
 
Sharparam's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2011
Posts: 102
Not sure about the later parts, but the first part can be made more readable/easier to maintain:
lua Code:
  1. local supportedTypes = {
  2.     item = true,
  3.     spell = true,
  4.     achievement = true,
  5.     enchant = true,
  6.     quest = true,
  7.     talent = true,
  8.     unit = true,
  9.     glyph = true
  10. }
  11.  
  12. local function ChatlinkTooltips_ShowTip(self, linkData)
  13.     local LinkType = string.split(":", linkData)
  14.     if supportedTypes[LinkType] then
  15.         GameTooltip:SetOwner(self, "ANCHOR_CURSOR")
  16.         GameTooltip:SetHyperlink(linkData)
  17.         GameTooltip:Show()
  18.     end
  19. end
  Reply With Quote