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:
local AXP_COLOR = { r = 0.6, g = 0.2, b = 0.1 }
local derArtifactBar = CreateFrame("Statusbar", "derArtifactBar",artifactFrame)
derArtifactBar:SetPoint("CENTER", 0, 0)
derArtifactBar:SetHeight(18)
derArtifactBar:SetWidth(artifactFrame:GetWidth() * .968)
derArtifactBar:SetStatusBarTexture("Interface\\AddOns\\_Deranjata\\media\\cast\\Waterline")
derArtifactBar:SetStatusBarColor(AXP_COLOR.r, AXP_COLOR.g, AXP_COLOR.b, 0.5)
derArtifactBar:SetBackdrop({
bgFile = "Interface\\AddOns\\_Deranjata\\media\\cast\\Lines",
insets = { left = 1, right = 1, top = 1, bottom = 1 }
})
derArtifactBar:SetBackdropColor(0.1, 0.1, 0.1)
derArtifactBar:SetBackdropBorderColor(0.6, 0.6, 0.6)
derArtifactBar:RegisterEvent("PLAYER_ENTERING_WORLD")
derArtifactBar:RegisterEvent("ARTIFACT_XP_UPDATE")
derArtifactBar:RegisterEvent("UNIT_INVENTORY_CHANGED")
derArtifactBar:SetScript("OnEvent", function(self, event, ...)
local showArtifact = HasArtifactEquipped()
if not showArtifact then
if self:IsShown() then
self:Hide()
end
return
end
if not self:IsShown() then
self:Show()
end
local itemID, altItemID, name, icon, totalXP, pointsSpent = C_ArtifactUI.GetEquippedArtifactInfo()
local numPoints, artifactXP, xpForNextPoint = MainMenuBar_GetNumArtifactTraitsPurchasableFromXP(pointsSpent, totalXP)
self:SetMinMaxValues(0,xpForNextPoint)
self:SetValue(artifactXP)
local bar = CreateFrame("StatusBar", nil, derArtifactBar)
bar:SetAllPoints(true)
local text = bar:CreateFontString(nil, "OVERLAY", "GameFontNormal")
text:SetPoint("CENTER")
text:SetFormattedText("Artifact XP: %d / %d ",artifactXP,xpForNextPoint)
end)