Quantcast WoWInterface - View Single Post - Frame error from Artifact
View Single Post
09-06-17, 06:39 AM   #9
Uitat
A Flamescale Wyrmkin
 
Uitat's Avatar
AddOn Author - Click to view addons
Join Date: May 2011
Posts: 141
Originally Posted by Fizzlemizz View Post
Lua Code:
  1. local GetCostForPointAtRank = C_ArtifactUI.GetCostForPointAtRank
  2. local itemID, altItemID, name, icon, artifactXP, pointsSpent, quality, artifactAppearanceID, appearanceModID, itemAppearanceID, altItemAppearanceID, altOnTop, artifactTier = C_ArtifactUI.GetEquippedArtifactInfo()
  3. local pointsAvailable = 0
  4. local xpForNextPoint = GetCostForPointAtRank(pointsSpent + pointsAvailable, artifactTier) or 0
  5. while artifactXP >= xpForNextPoint  do
  6.     artifactXP = artifactXP - xpForNextPoint
  7.     pointsAvailable = pointsAvailable + 1
  8.     xpForNextPoint = GetCostForPointAtRank(pointsSpent + pointsAvailable, artifactTier) or 0
  9. end
  10. local text = floor((artifactXP/xpForNextPoint)*100).."%"

You might want to add a check for artifactXP/xpForNextPoint being less than 0 or greater than 1.
in a wierd little way i do that here
Lua Code:
  1. if not HasArtifactEquipped() then self:Hide() return end
__________________
  Reply With Quote