View Single Post
01-23-20, 01:39 AM   #5
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
Classic's skills tab is always in the same order: Class, Primary, Secondary, Weapon, Armor, and Language. Using the header text, the SKILLS global string, and some local tables:

Lua Code:
  1. local section, primary, secondary, other = 0, {}, {}, {}
  2.  
  3. for i = 1, GetNumSkillLines() do
  4.     local name, header, _, rank, _, _, max = GetSkillLineInfo(i)
  5.     if header then
  6.         section = section + 1
  7.         if section == 2 then
  8.             primary.n = name
  9.         elseif section == 3 then
  10.             secondary.n = name
  11.         end
  12.     else
  13.         tinsert( section == 2 and primary or section == 3 and secondary or other, {name,rank..' / '..max,.75,.9,1,.3,1,.3} )
  14.     end
  15. end
  16.  
  17. GameTooltip:AddLine(primary.n)
  18. for i = 1, #primary do
  19.     GameTooltip:AddDoubleLine( unpack( primary[i] ) )
  20. end
  21.  
  22. GameTooltip:AddLine(" ")
  23. GameTooltip:AddLine(secondary.n)
  24. for i = 1, #secondary do
  25.     GameTooltip:AddDoubleLine( unpack( secondary[i] ) )
  26. end
  27.  
  28. GameTooltip:AddLine(" ")
  29. GameTooltip:AddLine(SKILLS)
  30. for i = 1, #other do
  31.     GameTooltip:AddDoubleLine( unpack( other[i] ) )
  32. end
  Reply With Quote