Quantcast
WoWInterface - View Single Post - New artifact API
View Single Post
08-18-18, 12:32 AM   #4
gmarco
A Frostmaul Preserver
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 290
Hi,

After the advice on /api helper I easily succeded in implement a simple tracking of the new artifact in my LDB gmexp.

The only thing that I am unable to do is to get the name ("HEART OF AZEROTH") from the item
Is it defined as a global value G_* ?

Now I have made an ugly string but I'd like to avoid a variable to prevent to localize it by hand.

Lua Code:
  1. if C_AzeriteItem.HasActiveAzeriteItem() then
  2.  
  3.         tooltip:AddLine(" ")
  4.    
  5.         local azeriteItemLocation = C_AzeriteItem.FindActiveAzeriteItem()
  6.         local xp, totalLevelXP = C_AzeriteItem.GetAzeriteItemXPInfo(azeriteItemLocation)
  7.        
  8.         tooltip:AddDoubleLine(L["Artifact"], "Heart of Azeroth",1, 1, 1, 0, 1, 1)
  9.         tooltip:AddDoubleLine(L["Artifact Power"],C_AzeriteItem.GetPowerLevel(azeriteItemLocation), 1, 1, 1, 0, 1, 0)
  10.         tooltip:AddDoubleLine(L["Power to next rank"],totalLevelXP - xp, 1, 1, 1, 1, 0, 0)
  11.         tooltip:AddDoubleLine(L["Progress in rank %"], string_format("%.1f", xp/totalLevelXP*100) , 1, 1, 1, 0, 1, 0)
  12.        
  13.     end

Thanks to everyone for attention.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote