View Single Post
09-05-17, 11:34 AM   #4
Uitat
A Chromatic Dragonspawn
 
Uitat's Avatar
AddOn Author - Click to view addons
Join Date: May 2011
Posts: 162
i think i may have found a way around this

Lua Code:
  1. --Thank you for your help
  2. --SDPhantom
  3. --Phanx
  4. --Fizzlemizz
  5. local AXP_COLOR = { r = 0.6, g = 0.2, b = 0.1 }
  6. --Lets set up the Frame
  7. local derArtifactBar = CreateFrame("Statusbar", "derArtifactBar",artifactFrame)
  8. derArtifactBar:SetPoint("CENTER", 0, 0)
  9. derArtifactBar:SetHeight(18)
  10. derArtifactBar:SetWidth(artifactFrame:GetWidth() * .968)
  11. derArtifactBar:SetStatusBarTexture("Interface\\AddOns\\_Deranjata\\media\\cast\\Waterline")
  12. derArtifactBar:SetStatusBarColor(AXP_COLOR.r, AXP_COLOR.g, AXP_COLOR.b, 0.5)
  13. derArtifactBar:SetBackdrop({
  14.     bgFile =  "Interface\\AddOns\\_Deranjata\\media\\cast\\Lines",
  15.     insets = { left = 1, right = 1, top = 1, bottom = 1 }
  16. })
  17. derArtifactBar:SetBackdropColor(0.1, 0.1, 0.1)
  18. derArtifactBar:SetBackdropBorderColor(0.6, 0.6, 0.6)
  19. --lets clear any text then set out centerpoint
  20. derArtifactBar.Text=derArtifactBar:CreateFontString(nil, "OVERLAY", "GameFontNormal")
  21. derArtifactBar.Text:SetPoint("CENTER")      
  22.  
  23. --Registering out watched events
  24. derArtifactBar:RegisterEvent("PLAYER_ENTERING_WORLD")
  25. derArtifactBar:RegisterEvent("ARTIFACT_XP_UPDATE")
  26. derArtifactBar:RegisterEvent("UNIT_INVENTORY_CHANGED")
  27.  
  28. -- now lets update the position and text on the bar so we can always have accurate info
  29. derArtifactBar:SetScript("OnEvent", function(self, event, ...)
  30.     if not HasArtifactEquipped() then self:Hide() return end
  31.     self:Show()
  32.  
  33.     --local itemID, altItemID, name, icon, xp, pointsSpent = C_ArtifactUI.GetEquippedArtifactInfo()
  34.     local itemID, altItemID, name, icon, xp, pointsSpent, quality, artifactAppearanceID, appearanceModID, itemAppearanceID, altItemAppearanceID, altOnTop, artifactTier = C_ArtifactUI.GetEquippedArtifactInfo()
  35.     local numPoints, artifactXP, xpForNextPoint = MainMenuBar_GetNumArtifactTraitsPurchasableFromXP(pointsSpent, xp, artifactTier) --(pointsSpent, totalXP)
  36.     self:SetMinMaxValues(0,xpForNextPoint)
  37.     self:SetValue(artifactXP)
  38.  
  39.     self.Text:SetFormattedText("Artifact XP: %d / %d       +%d Points",artifactXP,xpForNextPoint,numPoints)
  40. end)
__________________
  Reply With Quote