Thread: artifact xp bar
View Single Post
09-01-16, 05:32 AM   #15
Uitat
A Chromatic Dragonspawn
 
Uitat's Avatar
AddOn Author - Click to view addons
Join Date: May 2011
Posts: 162
ok in end

ok so at the end of this all it works fine now and i am mostly happy. now i just want to have a + then number for levels accumulated on the bar before spending, i can figure that out at some time , for now i am just glad to have this

Lua Code:
  1. local AXP_COLOR = { r = 0.6, g = 0.2, b = 0.1 }
  2.  
  3. local derArtifactBar = CreateFrame("Statusbar", "derArtifactBar",artifactFrame)
  4. derArtifactBar:SetPoint("CENTER", 0, 0)
  5. derArtifactBar:SetHeight(18)
  6. derArtifactBar:SetWidth(artifactFrame:GetWidth() * .968)
  7. derArtifactBar:SetStatusBarTexture("Interface\\AddOns\\_Deranjata\\media\\cast\\Waterline")
  8. derArtifactBar:SetStatusBarColor(AXP_COLOR.r, AXP_COLOR.g, AXP_COLOR.b, 0.5)
  9. derArtifactBar:SetBackdrop({
  10.     bgFile =  "Interface\\AddOns\\_Deranjata\\media\\cast\\Lines",
  11.     insets = { left = 1, right = 1, top = 1, bottom = 1 }
  12. })
  13. derArtifactBar:SetBackdropColor(0.1, 0.1, 0.1)
  14. derArtifactBar:SetBackdropBorderColor(0.6, 0.6, 0.6)
  15. derArtifactBar:RegisterEvent("PLAYER_ENTERING_WORLD")
  16. derArtifactBar:RegisterEvent("ARTIFACT_XP_UPDATE")
  17. derArtifactBar:RegisterEvent("UNIT_INVENTORY_CHANGED")
  18. derArtifactBar:SetScript("OnEvent", function(self, event, ...)
  19.  
  20. local showArtifact = HasArtifactEquipped()
  21.       if not showArtifact then
  22.           if self:IsShown() then
  23.               self:Hide()
  24.           end
  25.           return
  26.       end
  27.       if not self:IsShown() then
  28.           self:Show()
  29.       end
  30. local itemID, altItemID, name, icon, totalXP, pointsSpent = C_ArtifactUI.GetEquippedArtifactInfo()
  31. local numPoints, artifactXP, xpForNextPoint = MainMenuBar_GetNumArtifactTraitsPurchasableFromXP(pointsSpent, totalXP)
  32.         self:SetMinMaxValues(0,xpForNextPoint)
  33.         self:SetValue(artifactXP)
  34.        
  35. local bar = CreateFrame("StatusBar", nil, derArtifactBar)
  36.         bar:SetAllPoints(true)
  37. local text = bar:CreateFontString(nil, "OVERLAY", "GameFontNormal")
  38.         text:SetPoint("CENTER")    
  39.         text:SetFormattedText("Artifact XP: %d / %d ",artifactXP,xpForNextPoint)
  40. end)
__________________
  Reply With Quote